Skip to content

fix(ci): tolerate a Rekor 409, and check pins even on a partial build - #90

Merged
garymike merged 1 commit into
mainfrom
fix/cosign-409-and-pins-on-partial-build
Oct 21, 2026
Merged

garymike merged 1 commit into
mainfrom
fix/cosign-409-and-pins-on-partial-build

Conversation

@garymike

Copy link
Copy Markdown
Owner

Two faults with one cause, both visible in #86's build.

The 409

A rebuild whose inputs have not changed produces a byte-identical digest, and Rekor rejects a second equivalent entry for it:

error signing bundle: [POST /api/v1/log/entries][409] createLogEntryConflict
{"code":409,"message":"an equivalent entry already exists in the transparency log with UUID 108e9186..."}

That is not a signing failure. The entry it conflicts with is this digest's signature, already in the log from the earlier run. toolbox/gha was untouched by #86, gha-toolbox rebuilt to the same bytes, and the step failed on its own prior success.

Matched on createLogEntryConflict specifically rather than on any non-zero exit, so a real failure still fails. Verified against four stubbed cosign outcomes:

cosign behaviour exit
success 0 ok
Rekor 409 conflict 0 tolerated, with a notice saying why
no OIDC token 1 still fails
registry 403 1 still fails

The worse one, which the 409 exposed

A red domain arm skipped the pins job entirely, because needs: [base, domain] does not run on a partial build. So a reproducible rebuild could silence the very check #88 added to watch the pins, while five images published with nobody comparing anything.

It now runs with if: ${{ !cancelled() }}.

That raises a question the first version never had to answer: what about an image that never published? There is nothing to compare, so it is reported as "published no digest in this run, so its pin was NOT checked" rather than quietly dropped. Four greens must not read as a clean sweep when six images were expected.

Verified on a simulated partial build, with gha-toolbox missing:

::warning::gha-toolbox published no digest in this run, so its pin was NOT checked.
::warning::mcp-review-toolbox published no digest in this run, so its pin was NOT checked.
  iac-security.yml: iac-toolbox pin is current
  sast.yml: sast-toolbox pin is current
  security-scan.yml: security-toolbox-base pin is current
  skill-audit.yml: skill-audit-toolbox pin is current

One deliberate roughness

The zero-digest case still fails outright rather than warning. On a totally failed build that is redundant with the build's own red. The alternative is a job that reports success having compared nothing, and that is the exact failure shape that let the pins drift unnoticed four times, so I would rather have the redundant red.

actionlint clean, zizmor clean.

🤖 Generated with Claude Code

Two faults, one cause, found because #86's build went red on both at once.

A rebuild whose inputs have not changed produces a byte-identical digest, and
Rekor rejects a second equivalent entry for it with 409
createLogEntryConflict. That is not a signing failure: the entry it conflicts
with IS this digest's signature, already in the log from the earlier run.
toolbox/gha was untouched by #86, gha-toolbox rebuilt to the same bytes, and
the sign step failed.

The sign step now matches createLogEntryConflict specifically and treats it as
already-signed, with a notice explaining why. Any other cosign failure still
fails: verified against four stubbed outcomes, where success and the 409 exit
0, and a missing OIDC token and a registry 403 both exit 1.

The second fault is worse, and the 409 is what exposed it. A red domain arm
skipped the pins job entirely, because needs: [base, domain] will not run on a
partial build. So a reproducible rebuild could silence the very check added in
#88 to watch the pins, while five images published with nobody comparing
anything. It now runs with if: !cancelled().

That raises the question the first version did not have to answer: what to do
about an image that never published. Nothing to compare, so it is reported as
"published no digest in this run, so its pin was NOT checked" rather than
dropped. Four greens must not read as a clean sweep when six images were
expected. Verified on a simulated partial build: the four that published are
confirmed current, and the two that did not are named as unchecked.

The zero-digest case still fails outright rather than warning. On a totally
failed build that is redundant with the build's own red, but the alternative
is a job that reports success having compared nothing, which is the failure
shape that let the pins drift unnoticed four times in the first place.

actionlint clean, zizmor clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@garymike
garymike merged commit 79b45d2 into main Oct 21, 2026
9 checks passed
@garymike
garymike deleted the fix/cosign-409-and-pins-on-partial-build branch October 21, 2026 19:21
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