mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-09 01:35:18 +02:00
2.1 KiB
2.1 KiB
Code ownership
.github/CODEOWNERS is generated — not hand-edited. The source of truth is .github/codeowners-roles.yml, expanded by .github/scripts/render-codeowners.py. CI rejects drift between the two and rejects direct edits to CODEOWNERS that don't accompany a yml change.
This setup gives every role change a reviewable PR and a permanent in-repository audit trail (git log .github/codeowners-roles.yml).
Current roles
| Role | Members | Scope |
|---|---|---|
engineering |
@ragnorc |
All code under crates/**, repository infrastructure, default for unmapped paths |
docs |
@ragnorc |
docs/**, README.md, AGENTS.md, CLAUDE.md, SECURITY.md |
GitHub treats multiple owners in a CODEOWNERS line as "any one of them satisfies the review requirement". To require N distinct approvers on a specific path, layer a CI check on top (not currently configured).
How to change role membership or path mappings
- Edit
.github/codeowners-roles.yml. - Run
python3 .github/scripts/render-codeowners.py(requires PyYAML;pip install pyyaml). - Commit both files in the same PR.
CI fails the PR if:
CODEOWNERSwas edited without a corresponding yml change, or- The yml was changed but the rendered
CODEOWNERSdoesn't match.
How to add a new role
- Add a new entry to
roles:in the yml with adescriptionandmemberslist. - Reference the role from
paths:(ordefault:). - Regenerate + commit as above.
Why a generator, not direct CODEOWNERS edits?
- Audit trail:
git log .github/codeowners-roles.ymlis the canonical record of every role change. The renderedCODEOWNERSis a derived artifact. - Roles are first-class: paths reference roles, not raw handles. Renaming a person or rotating a role updates one place, not every path.
- Future extension: scheduled rotation (weekly on-call, quarterly leads) plugs into the same yml without changing the path mappings. Not enabled today.
- Consistency with the product: omnigraph itself enforces auditable Cedar policy. The repository's code-owner policy follows the same "policy as reviewed code" pattern.