'How do I add a required reviewer when people of a given team create a pull request in DevOps?

After hours of googling and search, I can't find how to add a required reviewer when people of a given team create a pull request in DevOps.

Some people will be able to contribute to our repository, but they are external to our company, that's why we want to enforce this control.

Does anyone ever did it?

Thanks.



Solution 1:[1]

It seems that you want to conditionally set the required reviewers according to which team the pull request creator comes from. If so, I think there is no such built-in function currently provided.

enter image description here

Currently only the filter condition of "based on which files changed" is provided.

You could add this feature request on our UserVoice site , which is our main forum for product suggestions. After suggest raised, you can vote and add your comments for this feedback. The product team would provide the updates if they view it.

Solution 2:[2]

You can do this with a branch policy in Azure DevOps Repos. In ADO, go to project settings and click Repositories in the menu in the Repos section of the project settings page. Click the repository you would like to protect with code reviews and then select the Policies tab. Next select the git branch needing reviews.

On the bottom of the branch policies page you can select Automatically included reviewers. Click the + button to add reviewers. When adding the reviewers you can select if these selected reviewers are required or optional. This is actually something of a rule-builder, you can add multiple 'rules' by repeatedly going through click + and add reviewers

There is also some documentation on branch policies that might be helpful

Solution 3:[3]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hugh Lin
Solution 2 Roderick Bant
Solution 3 Thi?n Sinh