Code review or Peer code review is a well known practice in software development, where code written by one programmer is reviewed thoroughly by his peers. In some cases, it is reviewed by one’s seniors as well. When done correctly, peer reviews save time, streamlining the development process upfront and drastically reducing the amount of work required later of Quality Assurance teams. Reviews can also save money, particularly by catching the types of bugs that might slip undetected through testing, through production, and into the end-users.
When your source code repository is hosted in the VSTS or Visual Studio Team Services, you can choose to made the peer review mandatory by using build policies and also enforce use of pull requests:
However, you can also choose to auto add specific team members directly to each pull request by default in the lower section of the branch policies:
This helps to avoid confusion and saves time by not having to add each reviewer one at a time by the developer. However, you would need to add users one by one. So if you want to add approval of one person from a particular team, it cannot be done directly.
In such a case, we first need to define a VSTS group by going to Settings icon -> Project Settings -> Security -> Create Group:
Provide the name of the group and an optional description and then select ‘Create Group’:
After this, add the required team members to the newly created group.
Once done, go to branch policies and then select ‘Add automatic reviewers’ in the ‘Automatically add code reviewers’ section:
This will open a new pane. In the pane, search for the VSTS group name you just created, optionally specify path and then set Required:
You cannot still mandate approval of x members from group of y members though although it’d make complete sense. This functionality may come some later point in time.