17/10/2019

[git] Define code owners and enforce review checks

Git (both GitHub and Bitbucket) allows you to specify code owners for a particular repository. This allows you to set up checks that require an approval from any valid owner before the PR can be merged, it also is an easy place where to look up people working on the specific project.

To add code owners, simply check in a file named CODEOWNERS that includes owners in the format

filter owner

and remember that the LAST matching filter has precedence. For example:

*         @someuser    @someoneelse
*.java    @anotheruser

means that someuser and someoneelse are requested to review any PR, while anotheruser is requested to review PRs that touch java files.

After this file is checked in, remember to also activate the PR check for your repo!


No comments:

Post a Comment

With great power comes great responsibility