chore: apply the recommended repository settings, account permissions and branch protection #192
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: Mortis/Kamino#192
Reference in new issue
Block a user
Spec: Recommended repository settings and branch protection, resolution comment, as changed by Agent credentials and what unattended agents can do, Code-owner approval against Renovate automerge, and where secrets live, Pushes onto a pull request that has a scheduled merge and Where the maintainer's own procedures live, and what "held by review" means for them.
What
The maintainer applies the settings in the web UI. Do the steps in order: each account gets its new access and is tested before it leaves Owners.
0. Gitea upgrade
1. New access, tested
write:packageonly; replacePACKAGE_PUSH_TOKEN. Test: one image push fromimage.yml(or a manualdocker pushof an existing tag).write:repository,write:issue,read:package; replaceRENOVATE_BOT_TOKEN. Test: one Renovate run that rebases or opens a pull request.units_mapkeeps a team's earlier general access mode. Token withwrite:issue,write:repository,read:organization. Tests, before the account leaves Owners: it pushes a branch and opens a pull request (succeeds), and it tries to approve a fork workflow run (refused).The release bot's access is not part of this issue: the bot account issue creates the account and gives it its access, tag allowlist entry, the addition to the
release/*allowlist and its repository secret. It belongs to the Continuous delivery milestone, so this issue does not wait for it and has no release-bot step.2. Remove from Owners
3. Branch rules
mainrule:FROMpull requests then wait for the maintainer.release/*rule:release/*with push and force-push allowed to the maintainer only (the release bot is added by #174). Its branch cannot be deleted, which is fine:release/nextis reused.renovate/*rule: Renovate branches stay unprotected so they are deleted after merge.4. Repository
Acceptance
Notes
docs/contributing/maintaining.md(the maintaining.md issue filed from #250), which this issue links to once the file exists: the intended settings as a checklist, granting a trusted contributor (merge allowlist as well as collaborator), withdrawing one (remove the collaborator and the merge-allowlist entry, and rotate every secret), creating agent and bot accounts, the secret rotation list, and keeping the runner registered for this repository only.image.yml.Open proposals
Review of the map (2026-11-15): corrections to this issue.
v*tag allowlist, repository secret, and its test) into chore: create the kamino-release bot account, its token, the v* tag allowlist entry and the repository secret, and change the acceptance here to "The three tests in step 1 passed". Steps 2 to 4 do not depend on the release bot.Scope from The friend boundary once the approval facts are known: step 0 is the Gitea upgrade to ≥ 28.4.0, chore: upgrade the Gitea server to 28.4.0 or later before opening to friends, which now blocks this issue. No Restricted friend accounts: friends are ordinary accounts, approved until their first merged pull request.
Scope added by Agent credentials and what unattended agents can do (resolution 1 and 4):
units_mapkeeps a team's earlier general access mode.Scope added by Code-owner approval against Renovate automerge, and where secrets live (resolution, points 1, 4, 6):
renovate/*andrelease/*: push and force-push allowed only for the Renovate bot plus the maintainer (renovate/*) and the release bot plus the maintainer (release/*).FROMpull requests then wait for the maintainer.Review of the map (2026-11-17).
release/*rule allows "the release bot plus the maintainer" and that the release bot's token is created as a repository secret. The release bot does not exist when this issue runs. Create therelease/*rule with the maintainer only; chore: create the kamino-release bot account, its token, the v* tag allowlist entry and the repository secret adds the bot and creates the secret. This issue has no release-bot step.renovate/*andrelease/*branches would stay. Read, not tested. Whether the rules are kept is open in Pushes onto a pull request that has a scheduled merge.Changed: this issue is now blocked by ci: require maintainer review for gate files through CODEOWNERS, because the code-owner acceptance cannot be met before the file is on
main.Proposed, not done: rewrite the body once (five amending comments now), or split it into "accounts, teams and tokens" and "branch rules".
Scope changed by Pushes onto a pull request that has a scheduled merge (resolution, points 3 to 5). This answers the "wait before creating the two bot-branch rules" item of the review comment.
renovate/*rule. Drop therenovate/*push and force-push allowlist from the fourth comment: Renovate branches stay unprotected so they are deleted after merge. The ride-along risk goes into ADR 0001 (#143).release/*rule stays, created with the maintainer only (the release bot is added by #174). Its branch cannot be deleted, which is fine:release/nextis reused.main: "Dismiss stale approvals" on, and required approvals stay at zero. Code-owned files then wait for approval again after a push onto an approved pull request. Test: approve a test pull request touching a code-owned file, push to it, and see the approval dismissed.Scope change from Where the maintainer's own procedures live, and what "held by review" means for them (2026-11-20)
This answers the "Standing step" point of the review comment of 2026-11-17.
docs/contributing/maintaining.md(the maintaining.md issue filed from #250): the intended settings as a checklist, granting and withdrawing a trusted contributor, creating agent and bot accounts, the secret rotation list, and keeping the runner registered for this repository only. When that file exists, this issue links to it; the body's Notes sentence "When a new trusted contributor is added, add them to the merge allowlist as well as to collaborators" lives there, not here.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.
release/*allowlist with the maintainer only; norenovate/*rule; "dismiss stale approvals" as a confirm-it-is-on step with its test.Live CODEOWNERS check (2026-11-21)
#144 is merged (#278), so the root
CODEOWNERSis onmain. The maintainer ran the live check by hand and reports that it works: a test pull request showed the maintainer as code owner.This also confirms the escaping in the file. Gitea's tokenizer drops one backslash before compiling a pattern, so the file writes
\\.where it means a literal dot. A wrong spelling would have matched nothing.Not recorded with the report, and so not ticked here:
The maintainer ticks the acceptance item and the step 3 box once those are confirmed.
Follow-up to the comment above: the maintainer confirmed both open points. The test pull request covered every CODEOWNERS pattern, and "Require approval from code owners" was on. The step 3 box and the CODEOWNERS acceptance item are now marked done in the body.
The standing steps now live in
docs/contributing/maintaining.md(#359, for #262). These include adding a new trusted contributor to the merge allowlist as well as to collaborators, rotating every secret on withdrawal, and the intended settings checklist. Once #359 merges, follow that file for those steps; this issue covers only applying the settings once.