Skip to content

Group approval invalidated if user is later removed from the group

What does this MR do and why?

After we merge a branch, we save the approval rules to the merge request. We should use these saved approval rules, rather than loading the project approval rules. This is to ensure that we are showing the correct rules at the time of merge, rather than the time of seeing the merged merge request.

Steps to reproduce

  1. For a project [ddd an approval rule])[https://docs.gitlab.com/ee/user/project/merge_requests/approvals/rules.html#add-an-approval-rule] specifying a group of users
  2. Create a MR and approve using a user from the specified group
  3. Merge the MR
  4. Remove the approving user from the group
  5. Browse to the MR
  6. Ensure the approvals rules are the same as when it was merged
  7. Switch to master branch, and check that the approval rules are different to when it was merged

Before:

Screenshot_2023-07-25_at_14.15.35

After:

Screenshot_2023-07-25_at_14.16.19

Related to #383689 (closed)

Edited by Marc Shaw

Merge request reports

Loading