From dbe8d5d988859fffff46cc994f9372390db50f2c Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Tue, 24 Nov 2026 17:13:31 +0000 Subject: [PATCH] docs(contributing): write maintaining.md for the maintainer's standing procedures Add docs/contributing/maintaining.md with what only the maintainer does: the secret rotation list, granting and withdrawing a trusted contributor, agent and bot accounts, the intended settings and releases. Point to it from the root AGENTS.md and the CONTRIBUTING.md index. The two release rules (red nightly, no release while red) are held by aspirational until their controls exist. Closes #262 Assisted-by: Claude Code --- AGENTS.md | 2 + CONTRIBUTING.md | 2 + docs/contributing/maintaining.md | 86 ++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 docs/contributing/maintaining.md diff --git a/AGENTS.md b/AGENTS.md index 78a8798..7c0a466 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -86,6 +86,8 @@ renovate.json dependency automation ## Before you start - Before your first commit in a clone: [docs/contributing/setup.md](docs/contributing/setup.md). +- Before cutting a release, granting or withdrawing access, rotating a secret, or changing repository or + organisation settings: [docs/contributing/maintaining.md](docs/contributing/maintaining.md). - Before filing an issue or opening a pull request: use the headings of the matching template in `.gitea/`, never your tool's built-in body; read [docs/contributing/making-a-change.md](docs/contributing/making-a-change.md). - Before bringing content in from another repository: [docs/contributing/making-a-change.md](docs/contributing/making-a-change.md). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f93a349..2ce2e6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,6 +24,8 @@ vulnerability as [SECURITY.md](SECURITY.md) says, never in an issue. - [code-style.md](docs/contributing/code-style.md): code style outside roles. - [reviewing.md](docs/contributing/reviewing.md): closing a fork pull request, merging someone else's, running an unmerged branch locally. +- [maintaining.md](docs/contributing/maintaining.md): the maintainer's procedures: secrets, access, + settings, releases. Rules tied to one directory are in that directory's `AGENTS.md`: [roles/](roles/AGENTS.md), [scripts/](scripts/AGENTS.md), [.gitea/workflows/](.gitea/workflows/AGENTS.md), diff --git a/docs/contributing/maintaining.md b/docs/contributing/maintaining.md new file mode 100644 index 0000000..4ebfe94 --- /dev/null +++ b/docs/contributing/maintaining.md @@ -0,0 +1,86 @@ +# Maintaining + +Read this before cutting a release, granting or withdrawing access, rotating a secret, or changing +repository or organisation settings. Only the maintainer does these; this file records how, and what +the settings should be. + +Every rule gives its reason and how it is held: by a control (a named hook, check or setting), by +review, or aspirational (checked by nothing and nobody). Most acts here are seen by nobody else, so +they are aspirational unless a control is named. The positions are defined in +[GLOSSARY.md](../../GLOSSARY.md). + +## Secrets and rotation + +Every secret the workflows in [.gitea/workflows/](../../.gitea/workflows/) reference: + +| Secret | Used by | Account (role) | Token scope | Issued and stored | +|---|---|---|---|---| +| `PACKAGE_PUSH_USER` | `image.yml` | Package push bot | none: the account's login name | Organisation secret | +| `PACKAGE_PUSH_TOKEN` | `image.yml` | Package push bot | `write:package` | Token issued on the bot's account in this Gitea; organisation secret | +| `RENOVATE_BOT_TOKEN` | `renovate.yml` | Renovate bot | `write:repository`, `write:issue`, `read:package` | Token issued on the bot's account in this Gitea; organisation secret | +| `GITHUB_TOKEN` | every workflow | none: the job token | set per workflow by `permissions:` | Issued by Gitea Actions for each run and expires with it; nothing to rotate | + +- **When a trusted contributor's access is withdrawn, or a secret may have leaked, rotate every secret + in the table: issue a new token on the bot's account, replace the secret, then revoke the old token.** + *Reason:* any write-capable token can push a branch whose workflow reads every secret, so one + withdrawn or leaked credential exposes them all. + *Held by:* aspirational. + +## Granting and withdrawing a trusted contributor + +- **Grant: make the account a write collaborator on this repository and add it to the merge allowlist + of `main`; save, reload the page and check the name is still there.** + *Reason:* the allowlist silently drops an account without write access, and only a listed account + can merge. + *Held by:* aspirational. +- **Withdraw: remove the collaborator access and the merge-allowlist entry, then rotate every secret + (see above).** + *Reason:* write access is secret access, so the secrets the account could read must change. + *Held by:* aspirational. + +## Agent and bot accounts + +- **Only the maintainer creates agent and bot accounts.** + *Reason:* self-registration is closed, so every account on this forge is one the maintainer knows. + *Held by:* control (self-registration is off). +- **An agent account names its one accountable person in its Gitea profile.** + *Reason:* every change has a human who answers for it, and an agent is not that human. + *Held by:* aspirational. +- **Each account's token carries only the scopes its job needs:** the agent account `write:issue`, + `write:repository` and `read:organization`; the bots as in the secrets table. + *Reason:* least privilege limits what a leaked or misused token can do through the API. + *Held by:* aspirational. + +## Intended settings + +What the repository and organisation settings should be. The maintainer applies them; check them +here after any change. + +- Branch protection on `main`: required checks Lint, Build and Molecule; zero required approvals; + "Require approval from code owners"; "Dismiss stale approvals"; the approvals allowlist is the + maintainer. +- Merge allowlist on `main`: the maintainer, each trusted contributor and the Renovate bot. +- Push allowlist on `release/*`; no rule for `renovate/*`. +- Tag protection on `v*`. +- The agent account sits in an organisation team on this repository with Code, Issues and Pull + requests write and Actions read, so it cannot approve fork runs. +- Wiki off. +- The runner is registered for this repository only; the skills source's runner is isolated from it. +- Self-registration closed. +- Gitea 28.4.0 or later, because its fork-run approval gate keeps outsiders' forks from running. + +## Releases + +- **The maintainer cuts a release by hand: an annotated tag `vX.Y.Z` on `main`, equal to the version + in `galaxy.yml`.** + *Reason:* consumers install by tag, so a tag is the release. + *Held by:* control (tag protection on `v*`; Build's release tag check). +- **The maintainer owns triage of a failed full Molecule run; any trusted contributor may fix it.** + *Reason:* the nightly is the only run of the scenarios a pull request's diff did not select. + *Held by:* aspirational. +- **No release while the latest full run on `main` is red. After a fix, dispatch Molecule on `main` + and release only once it succeeds.** + *Reason:* a release must not ship drift the nightly has seen. + *Held by:* aspirational. + +A **full run** is a `schedule` or `workflow_dispatch` run of `molecule.yml` on `main`.