Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(I'm opening a similar PR in all three repos, but they all have identical descriptions so if you've read one already, there's nothing new here.)
A GitHub CODEOWNERS file allows repository committers to be associated with certain files or paths within the repo. Whenever a PR is opened that touches one of the files "owned" by a user, that user will automatically receive a review request for the PR. A given file can have multiple "owners", all of whom will receive review requests.
(
CODEWATCHERS
would really be a better name. Nothing about the association implies actual ownership of the code in question, and nothing about addingCODEOWNERS
alone has any effect on PRs. The repo can be configured to block PR merges until a certain number of review approvals are submitted by owners of affected files, but that's completely separate from theCODEOWNERS
file itself. It merely decides who gets asked to review certain PRs, nothing more.)The file works much like a
.gitignore
file, except instead of just file paths, each is followed by a space-separated list of owners.I've added myself as a watcher for most of the build configuration and tooling in each of the repos. Any other committers should feel free to associate themselves with any paths they'd like to monitor, as well.
Adding additional owners
To watch repo file(s), just add or edit a line for the path, and append either your GitHub @username or the email address you use when committing.
Any given path can only have one configuration — child paths override parent paths, and last wins if a path is duplicated. A given file can be matched by more than one path, however.
Adding lines with fewer watchers can be used to reduce the list inherited from a common parent path.
Just ensure that a relevant line contains the IDs of other watchers, but not your own.
A line with no watchers can be used to disable owners for that path.
Examples
If I'm watching
/.github
:and @jonoomph wants to watch
/.github/stale.yml
only, it would be:If he wanted to watch everything in
/.github
except/.github/workflows/
:Unclear behavior
If @jonoomph wanted to watch everything in
/src/
except/src/Main.cpp
, without disrupting my watch of allCMakeLists.txt
files, I'm not completely sure what would be necessary. You'd hope that this would work:However, the documentation only says "Order is important; the last matching pattern takes the most precedence." So to preserve my
/src/CMakeLists.txt
watch, it may be necessary to do this: