Repository navigation
fix(publish-verify): look each expected tag up by name, not by scanning every tag (#985) - #987
Merged
Merged
Conversation
…ng every tag (#985) verify-published-artifacts.sh paged through every tag of every repository and grepped for the ones it expected. A listing is not a snapshot: the 2026-09-27 ~11:24Z sweep overlapped a publish and reported cni-install's d526bf2 signature MISSING while it was there (FAIL: 1 of 260; a re-run minutes later passed 260/260). Every coordinate the verifier checks has a computable name, so it now asks for each one directly with HEAD /v2/<repo>/manifests/<tag> (ghcr_tag_exists, OCI + Docker index/manifest Accept types): 200 -> present, 404 -> MISSING, anything else -> exit 2 (inconclusive). - The image tag is `<release_tag default>-<sha>`, read from bazel/img/go_multi_arch_image.bzl as of the commit (like chart versions); unreadable -> exit 2. - Signatures: both layouts (`sha256-<d>.sig`, `sha256-<d>`) are looked up by name every time, so `both` is still caught (ghcr_signature_layout_direct); either lookup unanswered -> exit 2. - A 404 is reported MISSING only beside a witness: a tag the same repo lists (ghcr_any_tag, one page of n=1) answering 200 to the same lookup. A repo that lists nothing, or a lookup that 404s a listed tag (ghcr 404s a manifest HEAD with no matching Accept), is exit 2 rather than a wall of false MISSING. This replaces the old "(scanned N tags)" diagnostic, which the #930 expected-red control keyed on; the control now requires one `witness <tag>: 200` per chart and image absence, and its offline check covers an unreadable registry, an all-404 lookup, and an unwitnessed red. - Per commit the verifier prints `checked N expected tags directly`. Output consumers are unchanged: `ok`, `MISSING <repo>:<tag>`, `PASS: N artifact(s)` / `FAIL: M of N`. scripts/check-ghcr-lookup.sh (wired into ci.yaml's shell job) reproduces the race on a fake registry: a positional listing cursor, and a publish between page 1 and page 2 that re-points `dev` (listed first on ghcr) and appends the new commit's tags. The OLD walk+grep must lose a present tag (if the fake stops reproducing that, the case fails instead of the new lookup passing vacuously); the NEW lookup must find it. It also pins 200/404/401/429/503/no-connection, the Accept types, every signature layout, and drives the real verifier end to end (pass with exact lookup count, unsigned child, 503 -> exit 2, witnessed absence, all-404 -> exit 2). ghcr_all_tags stays for publish.yaml's sign step, which is serialised with publishes and is out of scope here. Closes #985 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…t 15→30 min for direct lookups Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
force-pushed
the
fix/ghcr-direct-tag-lookup
branch
from
September 27, 2026 12:36
24f265c to
94dcbdf
Compare
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.
Closes #985
Problem
scripts/verify-published-artifacts.shpaged through every tag of each repository (ghcr_all_tags) and grepped for the tags it expected. A tag listing is not a snapshot. The 2026-09-27 ~11:24Z sweep overlapped a publish and reported cni-install's d526bf2 signatureMISSINGwhile the tag was there (FAIL: 1 of 260). A re-run minutes later passed 260/260.Fix: look each expected tag up by name
Every coordinate the verifier checks has a name it can compute. So it now asks for each one directly with
HEAD /v2/<repo>/manifests/<tag>(ghcr_tag_exists), accepting the OCI and Docker index and manifest media types:ok)MISSING, but only beside a witness (see below)<release_tag default>-<sha>. The prefix is read frombazel/img/go_multi_arch_image.bzlas of that commit, the same way chart versions are read. If it can't be read, the verifier exits 2.sha256-<d>.sigfor cosign 2,sha256-<d>for the cosign 3 bundle) are looked up by name every time, sobothis still caught (ghcr_signature_layout_direct). If either lookup goes unanswered, the verifier exits 2.MISSINGonly when a tag the same repository lists (ghcr_any_tag, onen=1page) answers 200 to the same lookup. A repository that lists nothing, or a lookup that 404s a tag the registry just listed, exits 2 instead of producing a wall of falseMISSING. This is a real risk: ghcr 404s a manifest HEAD whose Accept header it doesn't match (dev→ 404 with no Accept header, 200 with one). The witness replaces the old(scanned N tags)diagnostic.ok,MISSING <repo>:<tag>,PASS: N artifact(s)/FAIL: M of N). Each commit also printschecked 60 expected tags directly (HEAD /v2/<repo>/manifests/<tag>; no tag listing).Follow-on to #983's expected-red control
The control counted
scanned N tags(N > 0). It now requires onewitness <tag>: 200per chart and image absence. Its offline check gained three cases, 10 → 12:I also ran the live control against GHCR:
OK — verifier exited 1 with 20/20 MISSING, each with a witness such aswitness dev: 200.Race proof:
scripts/check-ghcr-lookup.sh(19 cases, wired intoci.yaml's shell job)The fake registry is a
curlshell function. Its listing cursor is positional. Between page 1 and page 2 a publish re-pointsdev, which ghcr lists first, and appends the new commit's tags. The page boundary slides past one existing tag.The OLD case asserts that the walk loses the tag. If the fake ever stops reproducing the race, that case fails rather than letting the NEW case pass vacuously.
The other cases pin:
MISSINGwith its witness; an all-404 lookup gives exit 2Real sweep (read-only, from a workstation, final code)
A pre-cosign-3 commit (841adf4) also passes, with its
.sigtags found through the cosign 2 layout.Trade-off to watch
Direct lookup costs about 23s per commit from this workstation, against about 13s for the old scan. Each HEAD is about 0.25s, mostly server time. The full
--recentsweep took 5m23s for 14 heads.publish-verify's job hastimeout-minutes: 15, so a day with many more push heads could approach it. I left the timeout alone to keep this diff focused.Not changed
publish.yaml's sign step still usesghcr_all_tagsto find-<sha>tags. It runs inside the serialised publish, not alongside one.Checks run
scripts/check-ghcr-lookup.sh19/19,check-publish-verify-control.sh12/12,check-signature-layout.sh,check-index-children.sh,check-push-head-selection.sh,check-shell-lint.shbazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //scripts/...andformat.checkon the touched scripts🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr