Release path: fragment check, failed publish and tarball integrity #211

Closed
opened 2026-11-16 06:10:52 +00:00 by Claude · 3 comments
Owner

Part of #87

Question

Release automation and the fragment-presence check from AGENTS.md structure and what happens to CLAUDE.md's content do not fit together, and the publish step has no recovery. Three reviewers found the first point independently. Decide:

  • The release pull request changes galaxy.yml and deletes fragments without adding one. The fragment check has no escape, and the release bot-diff gate forbids adding a fragment, so the release pull request can never pass Lint. What does the check let through: a diff judged by content (version line plus fragment deletions), or a branch-name exemption?
  • The release bot-diff allowlist omits changelogs/.plugin-cache.yaml, which changes in every release commit.
  • Creating the release and uploading the tarball are two API calls, not one. If the upload fails the tag already exists and a rerun is skipped, so the tarball is never added. Is each step skipped when done so that a rerun repairs it, and do the tarball and tag checks run before publishing?
  • Any write collaborator can replace a release asset through the API, and the release bot's tag allowlist lets it delete and recreate v* tags. Put the tarball's checksum in the annotated tag message? Point consumers to the git route pinned to a commit?
  • The release pull request goes stale after merges that add no fragment, and two prepare jobs can race on the force-push. Refresh on every push with a cancelling concurrency group?
  • Is "revisit automerge of the release pull request" tracked anywhere?

From the review

  • Amends, depending on the answer: the fragment check issue (#183), the release workflow issue (#175), the version check and bot-diff issue (#176), the release ADR issue (#177), the map's gist for Release automation ("in one API call").
Part of #87 ## Question [Release automation](https://git.rkdr.net/Mortis/Kamino/issues/98) and the fragment-presence check from [AGENTS.md structure and what happens to CLAUDE.md's content](https://git.rkdr.net/Mortis/Kamino/issues/101) do not fit together, and the publish step has no recovery. Three reviewers found the first point independently. Decide: - The release pull request changes `galaxy.yml` and deletes fragments without adding one. The fragment check has no escape, and the release bot-diff gate forbids adding a fragment, so the release pull request can never pass Lint. What does the check let through: a diff judged by content (version line plus fragment deletions), or a branch-name exemption? - The release bot-diff allowlist omits `changelogs/.plugin-cache.yaml`, which changes in every release commit. - Creating the release and uploading the tarball are two API calls, not one. If the upload fails the tag already exists and a rerun is skipped, so the tarball is never added. Is each step skipped when done so that a rerun repairs it, and do the tarball and tag checks run before publishing? - Any write collaborator can replace a release asset through the API, and the release bot's tag allowlist lets it delete and recreate `v*` tags. Put the tarball's checksum in the annotated tag message? Point consumers to the git route pinned to a commit? - The release pull request goes stale after merges that add no fragment, and two prepare jobs can race on the force-push. Refresh on every push with a cancelling concurrency group? - Is "revisit automerge of the release pull request" tracked anywhere? ## From the review - Amends, depending on the answer: the fragment check issue (#183), the release workflow issue (#175), the version check and bot-diff issue (#176), the release ADR issue (#177), the map's gist for Release automation ("in one API call").
Claude added the
Wayfinder
Grilling
label 2026-11-16 06:10:52 +00:00
Claude added a new dependency 2026-11-16 06:11:27 +00:00
Author
Owner

Evidence from the review of the map (2026-11-15). Gitea source was read, not tested against the server.

What the fragment check lets through

  • ci(lint): check fragment presence for consumer-visible changes fails a pull request "which changes anything under roles/ or meta/, or galaxy.yml, without adding a file under changelogs/fragments/. ... There is no label or other escape."
  • The release pull request bumps galaxy.yml and runs antsibull-changelog release; changelogs/config.yaml:7 is keep_fragments: false, so it deletes fragments and adds none.
  • ci: check the release version against its fragments and limit what a release/ branch may change limits a release/ branch to the version line, the changelog files and fragment deletions, so it cannot add a trivial: fragment to pass.
  • Lint is a required check, so the release pull request can never merge. Three findings agree. Confidence high.
  • Options: exempt a diff whose only galaxy.yml change is the version: line and whose fragment changes are deletions (judged by content), or exempt a release/ head only when the release bot-diff gate also applies. Recommendation: the content rule, because the branch name is chosen by whoever pushes. Add a "release pull request passes" test.

changelogs/.plugin-cache.yaml

  • It holds version: 1.6.0 (line 47) and changed in each of the last three release commits (git log -- changelogs/.plugin-cache.yaml: bc86c2d, ef78484, d4f4d74). CONTRIBUTING.md:28 tells releasers to commit it.
  • The release/ allowlist omits it, so every release pull request would fail that gate too. Recommendation: allow it and test it.
  • Ordering: the release and version-check issues share "one function, imported by both", and neither blocks the other. State that whichever lands first creates the module.

Recovery from a failed publish

  • ci(release): generate the release pull request and publish tagged releases with the tarball publishes when galaxy.yml's version differs from the latest v* tag: POST /releases with tag_message, then POST .../releases/{id}/assets. Two calls. The map's line "creates the Gitea Release, annotated tag and tarball in one API call" is wrong.
  • CreateRelease creates the tag before the database row (services/release/release.go), so a failure can also leave a tag with no release.
  • If the upload fails, the tag exists, a rerun sees no version difference, and the tarball is never added.
  • Publishing a draft is no fix: UpdateRelease calls createTag(..., "") and EditReleaseOption has no tag message, so the tag is lightweight and build.yml:80-83 fails it.
  • Recommendation: publish converges. On each push to main: create the release if missing; upload the tarball if missing; else fail loudly. Run check_tarball.py and the annotated-tag check before the release is created; give release.yml its own concurrency group.

Tarball and tag integrity

  • Gitea routers/api/v1/api.go at v28.0.0: any writer on the Releases unit can edit and delete releases and their attachments. Write collaborators per Recommended repository settings and branch protection: trusted contributors, the agent account, the Renovate bot, the release bot.
  • IsUserAllowedToControlTag (models/git/protected_tag.go) uses one check for create and delete, so the release bot can delete and recreate a v* tag.
  • So a leaked bot token can replace a released tarball unreviewed. Threat model: what we defend against and what we accept's "consumers install from a protected tag" does not cover the tarball.
  • Recommendation: record it as residual risk; put the tarball's sha256 in the annotated tag message; tell consumers in the README that the git route pinned to a commit is the high-assurance one. Confidence high.

Stale release pull request and racing prepare jobs

  • Release automation refreshes it on pushes "that add a consumer-visible fragment". After a merge with only trivial: fragments it falls behind main, and "Block on outdated branch" blocks the maintainer's merge.
  • The release issue sets no concurrency:, and prepare force-pushes release/next, so an older run can push last and drop a newer fragment.
  • Each refresh runs every Molecule scenario, because galaxy.yml is not IGNORED by the selector.
  • Recommendation: refresh on every push while fragments are pending, with concurrency: {group: release-prepare, cancel-in-progress: true}; teach the selector that a version-only galaxy.yml diff selects nothing.

"Revisit automerge of the release pull request"

  • The release decision says automerge "is revisited once releases have run cleanly". No issue tracks it; the automerge decision's equivalent got one.
  • Also: README.md:30 says releases are "annotated vX.Y.Z tags pushed by the" maintainer, which becomes false once the bot tags. No issue updates it.
Evidence from the review of the map (2026-11-15). Gitea source was read, not tested against the server. ### What the fragment check lets through - [ci(lint): check fragment presence for consumer-visible changes](https://git.rkdr.net/Mortis/Kamino/issues/183) fails a pull request "which changes anything under `roles/` or `meta/`, or `galaxy.yml`, without adding a file under `changelogs/fragments/`. ... There is no label or other escape." - The release pull request bumps `galaxy.yml` and runs `antsibull-changelog release`; `changelogs/config.yaml:7` is `keep_fragments: false`, so it deletes fragments and adds none. - [ci: check the release version against its fragments and limit what a release/ branch may change](https://git.rkdr.net/Mortis/Kamino/issues/176) limits a `release/` branch to the version line, the changelog files and fragment deletions, so it cannot add a `trivial:` fragment to pass. - Lint is a required check, so the release pull request can never merge. Three findings agree. Confidence high. - Options: exempt a diff whose only `galaxy.yml` change is the `version:` line and whose fragment changes are deletions (judged by content), or exempt a `release/` head only when the release bot-diff gate also applies. Recommendation: the content rule, because the branch name is chosen by whoever pushes. Add a "release pull request passes" test. ### `changelogs/.plugin-cache.yaml` - It holds `version: 1.6.0` (line 47) and changed in each of the last three release commits (`git log -- changelogs/.plugin-cache.yaml`: bc86c2d, ef78484, d4f4d74). `CONTRIBUTING.md:28` tells releasers to commit it. - The `release/` allowlist omits it, so every release pull request would fail that gate too. Recommendation: allow it and test it. - Ordering: the release and version-check issues share "one function, imported by both", and neither blocks the other. State that whichever lands first creates the module. ### Recovery from a failed publish - [ci(release): generate the release pull request and publish tagged releases with the tarball](https://git.rkdr.net/Mortis/Kamino/issues/175) publishes when `galaxy.yml`'s version differs from the latest `v*` tag: `POST /releases` with `tag_message`, then `POST .../releases/{id}/assets`. Two calls. The map's line "creates the Gitea Release, annotated tag and tarball in one API call" is wrong. - `CreateRelease` creates the tag before the database row (`services/release/release.go`), so a failure can also leave a tag with no release. - If the upload fails, the tag exists, a rerun sees no version difference, and the tarball is never added. - Publishing a draft is no fix: `UpdateRelease` calls `createTag(..., "")` and `EditReleaseOption` has no tag message, so the tag is lightweight and `build.yml:80-83` fails it. - Recommendation: publish converges. On each push to `main`: create the release if missing; upload the tarball if missing; else fail loudly. Run `check_tarball.py` and the annotated-tag check before the release is created; give `release.yml` its own concurrency group. ### Tarball and tag integrity - Gitea `routers/api/v1/api.go` at v28.0.0: any writer on the Releases unit can edit and delete releases and their attachments. Write collaborators per [Recommended repository settings and branch protection](https://git.rkdr.net/Mortis/Kamino/issues/179): trusted contributors, the agent account, the Renovate bot, the release bot. - `IsUserAllowedToControlTag` (`models/git/protected_tag.go`) uses one check for create and delete, so the release bot can delete and recreate a `v*` tag. - So a leaked bot token can replace a released tarball unreviewed. [Threat model: what we defend against and what we accept](https://git.rkdr.net/Mortis/Kamino/issues/99)'s "consumers install from a protected tag" does not cover the tarball. - Recommendation: record it as residual risk; put the tarball's sha256 in the annotated tag message; tell consumers in the README that the git route pinned to a commit is the high-assurance one. Confidence high. ### Stale release pull request and racing prepare jobs - [Release automation](https://git.rkdr.net/Mortis/Kamino/issues/98) refreshes it on pushes "that add a consumer-visible fragment". After a merge with only `trivial:` fragments it falls behind `main`, and "Block on outdated branch" blocks the maintainer's merge. - The release issue sets no `concurrency:`, and `prepare` force-pushes `release/next`, so an older run can push last and drop a newer fragment. - Each refresh runs every Molecule scenario, because `galaxy.yml` is not IGNORED by the selector. - Recommendation: refresh on every push while fragments are pending, with `concurrency: {group: release-prepare, cancel-in-progress: true}`; teach the selector that a version-only `galaxy.yml` diff selects nothing. ### "Revisit automerge of the release pull request" - The release decision says automerge "is revisited once releases have run cleanly". No issue tracks it; the automerge decision's equivalent got one. - Also: `README.md:30` says releases are "annotated `vX.Y.Z` tags pushed by the" maintainer, which becomes false once the bot tags. No issue updates it.
Defame1297 was assigned by Claude 2026-11-16 21:59:16 +00:00
Author
Owner

Resolution

Decided with the maintainer (grilling session, 2026-11-16).

  1. Fragment check judges the release pull request by content, not branch name. The fragment-presence check passes a pull request whose only galaxy.yml change is the version: line and whose only fragment changes are deletions. No branch-name exemption: the name is chosen by whoever pushes. A "release pull request passes" test holds it. Amends ci(lint): check fragment presence for consumer-visible changes.
  2. changelogs/.plugin-cache.yaml is allowed on a release/ branch, with a test. The shared fragment-to-bump module is created by whichever of the release workflow and version-check issues lands first. Amends ci: check the release version against its fragments and limit what a release/ branch may change.
  3. Publish converges. On every push to main: check_tarball.py and the tag checks run before anything is created; the release is created if missing; a pre-existing tag must be annotated and point at the expected commit, else the job fails; the tarball is uploaded if missing; an existing asset that differs fails loudly. Publish has its own concurrency group, never cancelled in progress. How Gitea's create-release treats a pre-existing tag is not verified; the assertion covers it. Amends ci(release): generate the release pull request and publish tagged releases with the tarball and the release ADR issue.
  4. Integrity: the annotated tag message carries the tarball's sha256 (it catches an asset swapped by any writer except the release bot); the README names the git route pinned to a commit as the high-assurance install; a leaked release-bot token replacing a release unreviewed is residual risk in ADR 0001. No artifact signing. Amends #175, ADR 0001, README.
  5. Prepare refreshes on every push to main while releasable fragments are pending, under concurrency: {group: release-prepare, cancel-in-progress: true}; the Molecule selector treats a version-only galaxy.yml change plus changelogs/ as selecting nothing. Amends #175.
  6. Loose ends: automerge of the release pull request is revisited in a new issue (filed below); README.md's claim that the maintainer pushes the tags is corrected in #175. The map's gist already says two API calls.

No new ADR.

## Resolution Decided with the maintainer (grilling session, 2026-11-16). 1. **Fragment check judges the release pull request by content, not branch name.** The fragment-presence check passes a pull request whose only `galaxy.yml` change is the `version:` line and whose only fragment changes are deletions. No branch-name exemption: the name is chosen by whoever pushes. A "release pull request passes" test holds it. Amends [ci(lint): check fragment presence for consumer-visible changes](https://git.rkdr.net/Mortis/Kamino/issues/183). 2. **`changelogs/.plugin-cache.yaml` is allowed on a `release/` branch**, with a test. The shared fragment-to-bump module is created by whichever of the release workflow and version-check issues lands first. Amends [ci: check the release version against its fragments and limit what a release/ branch may change](https://git.rkdr.net/Mortis/Kamino/issues/176). 3. **Publish converges.** On every push to `main`: `check_tarball.py` and the tag checks run before anything is created; the release is created if missing; a pre-existing tag must be annotated and point at the expected commit, else the job fails; the tarball is uploaded if missing; an existing asset that differs fails loudly. Publish has its own concurrency group, never cancelled in progress. How Gitea's create-release treats a pre-existing tag is not verified; the assertion covers it. Amends [ci(release): generate the release pull request and publish tagged releases with the tarball](https://git.rkdr.net/Mortis/Kamino/issues/175) and [the release ADR issue](https://git.rkdr.net/Mortis/Kamino/issues/177). 4. **Integrity:** the annotated tag message carries the tarball's sha256 (it catches an asset swapped by any writer except the release bot); the README names the git route pinned to a commit as the high-assurance install; a leaked release-bot token replacing a release unreviewed is residual risk in ADR 0001. No artifact signing. Amends #175, [ADR 0001](https://git.rkdr.net/Mortis/Kamino/issues/143), [README](https://git.rkdr.net/Mortis/Kamino/issues/190). 5. **Prepare refreshes on every push to `main`** while releasable fragments are pending, under `concurrency: {group: release-prepare, cancel-in-progress: true}`; the Molecule selector treats a version-only `galaxy.yml` change plus `changelogs/` as selecting nothing. Amends #175. 6. **Loose ends:** automerge of the release pull request is revisited in a new issue (filed below); `README.md`'s claim that the maintainer pushes the tags is corrected in #175. The map's gist already says two API calls. No new ADR.
Author
Owner

Partly superseded by What the tarball checksum in the tag message proves when a publish is repaired (2026-11-20):

  • Item 4: the tag message carries the sha256 of MANIFEST.json, not the tarball's.
  • Item 3: "an existing asset that differs" now means an asset that fails the MANIFEST.json chain check. "The expected commit" is the commit on main's first-parent history where galaxy.yml's version became the tagged one, and a repair builds from that commit.
Partly superseded by [What the tarball checksum in the tag message proves when a publish is repaired](https://git.rkdr.net/Mortis/Kamino/issues/255) (2026-11-20): - Item 4: the tag message carries the sha256 of `MANIFEST.json`, not the tarball's. - Item 3: "an existing asset that differs" now means an asset that fails the `MANIFEST.json` chain check. "The expected commit" is the commit on `main`'s first-parent history where `galaxy.yml`'s version became the tagged one, and a repair builds from that commit.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#211