Repository navigation
fix(ci): a pre-release tag must not publish latest to GHCR - #2499
Merged
Merged
Conversation
`publish-images.yml` gated its `type=raw,value=latest` rule on `startsWith(github.ref, 'refs/tags/v')`. That expression answers "is this a version tag", not "is this a version anyone should be running", so pushing a release candidate (`v0.9.5-rc1`) would move `latest` and every unpinned hosted install would pull the RC on its next `start.sh --hosted`. This is the hazard the workflow already documents one paragraph above — it guards `workflow_dispatch` against exactly this, and the same door was left open for pre-release tag pushes. It matters now because an RC is the prerequisite for the DigitalOcean snapshot (#2281/#2471): the marketplace build needs GHCR images from a tag cut BEFORE the payload is blessed, which makes the RC the one tag that must never become the default pull. The `-` test IS the semver prerelease rule (spec item 9), so it needs no list of rc/beta/alpha spellings to keep current. It cannot be delegated to metadata-action: its documented prerelease handling ("pre-release will only extend {{version}}") applies to `type=semver` entries — which is why `{{major}}.{{minor}}` needs no guard of its own — and has no effect at all on a `type=raw` value. `{{version}}` and `v{{version}}` are deliberately untouched: an RC must stay pullable by its exact tag, which is the whole point of cutting one. Only the mutable pointer is withheld. Guarded by tests/unit/test_2471_publish_images_prerelease_latest.py — verified to fail against the pre-fix expression. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01K9bL6DZ8QVyrSvPybp5ZuK
dolho
approved these changes
Sep 2, 2026
dolho
left a comment
Contributor
There was a problem hiding this comment.
/review Report
Scope: CLEAN — one expression edit + its four-directional guard test. Every technical claim in the PR body checks out against the tree:
- The bug is real and the fix is complete.
refs/tags/v0.9.5-rc1satisfiesstartsWith(refs/tags/v), and — the part I went to verify — thetype=rawline is the onlylatestproducer: the workflow already pinsflavor: latest=false(line 148, with its own comment explaining thatlatest=autowould have made any raw-line gating inert). So!contains(github.ref_name, '-')closes the whole surface; there is no second door. - The metadata-action asymmetry is stated correctly. Its prerelease rule ("pre-release will only extend
{{version}}") governstype=semveronly —{{major}}.{{minor}}is safe with no guard, and a guard there would be the "natural wrong fix" the fourth test pins against. Asserting the absence of the guard on the semver lines is the best part of the test file: it stops the next person from "completing" the fix into a regression. - The hyphen test is the right predicate. SemVer item 9: prerelease = hyphen + identifiers after patch; build metadata uses
+, which this correctly leaves alone. No spelling list to rot. - Trigger reachability:
on: push: tags:matchesv*, so an RC tag does fire the workflow — the guard is what stands between it andlatest, exactly as described. - Test hygiene:
_latest_lineskips comment lines (the new comment block above the rule would otherwise be a false match surface), asserts exactly one rule, and the PR verified the negative case by reverting the fix — the assertion that actually matters.
Findings: none, critical or informational. The claims that can only be proven by an Actions evaluation (github.ref_name at tag-push time) are honestly listed as unverified, and trinity-dev#20's Step 9 digest check is the runtime verification for exactly that residual — the pairing is right.
Approving. Sequencing note for the merger: this must land before any RC tag is pushed; trinity-dev#20's Step 2.12 blocker enforces that ordering at run time as well.
🤖 Generated with Claude Code
vybe
pushed a commit
that referenced
this pull request
Sep 2, 2026
… (tag-only cut off dev) (#2502) trinity-dev 406c390: a hyphenated tag (v0.9.5-rc1) now takes a tag-only path off dev — no dev→main merge, no release PR, no Closes block, no issue sweep — and Step 9 verifies publish-images.yml for both modes. Companion to #2499, which withholds `latest` from a pre-release tag; the playbook's new Step 2.12 blocker checks for it. The bump is load-bearing rather than housekeeping: a `/release v0.9.5-rc1` run from the pinned checkout would execute v1.5, which has no RC mode and would treat the tag as a full cut — the dev→main merge and the status-in-dev sweep that v1.6 exists to prevent. Also carries the 13 intervening trinity-dev commits (debt-inbox entries and the /sprint `--base dev` fix from #2476). Refs #2281. Claude-Session: https://claude.ai/code/session_012d5K93m76zw4Rn193FXvsJ Co-authored-by: sim <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
This was referenced Sep 2, 2026
obasilakis
added a commit
that referenced
this pull request
Sep 2, 2026
…n}}` (+ VERSION 0.9.5-rc2) (#2505) * fix(ci): the v-prefixed image alias must be {{raw}}, not v{{version}} `v{{version}}` is a COMPONENT pattern, so docker/metadata-action drops it for a pre-release under the same documented rule that correctly drops `{{major}}.{{minor}}`: "Pre-release (rc, beta, alpha) will only extend {{version}} (or {{raw}} if specified) as tag". `{{raw}}` is the documented exception and keeps the `v`. Observed on v0.9.5-rc1: all five packages published `0.9.5-rc1` and `sha-0f4d54d`, and NO `v0.9.5-rc1`. That is not cosmetic — it broke the marketplace build outright, which is the one thing the RC was cut for. `packer/digitalocean/scripts/01-provision.sh` feeds a single `TRINITY_IMAGE_TAG` to two consumers that need different strings once they diverge: line 86: git clone --depth 1 --branch "${TRINITY_IMAGE_TAG}" -> v0.9.5-rc1 line 93: docker pull ghcr.io/abilityai/trinity-*:${TAG} -> 0.9.5-rc1 They are the same string only while this alias exists, so its absence leaves NO value of `image_tag` able to build the snapshot. #2280's own comment predicted the failure ("makes the release name and the image tag the same string, which is what anyone reading the releases page will type") — it just did not account for the pre-release rule silently removing the alias. `{{version}}` and `{{major}}.{{minor}}` are untouched: the first is what a prerelease extends, the second is correctly withheld from one. Guarded by tests/unit/test_2471_publish_images_prerelease_latest.py (extended from the #2499 suite) — verified to fail against the pre-fix expression. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01K9bL6DZ8QVyrSvPybp5ZuK * chore: set version to 0.9.5-rc2 Rides this PR rather than its own: `dev` is protected, so every write costs a review cycle, and both changes are prerequisites for the same rc2 cut with the same reviewer. The playbook already batches release-prep writes onto one `chore/release-<semver>` branch (Step 4 + Step 6a) — splitting them here was ceremony, not safety. rc2 rather than a re-cut of rc1: an RC tag is immutable by the playbook's own rule, because a snapshot built from it may already sit in a vendor queue. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01K9bL6DZ8QVyrSvPybp5ZuK --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
webmixgamer
added a commit
that referenced
this pull request
Sep 2, 2026
) Review artifacts from validating the publish-images `{{raw}}` alias fix: - docs/memory/learnings.md: a tag-push-only workflow is never exercised by PR CI, so audit every sibling tag rule against the metadata-action pre-release rule and verify against the live registry after the first RC push (the #2499 -> #2505 incomplete-fix chain). - docs/security-reports/cso-diff-2026-09-02-2505-*: diff-scoped CSO audit, zero findings; four docker/* action SHA pins verified against their version tags. Refs #2281 Co-authored-by: Claude Fable 5.1 <[email protected]>
5 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisite for cutting
v0.9.5-rc1. Refs #2281, #2471 (the marketplace snapshot needs GHCR images from an RC tag).The bug
publish-images.ymlgates itslatestrule on the tag ref's prefix alone:type=raw,value=latest,enable=${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}refs/tags/v0.9.5-rc1satisfiesstartsWith(refs/tags/v). So pushing a release candidate republisheslatest, and every unpinned hosted install pulls the RC on its nextstart.sh --hosted.The workflow already argues against precisely this outcome, twelve lines above — "a
workflow_dispatchsmoke build must never silently become what every hosted install pulls". The dispatch door was closed; the pre-release tag door was not.It bites now rather than hypothetically: an RC is the prerequisite for the DigitalOcean snapshot. #2471's own sequencing is cut a tag →
publish-images.ymlfires →packer build -var image_tag=<tag>. The tag exists specifically to be built from before the payload is blessed, which makes it the one tag that must not become the default pull.The fix
Two things worth a reviewer's attention:
Why not let metadata-action handle it. It does handle it — for
type=semver. Its documented rule is "Pre-release (rc, beta, alpha) will only extend{{version}}… as tag", which is why{{major}}.{{minor}}on line 183 is already safe and correctly carries no guard of its own. That rule has no effect whatsoever on atype=rawvalue, so the exclusion has to be written into theenable:expression. A test pins that asymmetry in both directions, because "add the guard everywhere" is the natural wrong fix.Why
-and not an rc/beta/alpha list. The hyphen is the semver prerelease rule (spec item 9: a prerelease is a hyphen plus dot-separated identifiers after patch). A spelling list goes stale the first time someone tags-preor-canary.{{version}}andv{{version}}are deliberately untouched — an RC must stay pullable by its exact tag. Only the mutable pointer is withheld.Verification
tests/unit/test_2471_publish_images_prerelease_latest.py— 4 tests, all passing. Verified to actually catch the bug: reverting the one-line change failstest_latest_excludes_prerelease_tags; the other three still pass, so the negative case is the one being asserted.latest, the two pre-existing dispatch guards survive, and the exclusion is absent from{{version}}/v{{version}}/{{major}}.{{minor}}.yaml.safe_loadon the workflow — parses.🤖 Generated with Claude Code
https://claude.ai/code/session_01K9bL6DZ8QVyrSvPybp5ZuK