Add support to keep approvals in a stacked Merge Request when the prior Merge Request is merged
Problem statement
Suppose a project has the following Merge Request (MR) settings enabled:
- MRs must be approved before they can be merged.
- MRs cannot be approved by the author of the MR.
- Approvals are removed when a commit is added to the source branch.
Now suppose I have a chain (or stack) of Merge Requests (MRs) in this project as follows:
- MR1 – Branch B to Branch A.
- MR2 – Branch C to Branch B.
Suppose also that both MRs have been reviewed and approved by members of the project.
When I merge MR1, Branch B is deleted and GitLab is smart enough to change the destination branch of MR2 from Branch B to Branch A. This is great. This is what I expect to happen.
Sadly, GitLab also removes the approvals from MR2 which means I have to go back to members of the project and request another review of MR2.
Proposal
GitLab should keep the approvals in MR2 in the above scenario.
Or, at the least, GitLab should offer a Setting which allows a Merge Request's approvals to remain unchanged in the above scenario.
Caveat
I understand that it's technically possible for merge conflicts to arise in MR2 when MR2's destination branch is automatically changed in the above scenario from Branch B to Branch A.
In this case, I expect GitLab to simply call out the merge conflicts in MR2 and prevent a merge for this reason rather than removing the approvals.