问题
So we have 6 people in the project team. 1 Techlead and 1 Assistant Techlead.
In our branch policy we want to setup that only the Techlead and Assistant Techlead can approve the pull request. We only need 1 approval from them to avoid bottle neck if the other one is on leave.
The problem is there are only 2 choices in the branch policy setting.
A. Specifying the number of required approver (Will not work since normal developers would be able to approve as well)
B. Specifying the actual person to approve (Will not work since both of them will be required and cause a bottle neck when one is on leave)
Can someone please point us in the right direction?
回答1:
You can provide required reviewers that are automatically added to each PR. These reviewers can also be groups.
Do this:
- Create a group that contains your tech lead and assistant tech lead and.
- Make that group a required approver under
Automatically include code reviewers
You should get something like this:
Your statement normal developers would be able to approve as well is only true if the group that is required contains your normal developers.
This way at least 1 person from provided group (in this case Developers
) must approve a PR. If you want you can also provide a path filter to require only reviews on certain changes or assign a different group for files or folders.
来源:https://stackoverflow.com/questions/51644674/branch-policy-require-atleast-1-approval-from-specified-approvers