Merge pull request 'docs(contributing): write maintaining.md for the maintainer's standing procedures' (#359) from docs/262-maintaining-md into main

Reviewed-on: #359
Reviewed-by: Defame1297 <[email protected]>
This commit was merged in pull request #359.
This commit is contained in:
Defame1297 committed 2026-11-24 17:18:28 +00:00
commit 789b481b5d
3 files changed
+92

No files matched your search

+2
View File
@@ -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).
+2
View File
@@ -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),
+88
View File
@@ -0,0 +1,88 @@
# 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` | `build.yml`, `lint.yml`, `molecule.yml`, `image.yml`, `gitea-release-key.yml` | 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:* every account on this forge is then one the maintainer knows.
*Held by:* aspirational.
- **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
A checklist, not rules: what the repository and organisation settings should be. The maintainer
applies them and checks them against this list after any change.
- Branch protection on `main`: required checks Lint, Build and Molecule; zero required approvals;
"Require approval from code owners"; "Dismiss stale approvals"; block on rejected and on official
review requests; block on an outdated branch; administrators cannot override; the approvals
allowlist is the maintainer.
- Merge allowlist on `main`: the maintainer, each trusted contributor and the Renovate bot.
- Push allowlist on `release/*`: the maintainer; no rule for `renovate/*`.
- Tag protection on `v*`, with the maintainer on its allowlist.
- No bot or agent account in the organisation's Owners team.
- 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
A **full run** is a `schedule` or `workflow_dispatch` run of `molecule.yml` on `main`.
- **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*`, and 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.