Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CODEOWNERS file #4670

Merged
merged 2 commits into from
Mar 14, 2022
Merged

Add CODEOWNERS file #4670

merged 2 commits into from
Mar 14, 2022

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Feb 3, 2022

(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 adding CODEOWNERS 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 the CODEOWNERS 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

  1. 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.

  2. 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.

    • So, if you want to watch the same path as another user, edit the existing line and add your ID to the end.
    • Do not add an additional line for the same path that only lists your ID, or you will override their existing watch and become that path's sole watcher.
  3. Adding lines with fewer watchers can be used to reduce the list inherited from a common parent path.

    • If you want to watch only part of a common path...
    • Or you don't want to watch a certain subpath...

    Just ensure that a relevant line contains the IDs of other watchers, but not your own.

  4. A line with no watchers can be used to disable owners for that path.

Examples

If I'm watching /.github:

/.github @ferdnyc

and @jonoomph wants to watch /.github/stale.yml only, it would be:

/.github @ferdnyc
/.github/stale.yml @ferdnyc @jonoomph 

If he wanted to watch everything in /.github except /.github/workflows/:

/.github @ferdnyc @jonoomph 
/.github/workflows @ferdnyc 

Unclear behavior

If @jonoomph wanted to watch everything in /src/ except /src/Main.cpp, without disrupting my watch of all CMakeLists.txt files, I'm not completely sure what would be necessary. You'd hope that this would work:

CMakeLists.txt @ferdnyc 
/src/ @jonoomph 
/src/Main.cpp

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:

CMakeLists.txt @ferdnyc 
/src/ @jonoomph 
/src/Main.cpp
/src/CMakeLists.txt @ferdnyc @jonoomph

@ferdnyc ferdnyc added the code Source code cleanup, streamlining, or style tweaks label Feb 3, 2022
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Mar 14, 2022

Forgot to merge this one.

@ferdnyc ferdnyc merged commit 1748b4f into OpenShot:develop Mar 14, 2022
@ferdnyc ferdnyc deleted the codeowners-develop branch March 14, 2022 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Source code cleanup, streamlining, or style tweaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant