Skip to content

Don't enrich commit info for approval checks

Marc Shaw requested to merge dont_enrich_commit_for_approval_check into master

What does this MR do and why?

This Merge Request is to stop enriching the commits when we are doing an approval check. This enrichment is done in order to remove merge_commits, but for the approval check, we want to include the merge_commits.

This hopefully will increase our performance when calculating the detailed_merge_status information, as when we request merge requests through the API, we sometimes have to call Gitaly, for a number of them, to enrich all the commits.

This is also behind a feature flag, as it will change the behaviour slightly. Previously merge_commits would have been exempt from authors of commits, being able to approve. This change will now not allow authors of merge commits to approve, when the setting is ticked.

To Test:

  1. Ensure only Prevent approvals by users who add commits is ticked in Project Settings > Merge Request
  2. Create an MR
  3. Commit and push a merge commit
  4. Ensure you can approve
  5. Turn on feature flag Feature.enable(:keep_merge_commits_for_approvals)
  6. Ensure you can not approve

Screenshots or screen recordings

How to set up and validate locally

MR acceptance checklist

Edited by Marc Shaw

Merge request reports