Skip to content

Preserve Approvals in Merge Requests when switching the target branch

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

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

Edited by 🤖 GitLab Bot 🤖