Repository navigation
fix(ci): paginate the tag lookup in the cosign sign step - #885
Merged
Merged
Conversation
The sign step resolved each image's commit-suffixed tag with a single unpaginated call to /v2/<repo>/tags/list. ghcr returns ONE PAGE -- 100 tags -- and signals the rest with an RFC5988 `Link: rel="next"` header the step ignored. Tags come back in ascending order, so the tag just pushed sorts LAST and is never in the first page. Every image repo is past 100 tags (agent 667, cni-install 651, registrar 654, udsecho 159, proxy-supervisor 52), so the lookup found nothing and the step failed on e3b58e6 with no tag ending in -e3b58e6... in bpalermo/aether/agent while `dev-e3b58e6b3d3e23ee9c0bcd839741ce0779f2bf7a` was sitting in the registry the whole time. Signing has therefore never once succeeded since #875 merged -- and because `Verify the signatures` is skipped when the sign step fails, the gate written to prove the signatures exist has never run either. The images and charts were published normally; only the signatures are missing. Follows the `last=` cursor to the final page. ghcr's own next-URL carries `n=0`, so the page size is re-stated rather than following that URL verbatim. Also reports the scan size on both the success and the failure path: "not found in 667" is a real absence, "not found in 100" means the pagination regressed, and the two must never read the same again. Verified by extracting the step's script from the YAML and running it against the live registry: all 8 repos resolve the tag, scanning 52-667 tags each. The single-page repo (proxy-supervisor, 52) exercises the no-Link-header exit. The pre-fix call returns 100 tags and <NONE> for every repo, including the 159-tag one. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
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.
Fixes the
Sign published images (keyless)step, which has never succeeded since #875 merged.What happened
The publish for
e3b58e6failed:The tag was there the whole time —
dev-e3b58e6b3d3e23ee9c0bcd839741ce0779f2bf7a, pushed by step 7 of that same run. The lookup could not see it.Cause
The step resolved the tag with one unpaginated call:
curl -fsS ... "https://ghcr.io/v2/${repo}/tags/list"ghcr returns one page — 100 tags — and signals the rest with an RFC5988
Link: <...>; rel="next"header the step ignored. Tags come back in ascending order, so the tag just pushed sorts last and is never in the first page.Measured against the live registry:
Seven of eight are past 100, so this failed on the first repo in the list every time. It is not a threshold we recently crossed — it was broken on the first run.
Consequences
Verify the signaturesisskippedwhen the sign step fails, so the step written specifically to prove the signatures exist has never executed. A gate downstream of a failing gate is not a gate.Push charts + imagessucceeds before signing;e3b58e6's chart and images are on GHCR and are what talos-main can deploy. Only the signature is absent, and the workflow is red.Fix
Follow the
last=cursor to the final page. ghcr's own next-URL carriesn=0, so the page size is re-stated rather than following that URL verbatim.The step now also reports the scan size on both paths:
"not found in 667" is a real absence. "not found in 100" means the pagination regressed. Those two must never read the same again — that ambiguity is what made this take a failed publish to notice.
Verification
Not asserted by inspection. The step's script was extracted from the YAML with a YAML parser and run against the live registry, so what ran is what ships:
All 8 resolve.
proxy-supervisorat 52 tags exercises the single-page exit (noLinkheader → loop breaks). And the pre-fix call, for the negative control:Note
This does not retroactively sign
e3b58e6.COMMITisgithub.sha, so the next publish signs its own commit;e3b58e6's images stay unsigned. Nothing is deployed from them — talos-main rev231 runsbf2acf7— so I have not tried to backfill.Related: #880 (the same workflow can silently publish nothing when a queued run is superseded — a different failure mode in the same file, still open).
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr