Fix `prevent_pushing_and_force_pushing` UI controls
requested to merge 456499-settings-for-merge-request-approval-policy-with-multiple-rules-not-being-properly-enforced-2 into master
What does this MR do and why?
Fixes a UI bug caused by prevent_pushing_and_force_pushing
not getting pattern-matched correctly.
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.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
-
Create a new group and a contained project
-
On the project level:
- Navigate to
Settings > Repository
and create the following branch protections:develop
foo*
test-123
unrelated
- Navigate to
-
On the group level:
- Navigate to
Security > Policies
and create the following MR approval policy:
- Navigate to
type: approval_policy
name: Block protected branches
enabled: true
rules:
- type: any_merge_request
branches:
- test-*
commits: any
- type: any_merge_request
branches:
- develop
commits: any
- type: any_merge_request
branches:
- foo*
commits: any
- type: any_merge_request
branch_type: protected
commits: any
actions:
- type: require_approval
approvals_required: 1
role_approvers:
- owner
approval_settings:
block_branch_modification: true
prevent_pushing_and_force_pushing: true
- On the project level, navigate to
Settings > Repository
and verify that theAllowed to push and merge
dropdowns are disabled except forunrelated
.
Related to #456499 (closed)
Edited by Dominic Bauer