[Tool Anouncement] github-distributed-owners - A tool for managing GitHub CODEOWNERS using OWNERS files distributed throughout your code base. Especially helpful for monorepos / multi-team repos
A tool for auto generating GitHub compatible CODEOWNERS files from OWNERS files distributed through the file tree. - GitHub - andrewring/github-distributed-owners: A tool for auto generating GitHub...
GitHub only supports a single CODEOWNERS file in a repository, which is fairly limiting. This tool allows OWNERS files to be distributed throughout the code base, and provide more localized semantic meaning.
Benefits of distributed files:
The primary benefit, in my view, is around ownership of the CODEOWNERS file. Having a single file means that you either have a small number of people who own the CODEOWNERS file, through which all updates must pass, or you have the CODEOWNERS file open broadly, possibly to anyone's reviews. In the former, you have a bottleneck, and people approving changes they may not be familiar the implications of, especially cross team ownership. In the latter, people could add themselves as an owner without the current owners being aware. By having the distributed OWNERS files, the teams/people who own the code also own the OWNERS file. This means the right people will have to approve changes.
It's easier to find who the experts on a group of code is, which is helpful when people have questions, or are otherwise seeking to engage more about it.
It's generally better practice to have many smaller scoped files, rather than monolithic ones. This applies to code, of course, but it also applies to metadata, such as ownership.
Feedback is welcome, I hope some find this helpful. :)
Nice work 👏 I can easily see the usecase even without a giant monorepo: a typical MVC app (eg Django or RoR or Grails) which serves both the backend and frontend can easily see the benefit from this.
Thanks, I appreciate it. And absolutely, I would use this anywhere you need non-trivial ownership. This has been bugging me for years, across multiple companies. I finally had some time I needed to kill and threw this together. :)