Workzone Advanced Merge Conditions with Specific Group Quota
Advanced Merge Conditions with groupQuota are an important part of Workzone’s merge-control features.
Let’s recap on advanced merge conditions:
A boolean expression describes the merge condition in a clear and concise way. Using tokens like
approvalQuota, groupQuota, requiredSignaturesCount, requiredBuildsCount
an advanced merge condition could be expressed like
requiredBuildsCount > 1 & ( approvalQuota >= 50% | groupQuota >= 1)
Merge if: more than 1 successful build and 50% or more of reviewers have approved OR more than 1 successful build and 2 or more members per reviewer-group have approved.
GroupQuota specifies a general amount of approvals that’s applies to all reviewer groups (groups specified in Workzone’s reviewer configuration).
Specific named groupQuota
Workzone now supports specifically named groupQuota where the target number of approvals can be bound to a specific group or set of groups. Given a group with name ‘abba’ above expression could now be written as
((groupQuota['abba'] > 2 & groupQuota > 1)|approvalQuota > 50%) & requiredBuildsCount > 1
Which translates to: Merge if –
more than 1 successful build and more than 50% of reviewers have approved OR more than 1 successful build and 2 or more members per reviewer-group AND 3 or more members of group ‘abba’ have approved. Note that group ‘abba’ still needs to be specified as a reviewer group.
GroupQuota still specifies a general amount of approvals required for all reviewer groups (including ‘abba’). However groupQuota[‘abba’] specifies a higher target specifically for members of group ‘abba’, i.e. at least 3 or more members of ‘abba’ need to approve the pull request.
If merge conditions need to be elevated for multiple groups, the condition can be expressed with a set of groups like
groupQuota['abba','acdc'] > 2
Best practice is to specify a general groupQuota that is lower than a named groupQuota. Specific named groupQuota conditions should be used to elevate the required approvals for a specific group. All specified groups must be part of the Workzone reviewer group configuration.