Fix Branch Rules showing 'All protected branches' under 'All branches'
What does this MR do and why?
Fix Branch Rules showing 'All protected branches' under 'All branches'
The scope ApprovalProjectRule::for_all_branches returns branches which don't have ProtectedBranch associations.
However, the ApprovalProjectRule::for_all_protected_branches scope
filters this further for applies_to_all_protected_branches: true
.
This means the for_all_branches
scope is also returning the
rules for all_protected_branches
.
This change modifies the for_all_branches
scope so it only returns
records where applies_to_all_protected_branches: false
.
Closes #428946 (closed)
Changelog: fixed
Screenshots
How to set up and validate locally
- Create/visit a project
- In the Merge Request settings configure an approval rule to apply to all protected branches
- Go to the Repository settings and view the Branch rules
- Observe that the rule is shown in both sections