Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding default reviewers to Github repository

Tags:

github

I followed the instructions here https://help.github.com/articles/about-codeowners/ but it doesn't seem to work. I even added the CODEOWNERS file at both the root and .github directory. The reviewers specified in the CODEOWNERS file are not selected automatically when a pull request is created. See screenshots below. Onyone who has set this up, could you point to where the problem is. Thank you.

enter image description here

enter image description here

enter image description here

enter image description here

like image 819
Pratheep Avatar asked Nov 14 '18 03:11

Pratheep


People also ask

How do I add a default reviewer in stash?

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. In the Add default reviewers dialog, add the names of any members of the workspace in which this project resides to add them as a default reviewer.

How do I add a default reviewer in Gitlab?

In Settings-->General-Merge Request Approvals. Click on Add approval Rule. Add Rule name as "Default", Approvals required, desired branch and add members under approvers. These approvers would be your default reviewers for any Merge request.

What is the difference between assignee and reviewer in GitHub?

The biggest difference between "reviewers" and "assignees" is that reviewers actually have a tracked state according to GitHub -- did they review the PR yet or not? With assignees, you can associate people with a PR but beyond that GitHub doesn't really care what that means or what those people need to do.

Where are my GitHub reviewers?

You can find a pull request where you or a team you're a member of is requested for review with the search qualifier review-requested:[USERNAME] or team-review-requested:[TEAMNAME] . For more information, see "Searching issues and pull requests."


1 Answers

You need to be sure that your base branch has:

  • the 'Protect this branch' flag activated
  • the 'Require pull request reviews before merging' flag activated
  • the 'Require review from Code Owners' flag activated

Then in the CODEOWNERS file, located either in the root of the repo or in the .github subfolder, you need to have either a user described with '@user', a user described with his email like '[email protected]', or a team described with '@org/teamname'.

You will need also to be sure that:

  • your contributors (users and teams) have for each of them the 'write' access to the repo
  • the team is not a 'secret' team, only the 'visible' teams would be taken into account
like image 194
Luc Demeester Avatar answered Sep 26 '22 19:09

Luc Demeester