Pipeline danger should error when using over 20 commits
Problem
We use shallow clone of 20 commits to verify our coverage, but on MRs that have more than 20 commits this fails with a cryptic errors message:
bundler: failed to load command: undercover (/builds/gitlab-org/gitlab/vendor/ruby/2.7.0/bin/undercover)
/builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/undercover-0.4.4/lib/undercover/changeset.rb:77:in `merge_base': object not found - no match for id (3152fcd56a47469df9a7966bda867b6ad393b5eb) (Rugged::OdbError)
This is due to the number of commits. We do a shallow clone of depth 20 but this MR now has 21 commits. So some commits need to be squashed.
Proposal
Add a danger rule that fails the pipeline if more than 20 commits have been added to the MR.
Original Discussion
The following discussion from !84053 (merged) should be addressed:
-
@mvanremmerden started a discussion: (+9 comments) @engwan I think I finally figured out the reason for the problem that we scoped out of !83687 (merged), and the right place in the call stack to fix it, would love to hear what you think about this and if I'm overlooking any unintended side effects.
@mrincon As you also reviewed !83687 (merged), I would love to get your eyes on this as well.