Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set a default reviewer

Tags:

github

I do pull requests in a repo where it's always the same person reviewing. I would like to set him as the default reviewer so that I don't always have to choose him at each pull request, it'd be automatic. How to do that ?

like image 809
Rodolphe LAMPE Avatar asked Sep 21 '17 09:09

Rodolphe LAMPE


People also ask

How do I set a default reviewer on GitHub?

GitHub has the ability to set the default reviewer using a CODEOWNERS file. Code owners are automatically requested for review when someone opens a pull request that modifies code that they own. When someone with admin permissions has enabled required reviews, they can optionally require approval from a code owner.

How do I set default reviewers in Gerrit?

The default reviewers can be configured in the Gerrit Web UI under Projects > List > <your project> > General in the reviewers Plugin section. The reviewers-by-blame plugin can automatically add reviewers to changes based on the git blame computation on the changed files.

How do I change the reviewer in bitbucket?

In the project, select Project settings in the left sidebar. Select Default reviewers under Pull Requests on the left sidebar. Select the Add reviewers button.

How do I remove default reviewers from bitbucket?

To delete a default reviewer, follow the instructions in Editing Default Reviewers to find the default reviewer you want to get rid of. Then click Delete at the bottom of the page.


2 Answers

GitHub has the ability to set the default reviewer using a CODEOWNERS file.

Code owners are automatically requested for review when someone opens a pull request that modifies code that they own. When someone with admin permissions has enabled required reviews, they can optionally require approval from a code owner.

To use a CODEOWNERS file, create a new file called CODEOWNERS in the root, docs/, or .github/ directory of the repository, in the branch where you'd like to add the code owners.

like image 74
osowskit Avatar answered Sep 18 '22 04:09

osowskit


You should add .github/CODEOWNERS file with users to send PR to.

Example to send PR for any change on codebase represented by *:

## code changes will send PR to following users * @option1-user1 @option1-user2 @option2-your-org/team-name 

See: https://docs.github.com/en/enterprise/2.18/user/github/creating-cloning-and-archiving-repositories/about-code-owners

Note: .github/CODEOWNERS should be in main branch to be effective.

like image 35
prayagupa Avatar answered Sep 21 '22 04:09

prayagupa