Add merge_request_approval_policy_auto_bypass feature flag
What does this MR do and why?
Adds the merge_request_approval_policy_auto_bypass feature flag (wip, default off) and Security::ScanResultPolicies::AutomaticMergeRequestBypass.enabled?(project), which returns true only when the flag is enabled for the project and the project has the security_orchestration_policies license. The flag will gate letting service accounts and access tokens listed in a policy's bypass_settings automatically bypass merge request approval policies.
This is the base of a stack. The bypass logic that calls enabled? follows in stacked MRs.
References
Screenshots or screen recordings
Not applicable. No UI change.
How to set up and validate locally
No user-facing change. Nothing calls the check yet. In a Rails console:
project = Project.find_by_full_path('your/project') # an Ultimate-licensed project
Security::ScanResultPolicies::AutomaticMergeRequestBypass.enabled?(project) # => false
Feature.enable(:merge_request_approval_policy_auto_bypass, project)
Security::ScanResultPolicies::AutomaticMergeRequestBypass.enabled?(project) # => trueMR 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.