3
votes

Situation

We have a branch policy set up to require at least one reviewer to approve a pull request. When any database specific files change we automatically add our database engineering group as a required reviewer.

The Problem

When a database engineer approves the changes (specific to the database), the whole pull request is approved. However we would require another person to look at the rest of the PR.

Optimal Solution (that unfortunately does not work)

If a required reviewer is added to the PR, the minimal number of reviewers should be increased. Unfortunately VSTS does not support this, so how do we work around that limitation?

1

1 Answers

3
votes

This feature has already been achieved. You just need to add "Another person" as Automatically include code reviewers.

So the branch policy should be (assume the database specified files are /database/*.script):

  • Require a minimum number of reviewers:

    Minimum number of reviewers 1

  • Automatically include code reviewer:

    | Reviewer(s)     |  Required  |  Path filter        |
    ------------------------------------------------------
    
    | Database Group  |  Required  |  /database/*.script |
    
    | Another person |  Required  |  blank (no filter)  |
    

When files changed out of /database/*.script, only the "Another person" is required.

enter image description here

When files changed inside of /database/*.script, both of the "Database Group" and "Another person" are required. Even after any one of "Database Group" or "Another person", required reviewers is not meet. Only when both of "Database Group" and "Another person" are approved, the required polices will meet, and the reviewers approved auto changed to 2.

enter image description here enter image description here