ci: require maintainer review for gate files through CODEOWNERS #144

Closed
opened 2026-11-14 22:32:29 +00:00 by Claude · 12 comments
Owner

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 CODEOWNERS at 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-.*\.txt
  • renovate\.json
  • \.pre-commit-config\.yaml
  • \.ansible-lint(-ignore)?
  • \.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

\.ansible-lint(-ignore)? covers .ansible-lint and .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) and README.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 on docs/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

  • The file parses, and every pattern matches a sample path, shown by a short regex test listed in the pull request (include .ansible-lint and .ansible-lint-ignore).
  • Covered by REUSE.toml.
  • The pull request says that, once code-owner approval is on, Renovate's own-image pin-follow pull requests (they edit .gitea/workflows/) and its Dockerfile FROM bumps (images/) wait for the maintainer's approval, and that skills bumps (Renovate's or by hand) need it too.
  • The live test (a test pull request touching one file under each pattern shows the maintainer as a required code owner) and the setting "Require approval from code owners" belong to chore: apply the recommended repository settings, account permissions and branch protection, not here.

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.

Spec: [Threat model: what we defend against and what we accept](https://git.rkdr.net/Mortis/Kamino/issues/99), resolution comment, "Targets and measures", as widened by [Contributor doc set](https://git.rkdr.net/Mortis/Kamino/issues/103), [Committed skills as agent instructions: ownership, updates and required tools](https://git.rkdr.net/Mortis/Kamino/issues/208), [Code-owner approval against Renovate automerge, and where secrets live](https://git.rkdr.net/Mortis/Kamino/issues/210) and [Where the maintainer's own procedures live, and what "held by review" means for them](https://git.rkdr.net/Mortis/Kamino/issues/250). ## What Add `CODEOWNERS` at 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-.*\.txt` - `renovate\.json` - `\.pre-commit-config\.yaml` - `\.ansible-lint(-ignore)?` - `\.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` `\.ansible-lint(-ignore)?` covers `.ansible-lint` and `.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) and `README.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 on `docs/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 - The file parses, and every pattern matches a sample path, shown by a short regex test listed in the pull request (include `.ansible-lint` and `.ansible-lint-ignore`). - Covered by `REUSE.toml`. - The pull request says that, once code-owner approval is on, Renovate's own-image pin-follow pull requests (they edit `.gitea/workflows/`) and its Dockerfile `FROM` bumps (`images/`) wait for the maintainer's approval, and that skills bumps (Renovate's or by hand) need it too. - The live test (a test pull request touching one file under each pattern shows the maintainer as a required code owner) and the setting "Require approval from code owners" belong to [chore: apply the recommended repository settings, account permissions and branch protection](https://git.rkdr.net/Mortis/Kamino/issues/192), not here. ## 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](https://git.rkdr.net/Mortis/Kamino/issues/165) removes Renovate's post-upgrade task, a pin bump also edits the owned `image.yml`.
Claude added the
Status
Ready for Agent
label 2026-11-14 22:32:29 +00:00
Author
Owner

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.md
  • AGENTS.md and **/AGENTS.md
  • SECURITY.md
  • GLOSSARY.md
  • docs/contributing/**

README.md stays unowned. .gitea/** already covers the issue and pull request templates.

Scope widened by [Contributor doc set](https://git.rkdr.net/Mortis/Kamino/issues/103) (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.md` - `AGENTS.md` and `**/AGENTS.md` - `SECURITY.md` - `GLOSSARY.md` - `docs/contributing/**` `README.md` stays unowned. `.gitea/**` already covers the issue and pull request templates.
Author
Owner

Correction from Recommended repository settings and branch protection (Gitea 28.0.0 source):

  • Gitea CODEOWNERS patterns are anchored regular expressions, not globs. Write \.gitea/.*, scripts/.*, requirements.*, (.*/)?AGENTS\.md, docs/contributing/.*, renovate\.json and so on; .gitea/** would not match as intended.
  • Every rule that matches a changed file needs its own owner's approval, so keep all paths under one owner (the maintainer) and prefer few rules.
  • The pull request's author is dropped from the owners, so the maintainer's own pull requests skip these rules.
  • Turning on the block is step 3 of chore: apply the recommended repository settings, account permissions and branch protection; Renovate pull requests touching these files then wait for the maintainer's approval and merge themselves after it.

Acceptance addition: a test pull request touching one file under each pattern shows the maintainer as a required code owner.

Correction from [Recommended repository settings and branch protection](https://git.rkdr.net/Mortis/Kamino/issues/179) (Gitea 28.0.0 source): - Gitea CODEOWNERS patterns are anchored regular expressions, not globs. Write `\.gitea/.*`, `scripts/.*`, `requirements.*`, `(.*/)?AGENTS\.md`, `docs/contributing/.*`, `renovate\.json` and so on; `.gitea/**` would not match as intended. - Every rule that matches a changed file needs its own owner's approval, so keep all paths under one owner (the maintainer) and prefer few rules. - The pull request's author is dropped from the owners, so the maintainer's own pull requests skip these rules. - Turning on the block is step 3 of [chore: apply the recommended repository settings, account permissions and branch protection](https://git.rkdr.net/Mortis/Kamino/issues/192); Renovate pull requests touching these files then wait for the maintainer's approval and merge themselves after it. Acceptance addition: a test pull request touching one file under each pattern shows the maintainer as a required code owner.
Author
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.

Scope widened by [Agent guard hook and permission allowlist](https://git.rkdr.net/Mortis/Kamino/issues/195): add `\.claude/(settings\.json|hooks/.*|rules/.*)` to the maintainer. `.claude/skills/` and `.claude/agents/` stay unowned so apm bumps of those still automerge.
Claude added this to the Open to contributors milestone 2026-11-15 22:21:19 +00:00
Author
Owner

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.)

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.)
Author
Owner

Review of the map (2026-11-15): corrections to this issue.

  • The body no longer says what to build. It still lists glob paths (.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.
  • The acceptance cannot be met inside this pull request. It asks for the maintainer to show up as a required code owner on a test pull request. Gitea reads CODEOWNERS from the base branch, so that only works after this file is merged and the block is on, which is the settings issue's step 3. That issue's acceptance already says "A Renovate pull request touching a gate file shows the maintainer as required code owner". Change: here, accept on "the file parses, and every pattern matches a sample path" (checked locally, for example with a short regex test listed in the PR); move the "one file under each pattern" test from the second comment to the settings issue.

Waiting on another decision: which paths are owned, where the file lives (CODEOWNERS, docs/CODEOWNERS or .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.

Review of the map (2026-11-15): corrections to this issue. - **The body no longer says what to build.** It still lists glob paths (`.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](https://git.rkdr.net/Mortis/Kamino/issues/192). 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. - **The acceptance cannot be met inside this pull request.** It asks for the maintainer to show up as a required code owner on a test pull request. Gitea reads CODEOWNERS from the base branch, so that only works after this file is merged and the block is on, which is the settings issue's step 3. That issue's acceptance already says "A Renovate pull request touching a gate file shows the maintainer as required code owner". Change: here, accept on "the file parses, and every pattern matches a sample path" (checked locally, for example with a short regex test listed in the PR); move the "one file under each pattern" test from the second comment to the settings issue. Waiting on another decision: which paths are owned, where the file lives (`CODEOWNERS`, `docs/CODEOWNERS` or `.gitea/CODEOWNERS`), and how this fits with Renovate automerge wait on [Code-owner approval against Renovate automerge, and where secrets live](https://git.rkdr.net/Mortis/Kamino/issues/210). Whether `.claude/skills/` and `.claude/agents/` join it waits on [Committed skills as agent instructions: ownership, updates and required tools](https://git.rkdr.net/Mortis/Kamino/issues/208). The rewrite above can wait for both, so the body is rewritten once.
Author
Owner

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\.json
  • docs/agents/.*

The pull request also says that skills bumps (Renovate's or by hand) then need the maintainer's approval.

Scope added by [Committed skills as agent instructions: ownership, updates and required tools](https://git.rkdr.net/Mortis/Kamino/issues/208) (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](https://git.rkdr.net/Mortis/Kamino/issues/195). Committed skills and agents are agent instructions. - `apm\.yml`, `apm\.lock\.yaml`, `\.mcp\.json` - `docs/agents/.*` The pull request also says that skills bumps (Renovate's or by hand) then need the maintainer's approval.
Author
Owner

Scope changed by Code-owner approval against Renovate automerge, and where secrets live (resolution, points 1-3):

  • The file is the root CODEOWNERS, not .gitea/CODEOWNERS, and it owns itself. Gitea reads the root path first, so no other CODEOWNERS file can shadow it.
  • Also owned: .ansible-lint, .yamllint, ruff.toml, tests/sanity/ignore-*.txt, tests/scripts/**, REUSE.toml, changelogs/config.yaml, images/**.
  • Not owned: requirements-dev.txt, requirements-dev.lock, requirements.yml. Drop the requirements* 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.)
  • The pull request says that Renovate's own-image pin-follow pull requests (they edit .gitea/workflows/) and its Dockerfile FROM bumps (images/) wait for the maintainer's approval once code-owner review is on.
Scope changed by [Code-owner approval against Renovate automerge, and where secrets live](https://git.rkdr.net/Mortis/Kamino/issues/210) (resolution, points 1-3): - The file is the root `CODEOWNERS`, not `.gitea/CODEOWNERS`, and it owns itself. Gitea reads the root path first, so no other CODEOWNERS file can shadow it. - Also owned: `.ansible-lint`, `.yamllint`, `ruff.toml`, `tests/sanity/ignore-*.txt`, `tests/scripts/**`, `REUSE.toml`, `changelogs/config.yaml`, `images/**`. - **Not** owned: `requirements-dev.txt`, `requirements-dev.lock`, `requirements.yml`. Drop the `requirements*` 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.) - The pull request says that Renovate's own-image pin-follow pull requests (they edit `.gitea/workflows/`) and its Dockerfile `FROM` bumps (`images/`) wait for the maintainer's approval once code-owner review is on.
Author
Owner

Scope added by Role standard gaps found in review (resolution comment, rule 10): galaxy.yml goes 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.

Scope added by [Role standard gaps found in review](https://git.rkdr.net/Mortis/Kamino/issues/214) (resolution comment, rule 10): `galaxy.yml` goes 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.
Author
Owner

Review of the map (2026-11-17).

  • The body was to be rewritten once two decisions had closed. Both are closed and the body still names .gitea/CODEOWNERS, glob paths, the dropped requirements* 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 expressions tests/scripts/** and images/** are invalid, and tests/sanity/ignore-*.txt does not match tests/sanity/ignore-common.txt. Gitea drops a line that does not compile and gives no sign for a pattern that matches nothing.
  • What to build, as the sum of all comments. File: CODEOWNERS at 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.
  • 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 here: the file parses and every pattern matches a sample path, shown by a short regex test in the pull request. The live test (one file under each pattern shows the maintainer as required code owner) is in the settings issue. No settings checklist item here.
  • Order note. Until ci(images): assign image versions in CI and open the pin PR right after a push removes Renovate's post-upgrade task, every Python pin bump also edits .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).

Review of the map (2026-11-17). - The body was to be rewritten once two decisions had closed. Both are closed and the body still names `.gitea/CODEOWNERS`, glob paths, the dropped `requirements*` pattern and a settings checklist item. The comment from [Code-owner approval against Renovate automerge, and where secrets live](https://git.rkdr.net/Mortis/Kamino/issues/210) lists its new paths as globs again. As anchored regular expressions `tests/scripts/**` and `images/**` are invalid, and `tests/sanity/ignore-*.txt` does not match `tests/sanity/ignore-common.txt`. Gitea drops a line that does not compile and gives no sign for a pattern that matches nothing. - **What to build, as the sum of all comments.** File: `CODEOWNERS` at 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`. - 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 here:** the file parses and every pattern matches a sample path, shown by a short regex test in the pull request. The live test (one file under each pattern shows the maintainer as required code owner) is in the settings issue. No settings checklist item here. - **Order note.** Until [ci(images): assign image versions in CI and open the pin PR right after a push](https://git.rkdr.net/Mortis/Kamino/issues/165) removes Renovate's post-upgrade task, every Python pin bump also edits `.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).
Author
Owner

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 on docs/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) and docs/contributing/maintaining.md (new) are already covered by SECURITY\.md and docs/contributing/.*. Nothing else to add.
## Scope change from [Where the maintainer's own procedures live, and what "held by review" means for them](https://git.rkdr.net/Mortis/Kamino/issues/250) (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 on `docs/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) and `docs/contributing/maintaining.md` (new) are already covered by `SECURITY\.md` and `docs/contributing/.*`. Nothing else to add.
Author
Owner

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.

  • Decision 3: Python pin bumps wait for the maintainer until #165 lands, accepted interim; stated as a Note, replacing the older "land this after #165" advice.
  • Built from the summary comment of 2026-11-17 plus the comment of 2026-11-20 (root CODEOWNERS owning itself, regex patterns, docs/adr/.* required).
Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, https://git.rkdr.net/Mortis/Kamino/issues/87#issuecomment-12281). The body is the spec; the earlier comments are history. - Decision 3: Python pin bumps wait for the maintainer until #165 lands, accepted interim; stated as a Note, replacing the older "land this after #165" advice. - Built from the summary comment of 2026-11-17 plus the comment of 2026-11-20 (root `CODEOWNERS` owning itself, regex patterns, `docs/adr/.*` required).
Author
Owner

Final validation round, second pass (2026-11-20): body edited.

  • The \.ansible-lint pattern 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.
  • The body enumerates no count of owned paths, so nothing else changed.
Final validation round, second pass (2026-11-20): body edited. - The `\.ansible-lint` pattern 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. - The body enumerates no count of owned paths, so nothing else changed.
Defame1297 was assigned by Claude 2026-11-21 06:47:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#144