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 MergeWorker transactions in ApprovalRules::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 MergeWorker dashboard.
  • Changes: the optimized_transaction? memoized predicate is deleted, the approvals_required_pre_merge pre-read runs unconditionally, and merge_group_members_into_users always calls insert_group_users instead of falling back to rule.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 (the copy_project_rules path) is intentionally left in place and has its own rollout.
  • Verified locally: ee/spec/services/approval_rules/finalize_service_spec.rb passes (14 examples). grep shows no remaining references to the flag name.

References

Screenshots or screen recordings

Not applicable, backend-only change.

How to set up and validate locally

  1. On an EE instance, create a project with an approval rule that includes a group, and a merge request that overrides approval rules.
  2. Merge the merge request.
  3. 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.

Merge request reports

Loading
Loading