Required CODEOWNER pull requests and notifications

We have recently enabled required CODEOWNER reviews for pull requests in to our master branch from at least one developer on the team (we have a GitHub team set up to catch all files in the codeowners file). Example CODEOWNERS file is:

* @org-name/dev-team
/path/specific-file.xml @org-name/dev-sub-team

We want to require at least one code review from a member of the dev team and this does work with this set up, but it has the downside that now that the whole team is automatically assigned to new pull requests, meaning that every member of the team gets notifications for every pull request. 

Is there anyway to require an approval from a member of the team without automatically assigning the team to the pull request to prevent them getting the notifications?

7 Likes

Hi @abutler,

Thanks for being part of the GitHub Community Forum! I’ll help as best I can.

You should be able to define CODEOWNERS as teams _or _individuals. So, instead of @org-name/dev-team you’d use the person’s username. There’s full instructions here: https://help.github.com/articles/about-codeowners/.

If I’m misunderstanding, please let me know and we’ll continue to help as much as possible.

Cheers!

Hi,

Thanks for the response. Unfortuately no, I don’t want to switch to assigning individuals. I would like to prevent the auto-assignment of the code review to the team whilst still requiring that a code-review by one of the team is complete before merging.

This will enforce the approval process by a member of the team but not assign the whole team to the pull request so the whole team doesn’t get every pull request notification emails. 

3 Likes

For customized workflows like this, you may want to check out Probot. The Work in Progress Probot app gives an example of how to create a bot that can block the merging of PRs based on custom logic.

2 Likes

We also have this problem. We have a lot of repositories and now i’m spammed with tons of emails. There should be a way to disable automatic PR review request from code owners.

3 Likes

Agreed. We have the same issue. This is making what would otherwise be a terrific new feature (codeowners) into something problematic. You should separate these two features and not auto-assign codeowners to PRs.

10 Likes

Agree with this. My team is a CODEOWNER for a repo, and it would be nice to avoid the email spam that this results in for all team members.

We use the option to assign based on round robin.
And this notification option is great for handling the email issue:
“If assigning team members, don’t notify the entire team.”

However, it doesn’t solve the filters problem. I want to be able to filter based on reviews that are assigned specifically to me, but I’m also getting PRs that are assigned to the codeowner team, making the filters almost useless to me as a reviewer.

Is there a way to filter as I described? Maybe I’m missing something