Make `any_merge_request` rules respect `branch_exceptions`
What does this MR do and why?
MR approval policies any_merge_request rules currently don't respect branch_exceptions.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Create a new group
top-leveland a contained project,top-level/test-project - On the project-level, navigate to
Code > Branchesand create two branches,developandrc - Navigate to
Settings > Repository, expandProtected branchesand protect both branches - Open MRs targeting both branches
- On the group-level, navigate to
Secure > Policiesand create the following:
type: approval_policy
name: Test policy
enabled: true
actions:
- type: require_approval
approvals_required: 1
role_approvers:
- developer
- maintainer
- owner
rules:
- type: any_merge_request
branch_type: protected
commits: any
branch_exceptions:
- name: develop
full_path: top-level/test-project
- rc
- Verify that none of the MRs require approval
Related to #2293 (closed)
Edited by Dominic Bauer