[FF] prevent_approval_removal_during_merge -- Block approval removal while a merge is in flight
Summary
Roll out the feature currently behind the prevent_approval_removal_during_merge feature flag.
- DRI: @marc_shaw
- Team Slack channel:
#g_code_review
Note
Process and guidance live in the docs — this issue is just the commands and a place to track the rollout. "Rolling out" means incrementally enabling the flag on GitLab.com to validate stability — it is not the same as releasing the feature, which happens when the flag is removed. Feature flag controls · Feature flag lifecycle
What could go wrong?
Blast radius is projects that require approvals. When the flag is enabled:
MergeRequests::RemoveApprovalServicerefuses to remove an approval while the MR islocked?(the git-merge window), surfaced as a404by the unapprove API.EE::MergeRequests::MergeServicere-reads approval (fresh cache) inside the merge lock and aborts the merge if the MR is no longer approved.
Main risk: a false-negative approval re-check aborting a legitimate merge at the git-write boundary (the in-lock approved? disagreeing with the earlier validate! mergeability check). Watch merge-service error rates and Merge request is not approved merge errors on https://dashboards.gitlab.net. Rollback is instant via the flag — flag off restores the prior behaviour, including the previous approval-deletion logging.
Rollout
Run all production /chatops in #production and cross-post the results to #g_code_review. Background: incremental rollout process, feature actors.
Non-production
/chatops gitlab run feature set prevent_approval_removal_during_merge 50 --actors --dev --pre --staging --staging-ref
/chatops gitlab run feature set prevent_approval_removal_during_merge true --dev --pre --staging --staging-refProduction — percentage rollout (wait ≥15 min between steps, watch dashboards):
/chatops gitlab run feature set prevent_approval_removal_during_merge <percentage> --actorsOr target specific actors instead:
/chatops gitlab run feature set --project=gitlab-org/gitlab,gitlab-org/gitlab-foss prevent_approval_removal_during_merge true
/chatops gitlab run feature set --group=gitlab-org,gitlab-com prevent_approval_removal_during_merge true
/chatops gitlab run feature set --user=marc_shaw prevent_approval_removal_during_merge trueBefore global rollout
Confirm the relevant gotchas before going to 100% — see enabling a feature for GitLab.com:
- Docs + version history updated
- Breaking changes announced, if any
- Change management issue opened, if required
- External API consumers handled with a fail-open mechanism, if applicable
Cleanup
Remove the flag once deemed stable — see cleaning up. Track it here, or open a follow-up Feature Flag Cleanup issue. Remove the flag and its YAML definition from the codebase, then:
/chatops gitlab run release check https://gitlab.com/gitlab-org/gitlab/-/merge_requests/243660 19.2
/chatops gitlab run feature delete prevent_approval_removal_during_merge --dev --pre --staging --staging-ref --productionRollback
/chatops gitlab run feature set prevent_approval_removal_during_merge false # production
/chatops gitlab run feature set prevent_approval_removal_during_merge false --dev --pre --staging --staging-ref # non-production
/chatops gitlab run feature delete prevent_approval_removal_during_merge --dev --pre --staging --staging-ref --production # remove entirely