mszostok/codeowners-validator

Validate that only a single CODEOWNERS file exists in the repository

Closed this issue · 1 comments

Description

As you know Github documents that the CODEOWNERS file to be placed in the root, docs/, or .github/ directory of the repository.

It however does not state anything pertaining to whether multiple CODEOWNERS files exist.

What I have observed is that on Github CODEOWNERS is looked for in .github/ -> docs/ -> root order. However codeowners-validator prioritizes it in the reverse order.

We use Github's protected-branch logic that requires reviews from code owners, in order to ensure that owners are required to approve of changes to their code. However, we have realized that should an additional CODEOWNERS file get committed to a project, it could subvert that incidentally and be a source of future confusion.

Reasons

While the order preference of the possible file locations could be updated - I think it would be preferable to validate against the case of multiple CODEOWNERS files altogether.

There isn't any valid use-case for multiple CODEOWNERS files, and having codeowners-validator continue to be the sole point of CODEOWNERS related validation in our Github CI would be ideal.

I'm looking to see if there is positive reception to having this kind of validation added to the project - if so, I can see about creating a PR to do so.

I have a PR that addresses this issue: #100

@mszostok If you could take a look when you have time, thanks!