ci: require maintainer review for gate files through CODEOWNERS #144
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: Mortis/Kamino#144
Reference in new issue
Block a user
Spec: Threat model: what we defend against and what we accept, resolution comment, "Targets and measures", as widened by Contributor doc set, Committed skills as agent instructions: ownership, updates and required tools, Code-owner approval against Renovate automerge, and where secrets live and Where the maintainer's own procedures live, and what "held by review" means for them.
What
Add
CODEOWNERSat the repository root, with one owner (the maintainer). The root file owns itself, and Gitea reads the root path first, so no other CODEOWNERS file can shadow it.Gitea CODEOWNERS patterns are anchored regular expressions, not globs. Gitea drops a line that does not compile and gives no sign for a pattern that matches nothing. Every rule that matches a changed file needs its own owner's approval, so keep all paths under one owner and prefer few rules. The pull request's author is dropped from the owners, so the maintainer's own pull requests skip these rules.
Patterns:
CODEOWNERS\.gitea/.*scripts/.*images/.*tests/scripts/.*tests/sanity/ignore-.*\.txtrenovate\.json\.pre-commit-config\.yaml\.ansible-lint(-ignore)?\.yamllintruff\.tomlREUSE\.tomlchangelogs/config\.yamlgalaxy\.ymldocs/adr/.*docs/contributing/.*docs/agents/.*CONTRIBUTING\.mdSECURITY\.mdGLOSSARY\.md(.*/)?AGENTS\.md\.claude/.*apm\.ymlapm\.lock\.yaml\.mcp\.json\.ansible-lint(-ignore)?covers.ansible-lintand.ansible-lint-ignore: the ignore file is a lint skip list, so it is owned too.Not owned:
requirements-dev.txt,requirements-dev.lock,requirements.yml(so Renovate's Python and collection bumps keep automerging) andREADME.md. Everything else stays without an owner, so ordinary role changes still merge on green checks.docs/adr/.*is required: an ADR is accepted on the maintainer's approval of its pull request, and code-owner review ondocs/adr/is what makes that approval a control.This list was checked with Python regular expressions against the tracked files. Gitea uses a different engine (
regexp2), so the test below still applies.Acceptance
.ansible-lintand.ansible-lint-ignore).REUSE.toml..gitea/workflows/) and its DockerfileFROMbumps (images/) wait for the maintainer's approval, and that skills bumps (Renovate's or by hand) need it too.Notes
Name the maintainer's role in comments and docs. The file itself must name the account, because CODEOWNERS needs one.
Python pin bumps wait for the maintainer between code-owner approval going on and the CI image versions landing, accepted as an interim: until #165 removes Renovate's post-upgrade task, a pin bump also edits the owned
image.yml.Scope widened by Contributor doc set (resolution, section 7): also assign the files that hold the rules to the maintainer, so an agent cannot rewrite its own instructions without the maintainer's approval:
CONTRIBUTING.mdAGENTS.mdand**/AGENTS.mdSECURITY.mdGLOSSARY.mddocs/contributing/**README.mdstays unowned..gitea/**already covers the issue and pull request templates.Correction from Recommended repository settings and branch protection (Gitea 28.0.0 source):
\.gitea/.*,scripts/.*,requirements.*,(.*/)?AGENTS\.md,docs/contributing/.*,renovate\.jsonand so on;.gitea/**would not match as intended.Acceptance addition: a test pull request touching one file under each pattern shows the maintainer as a required code owner.
Scope widened by Agent guard hook and permission allowlist: add
\.claude/(settings\.json|hooks/.*|rules/.*)to the maintainer..claude/skills/and.claude/agents/stay unowned so apm bumps of those still automerge.Order: within Open to friends this lands last, together with the protection setting in chore: apply the recommended repository settings (#192), so the maintainer is not the approval bottleneck for the rest of the milestone. (From Order of the implementation backlog, #198.)
Review of the map (2026-11-15): corrections to this issue.
.gitea/**,scripts/**,docs/adr/**) and a checklist item to "turn on 'Block on CODEOWNERS review'". The second comment says the patterns are anchored regular expressions (\.gitea/.*,scripts/.*, ...) and that the setting is step 3 of chore: apply the recommended repository settings, account permissions and branch protection. Two more comments widened the path list. An agent that reads only the body writes globs that do not match. Change: rewrite the body with the full list in regex form (the original paths, the rule files from the first comment, the.claude/paths from the third), and drop the settings checklist item.Waiting on another decision: which paths are owned, where the file lives (
CODEOWNERS,docs/CODEOWNERSor.gitea/CODEOWNERS), and how this fits with Renovate automerge wait on Code-owner approval against Renovate automerge, and where secrets live. Whether.claude/skills/and.claude/agents/join it waits on Committed skills as agent instructions: ownership, updates and required tools. The rewrite above can wait for both, so the body is rewritten once.Claude referenced this issue2026-11-16 14:56:07 +00:00
Scope added by Committed skills as agent instructions: ownership, updates and required tools (resolution comment, points 2 and 3). Also owned by the maintainer (Gitea CODEOWNERS patterns are regexes):
\.claude/.*: the whole directory. This replaces the separate.claude/settings.json,.claude/hooks/and.claude/rules/entries from Agent guard hook and permission allowlist. Committed skills and agents are agent instructions.apm\.yml,apm\.lock\.yaml,\.mcp\.jsondocs/agents/.*The pull request also says that skills bumps (Renovate's or by hand) then need the maintainer's approval.
Scope changed by Code-owner approval against Renovate automerge, and where secrets live (resolution, points 1-3):
CODEOWNERS, not.gitea/CODEOWNERS, and it owns itself. Gitea reads the root path first, so no other CODEOWNERS file can shadow it..ansible-lint,.yamllint,ruff.toml,tests/sanity/ignore-*.txt,tests/scripts/**,REUSE.toml,changelogs/config.yaml,images/**.requirements-dev.txt,requirements-dev.lock,requirements.yml. Drop therequirements*pattern and keep the pin files out, so Renovate's Python and collection bumps keep automerging. (Earlier comments on this issue that widen ownership still apply, except where they would cover these three files.).gitea/workflows/) and its DockerfileFROMbumps (images/) wait for the maintainer's approval once code-owner review is on.Scope added by Role standard gaps found in review (resolution comment, rule 10):
galaxy.ymlgoes under CODEOWNERS, so a new Collection dependency waits for the maintainer. The release pull request's version-only edit is merged by the maintainer anyway.Review of the map (2026-11-17).
.gitea/CODEOWNERS, glob paths, the droppedrequirements*pattern and a settings checklist item. The comment from Code-owner approval against Renovate automerge, and where secrets live lists its new paths as globs again. As anchored regular expressionstests/scripts/**andimages/**are invalid, andtests/sanity/ignore-*.txtdoes not matchtests/sanity/ignore-common.txt. Gitea drops a line that does not compile and gives no sign for a pattern that matches nothing.CODEOWNERSat the root, one owner (the maintainer). Patterns:CODEOWNERS,\.gitea/.*,scripts/.*,images/.*,tests/scripts/.*,tests/sanity/ignore-.*\.txt,renovate\.json,\.pre-commit-config\.yaml,\.ansible-lint,\.yamllint,ruff\.toml,REUSE\.toml,changelogs/config\.yaml,galaxy\.yml,docs/adr/.*,docs/contributing/.*,docs/agents/.*,CONTRIBUTING\.md,SECURITY\.md,GLOSSARY\.md,(.*/)?AGENTS\.md,\.claude/.*,apm\.yml,apm\.lock\.yaml,\.mcp\.json. Not owned:requirements-dev.txt,requirements-dev.lock,requirements.yml,README.md.regexp2), so the test below still applies..gitea/workflows/image.yml, which is owned. Land this after that issue, or pin bumps wait for approval until it does.Proposed, not done: replace the body's "What" and "Acceptance" with the bullets above (nine amending comments now).
Scope change from Where the maintainer's own procedures live, and what "held by review" means for them (2026-11-20)
docs/adr/.*is now required, not only listed: an ADR is accepted on the maintainer's approval of its pull request, and code-owner review ondocs/adr/is what makes that approval a control. It is already in the pattern list of the review comment of 2026-11-17; no change to that list.SECURITY.md(which gains the "Accepted risks" register) anddocs/contributing/maintaining.md(new) are already covered bySECURITY\.mdanddocs/contributing/.*. Nothing else to add.Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, #87 (comment)). The body is the spec; the earlier comments are history.
CODEOWNERSowning itself, regex patterns,docs/adr/.*required).Final validation round, second pass (2026-11-20): body edited.
\.ansible-lintpattern is now\.ansible-lint(-ignore)?, so.ansible-lint-ignore(a lint skip list) is owned too; one line explains it and the acceptance regex test includes both file names.