Skip to content

fix(ci): paginate the tag lookup in the cosign sign step - #885

Merged
bpalermo merged 1 commit into
mainfrom
fix/publish-sign-tag-pagination
Sep 20, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/publish-sign-tag-pagination

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Fixes the Sign published images (keyless) step, which has never succeeded since #875 merged.

What happened

The publish for e3b58e6 failed:

##[error]no tag ending in -e3b58e6b3d3e23ee9c0bcd839741ce0779f2bf7a in bpalermo/aether/agent;
         refusing to sign a tag that is not this commit

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:

repo tags in first page?
agent 667 no
cni-install 651 no
registrar 654 no
controller 492 no
prober 503 no
mesh-dns 175 no
udsecho 159 no
proxy-supervisor 52 yes

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

  • Signing has never run. No published image carries a cosign signature.
  • The verify gate has never run either. Verify the signatures is skipped when 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.
  • Publishing itself was unaffected. Push charts + images succeeds 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 carries n=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:

resolved bpalermo/aether/agent: dev-e3b58e6... (scanned 667 tags)
::error::no tag ending in -<sha> in <repo> (scanned 100 tags); ...

"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:

bpalermo/aether/agent            scanned=667  resolved=dev-e3b58e6...
bpalermo/aether/mesh-dns         scanned=175  resolved=dev-e3b58e6...
bpalermo/aether/proxy-supervisor scanned=52   resolved=dev-e3b58e6...
bpalermo/aether/cni-install      scanned=651  resolved=dev-e3b58e6...
bpalermo/aether/registrar        scanned=654  resolved=dev-e3b58e6...
bpalermo/aether/controller       scanned=492  resolved=dev-e3b58e6...
bpalermo/aether/prober           scanned=503  resolved=dev-e3b58e6...
bpalermo/aether/udsecho          scanned=159  resolved=dev-e3b58e6...

All 8 resolve. proxy-supervisor at 52 tags exercises the single-page exit (no Link header → loop breaks). And the pre-fix call, for the negative control:

OLD CODE bpalermo/aether/agent:    scanned=100 <NONE>
OLD CODE bpalermo/aether/udsecho:  scanned=100 <NONE>

Note

This does not retroactively sign e3b58e6. COMMIT is github.sha, so the next publish signs its own commit; e3b58e6's images stay unsigned. Nothing is deployed from them — talos-main rev231 runs bf2acf7 — 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

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
@bpalermo
bpalermo merged commit 3a8bead into main Sep 20, 2026
22 checks passed
@bpalermo
bpalermo deleted the fix/publish-sign-tag-pagination branch September 20, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant