Loading
Remove the approval_rules_finalize_shorter_transaction feature flag
What does this MR do and why?
Removes the approval_rules_finalize_shorter_transaction feature flag and keeps the behaviour it gated. ApprovalRules::FinalizeService now always reads CODEOWNERS before opening the finalize transaction and bulk inserts group approvers with one statement per rule. The flag reached 100% on GitLab.com on 2026-09-30 with no issues.
Detailed context for AI agents
- Flag introduced in !255430 (merged) as part of #628868 (closed) (long
MergeWorkertransactions inApprovalRules::FinalizeService). - Rollout: verified both halves on GitLab.com on 2026-09-30, then 10% → 25% → 100% the same day. No exceptions logged against the flag, no change on the
MergeWorkerdashboard. - Changes: the
optimized_transaction?memoized predicate is deleted, theapprovals_required_pre_mergepre-read runs unconditionally, andmerge_group_members_into_usersalways callsinsert_group_usersinstead of falling back torule.users |= rule.group_users. The flag YAML and the two spec contexts for the flag-off path are removed. - The sibling flag
approval_rules_finalize_bulk_copy_approvers(thecopy_project_rulespath) is intentionally left in place and has its own rollout. - Verified locally:
ee/spec/services/approval_rules/finalize_service_spec.rbpasses (14 examples).grepshows no remaining references to the flag name.
References
- Rollout issue: #629136 (closed)
- Feature issue: #628868 (closed)
- Introducing MR: !255430 (merged)
Screenshots or screen recordings
Not applicable, backend-only change.
How to set up and validate locally
- On an EE instance, create a project with an approval rule that includes a group, and a merge request that overrides approval rules.
- Merge the merge request.
- In the Rails console, confirm the group members were attached to the MR-level rule:
MergeRequest.last.approval_rules.regular.first.users
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.