How to Encode Service Ownership With CODEOWNERS
A CODEOWNERS file maps repo paths to owning teams so GitHub auto-requests the right reviewers.
Put a CODEOWNERS file in .github/, map paths to teams, and enable required review from code owners. Keep the owner team the same one named in catalog-info.yaml so ownership is consistent everywhere.
Steps
- Add
.github/CODEOWNERS. - Map globs to
@org/teamhandles (later rules win). - Enable Require review from Code Owners in branch protection.
- Match the owning team to the catalog
spec.owner.
CODEOWNERS
CODEOWNERS
# Default owner for everything
* @my-org/team-payments
# Infra changes need the platform team too
/.github/ @my-org/team-platform
/terraform/ @my-org/team-platformGotchas
- The last matching pattern wins, so put broad defaults first and specific paths last.
- A team can only be auto-requested if it has at least read access to the repository.
Related guides
How to Register a Service in the Backstage CatalogAdd a catalog-info.yaml so a service appears in the Backstage software catalog with its owner, lifecycle, and…
How to Automate Repo Creation With CI PreconfiguredAutomate onboarding by creating repos with the paved-road CI, branch protection, and CODEOWNERS applied on da…