Verify if any_approver rule could be set per protected branch
Problem
While implementing Branch rule editing: Minimum required approvals per target branch we realised that we only allow for creating one MR approval rule of type any_approver. The goal of Minimum required approvals per target branch is to have an option to set MR approval rule of type any_approver per protected branch.
Current implementation
Validation of a unique any_approver rule:
Preview of a unique any_approver rule:
applies_to_all_protected_branches: false
approvals_required: 1
contains_hidden_groups:false
eligible_approvers: []
groups: []
id: 113
name: "All Members"
protected_branches: []
report_type: null
rule_type: "any_approver"
users: []
Future implementation
Preview of a per protected branch any_approver rule:
applies_to_all_protected_branches: false
approvals_required: 1
contains_hidden_groups: false
eligible_approvers: []
groups: []
id: 114
name: "All Members"
protected_branches: [
{
allow_force_push: false
code_owner_approval_required: false
id: 45
inherited: false
merge_access_levels: []
name: "*-test"
push_access_levels: []
unprotect_access_levels: []
}
]
report_type: null
rule_type: "any_approver"
users: []
Questions
- Is there a reason why we shouldn't have more than one
any_approverrule? - Can we extend the validation to check if there is one all-branches
any_approverrule, but also to check if there's only one branch specificany_approverrule?