The gitea role accepts a release only when it has a valid signature by gitea_gpg_key_id or one of its subkeys. If the Gitea release key expires, is revoked or is replaced, every install and update fails closed, with no warning beforehand. This adds an early warning.
What it adds
scripts/check_gitea_release_key.py:
reads the pins from roles/gitea/defaults/main.yml;
fetches the release key into a throwaway keyring, plus only the .asc of the pinned release (never the binary);
fails when the primary key or a signing subkey expires within 60 days, is revoked or expired, or when a signature in the .asc is not by a valid signing key of the pinned key;
says in its docstring what to do on a failure.
.gitea/workflows/gitea-release-key.yml:
When it runs: weekly, by hand, and on pull requests that change the role defaults or the check, so a gitea_version bump is checked against the new release's signature.
The ci image at the pin of lint.yml, on kamino-docker, with read-only permissions and no secrets.
The image has gpgv but not gpg, so the job installs gpg and gpg-agent per run. The check therefore doesn't become an input of the image.
The job fails if gpg, gpg-agent or gpgconf is missing, so the key tests can never be skipped quietly there.
tests/scripts/test_check_gitea_release_key.py: offline tests with throwaway keys. The key tests skip without gpg, so the Lint job's unittest run still covers the parsing and rendering tests.
Supporting changes:
The workflow joins the pin consumers in check_image_versions.py and check_bot_pr_diff.py, with tests. Without that, the bot-diff gate would refuse Renovate's next ci pin follow-up, which edits every workflow.
The workflow and script go on the molecule selector's IGNORED list (no scenario reads them), with a test.
The consumer lists in CLAUDE.md, CONTRIBUTING.md, docs/images/ci.md and the renovate.json description are updated.
A Notes pointer in roles/gitea/README.md, and a trivial changelog fragment.
Verified
tests/scripts: 223 tests OK. Without gpg on PATH, 9 are skipped.
Hooks: ruff, yamllint, actionlint, zizmor, check_image_versions.py pins and all commit hooks pass, as does ansible-test sanity on push.
Live run against the role defaults (Gitea 28.4.0): exit 0. The key expires on 2027-06-26, and a valid subkey signed the release.
Independent subagent review: READY, no blocker and no should-fix. Its two nits are applied: the ci.md consumer list, and the job failing when a gpg tool is missing.
Not verified
The workflow itself has not run in CI yet. This PR's own run, triggered by its path filter, is the first; in particular, it tests the per-run apt install in the ci image.
I did not run renovate --platform=local for the renovate.json change. It only edits a description string.
The `gitea` role accepts a release only when it has a valid signature by `gitea_gpg_key_id` or one of its subkeys. If the Gitea release key expires, is revoked or is replaced, every install and update fails closed, with no warning beforehand. This adds an early warning.
## What it adds
- **`scripts/check_gitea_release_key.py`:**
- reads the pins from `roles/gitea/defaults/main.yml`;
- fetches the release key into a throwaway keyring, plus only the `.asc` of the pinned release (never the binary);
- fails when the primary key or a signing subkey expires within 60 days, is revoked or expired, or when a signature in the `.asc` is not by a valid signing key of the pinned key;
- says in its docstring what to do on a failure.
- **`.gitea/workflows/gitea-release-key.yml`:**
- When it runs: weekly, by hand, and on pull requests that change the role defaults or the check, so a `gitea_version` bump is checked against the new release's signature.
- The `ci` image at the pin of `lint.yml`, on `kamino-docker`, with read-only permissions and no secrets.
- The image has `gpgv` but not `gpg`, so the job installs `gpg` and `gpg-agent` per run. The check therefore doesn't become an input of the image.
- The job fails if `gpg`, `gpg-agent` or `gpgconf` is missing, so the key tests can never be skipped quietly there.
- **`tests/scripts/test_check_gitea_release_key.py`:** offline tests with throwaway keys. The key tests skip without `gpg`, so the Lint job's unittest run still covers the parsing and rendering tests.
- **Supporting changes:**
- The workflow joins the pin consumers in `check_image_versions.py` and `check_bot_pr_diff.py`, with tests. Without that, the bot-diff gate would refuse Renovate's next `ci` pin follow-up, which edits every workflow.
- The workflow and script go on the molecule selector's IGNORED list (no scenario reads them), with a test.
- The consumer lists in `CLAUDE.md`, `CONTRIBUTING.md`, `docs/images/ci.md` and the `renovate.json` description are updated.
- A Notes pointer in `roles/gitea/README.md`, and a `trivial` changelog fragment.
## Verified
- `tests/scripts`: 223 tests OK. Without `gpg` on PATH, 9 are skipped.
- **Hooks:** ruff, yamllint, actionlint, zizmor, `check_image_versions.py pins` and all commit hooks pass, as does `ansible-test sanity` on push.
- **Live run against the role defaults (Gitea 28.4.0): exit 0.** The key expires on 2027-06-26, and a valid subkey signed the release.
- **Independent subagent review:** READY, no blocker and no should-fix. Its two nits are applied: the `ci.md` consumer list, and the job failing when a gpg tool is missing.
## Not verified
- **The workflow itself has not run in CI yet.** This PR's own run, triggered by its path filter, is the first; in particular, it tests the per-run `apt` install in the `ci` image.
- I did not run `renovate --platform=local` for the `renovate.json` change. It only edits a description string.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
The gitea role accepts a release only when it carries a valid signature by
gitea_gpg_key_id or one of its subkeys, so an expired, revoked or replaced
Gitea release key makes every install and update fail closed, without
warning, on the day it happens.
scripts/check_gitea_release_key.py reads the pins from the role defaults,
fetches the release key into a throwaway keyring and only the .asc of the
pinned release (never the binary), and fails when the primary key or a
signing subkey expires within 60 days, is revoked or expired, or when a
signature in the .asc is not by a valid signing key of the pinned key. Its
docstring says what to do on a failure.
The Gitea release key workflow runs it weekly, by hand, and on pull requests
that change the role defaults or the check, so a gitea_version bump is
checked against the new release's signature. It runs in the ci image at the
pin of lint.yml; that image has gpgv but not gpg, so the job installs gpg and
gpg-agent from the Ubuntu archive per run instead of making the check an
image input. The tests that make keys skip without gpg, so the Lint job's
unittest run (no gpg) still covers the parsing and rendering tests.
The workflow pins the ci image, so it joins the pin consumers of
check_image_versions.py and check_bot_pr_diff.py: Renovate's pin follow-up
edits every workflow, and the bot-diff gate would otherwise refuse that pull
request. The new workflow and script are on the molecule selector's IGNORED
list, since no scenario reads them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
CODEOWNERS rules
requested review from Defame1297 2026-11-22 07:34:52 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The
gitearole accepts a release only when it has a valid signature bygitea_gpg_key_idor one of its subkeys. If the Gitea release key expires, is revoked or is replaced, every install and update fails closed, with no warning beforehand. This adds an early warning.What it adds
scripts/check_gitea_release_key.py:roles/gitea/defaults/main.yml;.ascof the pinned release (never the binary);.ascis not by a valid signing key of the pinned key;.gitea/workflows/gitea-release-key.yml:gitea_versionbump is checked against the new release's signature.ciimage at the pin oflint.yml, onkamino-docker, with read-only permissions and no secrets.gpgvbut notgpg, so the job installsgpgandgpg-agentper run. The check therefore doesn't become an input of the image.gpg,gpg-agentorgpgconfis missing, so the key tests can never be skipped quietly there.tests/scripts/test_check_gitea_release_key.py: offline tests with throwaway keys. The key tests skip withoutgpg, so the Lint job's unittest run still covers the parsing and rendering tests.check_image_versions.pyandcheck_bot_pr_diff.py, with tests. Without that, the bot-diff gate would refuse Renovate's nextcipin follow-up, which edits every workflow.CLAUDE.md,CONTRIBUTING.md,docs/images/ci.mdand therenovate.jsondescription are updated.roles/gitea/README.md, and atrivialchangelog fragment.Verified
tests/scripts: 223 tests OK. Withoutgpgon PATH, 9 are skipped.check_image_versions.py pinsand all commit hooks pass, as doesansible-test sanityon push.ci.mdconsumer list, and the job failing when a gpg tool is missing.Not verified
aptinstall in theciimage.renovate --platform=localfor therenovate.jsonchange. It only edits a description string.🤖 Generated with Claude Code
New commits pushed, approval review dismissed automatically according to repository settings