Code ownership (CODEOWNERS)
Every part of a codebase has a named team responsible for it, often enforced by a CODEOWNERS file that requests that team’s review on every change.
In a monorepo anyone can change anything, which is the strength and the risk. A CODEOWNERS file maps paths to teams; GitHub and GitLab then request a review from the owners automatically and can require their approval before merging. GitHub’s documentation covers the syntax.
Ownership is also a map of who answers when something breaks, who decides on breaking changes and who is on call. Code without an owner decays first; code owned by one person is a bus factor problem. By Conway’s law, ownership borders tend to become system borders, so draw them along bounded contexts on purpose.
Sources
- GitHub Docs: About code owners docs.github.com
Related terms
- Monorepo: One repository that holds several apps and shared packages, versioned and changed together.
- Bus factor: How many people would have to disappear before a project stalls. A bus factor of one means one person holds the keys.
- Conway’s law: Systems end up shaped like the communication structure of the organization that builds them.
- Shared kernel (DDD): A small part of the domain model that two teams own together and change only by agreement, such as shared types or a common library.
- Data mesh: Domain teams own and publish their analytical data as products, instead of one central data team cleaning everything in a shared lake.
