X Tutup
The Wayback Machine - https://web.archive.org/web/20220707162334/https://github.com/github/docs/issues/17058
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

CODEOWNERS file syntax documentation does not make it explicitly clear that a pattern can only be used once #17058

Open
1 task done
ReidWeb opened this issue Apr 13, 2022 · 2 comments
Labels
code owners content help wanted repositories

Comments

@ReidWeb
Copy link
Contributor

@ReidWeb ReidWeb commented Apr 13, 2022

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

What changes are you suggesting?

The existing documentation for file syntax does not make it explicitly clear that a pattern can only be specified once, and that if >1 instance of a pattern is present, the last instance will take precedence.

For example the following example would only request review from @doctocat, @octocat would not be included in the reviewers.

apps/ @octocat
apps/ @doctocat

I would propose that a line be added to the CODEOWNERS syntax section indicating that a repeated pattern is not supported.

Additional information

Additionally, I believe an issue should be raised internally against the validation of codeowners files - the above example will be marked as valid by the CODEOWNERS validation, and will not provide any indication to the end user that only the last instance of the pattern will be used.

@ReidWeb ReidWeb added the content label Apr 13, 2022
@github-actions github-actions bot added the triage label Apr 13, 2022
@ramyaparimi ramyaparimi added waiting for review repositories code owners and removed triage labels Apr 14, 2022
@ramyaparimi
Copy link
Contributor

@ramyaparimi ramyaparimi commented Apr 14, 2022

@ReidWeb
Thanks so much for opening an issue! I'll triage this for the team to review 👀

@lecoursen
Copy link
Member

@lecoursen lecoursen commented Apr 14, 2022

Thanks @ReidWeb! We can definitely mention that if you want to list two code owners for the same pattern, they should be on the same line, because using multiple lines will fall prey to the "last matching pattern takes the most precedence" rule. 👍🏻 You or anyone else is welcome to open a PR for that!

@lecoursen lecoursen added the help wanted label Apr 14, 2022
@ramyaparimi ramyaparimi removed the waiting for review label Apr 14, 2022
@ffalor ffalor mentioned this issue May 26, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code owners content help wanted repositories
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@ReidWeb @lecoursen @ramyaparimi and others
X Tutup