Preserve Approvals in Merge Requests when switching the target branch
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=513182) </details> <!--IssueSummary end--> <!-- This template is a great use for issues that are feature::additions or technical tasks for larger issues.--> ### Proposal Expand the Merge Request Approval Rules to allow the customization of approval settings, such as `Prevent approvals by users who add commits`, `when a commit is added`, etc. Also, include the option to `remove approvals on target branch changes` so that they can work separately from commit events. #### Use cases * SDLC example 1 defines that feature branches require approvals first, to be then combined on release branches. The release branch can flag off the removed approvals on the target branch switch, preserving previous MRs' approvals. Today, we can't custom per branch, either flag to not dismiss approvals if `When a commit is added: Remove all approvals` is set for compliance. * SDLC example 2 defines approval rules for release branches by a specific group, even when they participate in it. Still, feature branches should prevent their approvals if participants - due compliance. Today, the config is global where we can't allow specific branches patterns to by-pass the `Prevent approvals by users who add commits`. A workaround is to keep it disabled and increase the approvals required. If shared repository, some teams may get out of members to approve if this flag is enabled, blocking or adding friction to the proccess. #### Design draft proposal Similar to integrations, we can use select to set custom per rule. ![Screenshot_2025-01-14_at_8.30.53_PM](/uploads/17acd63dd661370f62df800ad7555816/Screenshot_2025-01-14_at_8.30.53_PM.png) <!-- Label reminders Use the following resources to find the appropriate labels: - Use only one tier label choosing the lowest tier this is intended for - https://gitlab.com/gitlab-org/gitlab/-/labels - https://about.gitlab.com/handbook/product/categories/features/ -->
issue