Skip to content

publish-verify: skip a superseded commit with a notice instead of going red - #1277

Merged
bpalermo merged 1 commit into
mainfrom
upgrade/publish-verify-superseded
Oct 5, 2026
Merged

bpalermo merged 1 commit into
mainfrom
upgrade/publish-verify-superseded

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Standalone, off main. This is in its own PR on purpose: publish-verify.yaml is a release-verification workflow.

CodeQL: past edits to this file have raised actions/untrusted-checkout, which is a known false positive. This PR does not change what the workflow checks out (ref: main, fetch-depth: 0) or its permissions (contents: read, plus issues: write on the job). If the alert appears again, it is for you to weigh and dismiss. I have not dismissed anything.

Problem (confirmed)

publish-verify runs on workflow_run of publish and checks the registry for that run's commit. When a merge replaces a pending publish, that run ends cancelled and pushes nothing. Its commit is then reported "not published", and main goes red even though the next publish carries the change.

On 2026-10-05 this happened eight times in a row, from run 37327978991 through 37362581014. Each was the workflow_run of a publish that had been cancelled because a newer merge superseded it. Then 37363695109, for df3a1136 (the publish that succeeded), went green. Red noise like this hides a real failure.

Change

A new step runs before the gate: scripts/publish-verify-superseded.sh.

It treats a commit as superseded only when both of these hold:

  • its publish run did not conclude success, and
  • the commit is no longer main's head (git ls-remote origin refs/heads/main).

For a superseded commit, the registry check, Bazel setup and cosign pass are skipped. The run says so in a ::notice:: and in the job summary, and finishes green.

Everything else is checked exactly as before:

publish conclusion commit vs main head result
success any verified (missing artifacts or signatures → red, issue filed)
not success still the head verified (nothing newer will publish it → red)
not success main moved on skipped with a notice
any head unknown, or a malformed sha verified (fails closed)
none (schedule / dispatch) — unchanged; the step does not run

The task asked for neutral whenever the conclusion is cancelled. I made one deliberate exception: a cancelled run for the commit that is still main's head stays red. In that state no later publish will build that commit, so it really is missing. That case is a manual cancel, or a cancel by the stuck-run watchdog (#1276 never cancels a head run).

Note (#880): this reverses part of #880's intent. A superseded commit has no commit-suffixed chart tag of its own, so it cannot be deployed by that exact tag. The runbook's remedy still works: re-run its publish run. This PR stops counting that as a failure.

Also included: a targeted # shellcheck disable=SC2016 on the issue step's printf. The backticks there are literal Markdown fences. This was the only actionlint finding in this file. The stacked actionlint PR ignores it for this one file through .github/actionlint.yaml; drop that entry once this merges.

How the neutral path was verified without a real cancelled publish

The decision is pure: commit, conclusion, main head → superseded | verify. That made it unit-testable.

//scripts:publish_verify_superseded_test (hermetic, part of bazel test //...) covers:

  • 13 decision cases, including the 2026-10-05 shape (cancelled, main moved on → skip). Every "must stay red" case is pinned: success, head, unknown or malformed head, abbreviated or uppercase sha, empty conclusion.
  • The step end to end, with MAIN_HEAD standing in for ls-remote:
    • superseded → skip=true, the notice, and a summary line;
    • success → skip=false and no notice.

The test caught one bug while I was writing it: an empty conclusion was being classed as superseded.

The workflow wiring was checked by reading it:

  • the gate and the three Bazel/cosign steps add steps.superseded.outputs.skip != 'true' to their existing if:;
  • the issue steps are already gated on steps.verify / steps.control failing, so a skipped gate files nothing;
  • if the new step itself is skipped or fails, its output is empty, and the gate runs as before.

Not changed / found (not fixed here)

  • The scheduled --recent sweep is not taught about superseded heads. Superseded commits are still push heads, so a sweep that completes will report them MISSING. Today that does not show, because the sweep is not completing at all — see the next item. Teaching it means changing the push-head selection in scripts/push-heads-lib.sh / verify-published-artifacts.sh; that is a follow-up for you to decide on.
  • The scheduled sweep has hit its 30-minute timeout-minutes three times in a row: 37243212359, 37269704858, 37328769954. Each ended cancelled in the cosign step. A timeout concludes cancelled, which the issue steps (failure()) ignore, so the backstop has been silently off since 2026-10-04. Not touched here, to keep this diff minimal.

Proof

  • bazel test //scripts:publish_verify_superseded_test: pass.
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //scripts:all: clean.
  • make format-check: clean.
  • actionlint 1.7.12: no findings in this file.
  • //website:site_test: pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…ng red

publish-verify's workflow_run path verified every finished publish run's
commit, so each merge that replaced a pending publish (the run ends cancelled,
pushes nothing) turned main red with "not published: ...": eight red runs on
2026-10-05 alone, which hide a real verification failure.

A new step, before the gate, asks scripts/publish-verify-superseded.sh: if the
publish run did not conclude success AND the commit is no longer main's head
(git ls-remote), the commit is superseded; the registry check and the cosign
pass are skipped and the run says so in a ::notice:: and the job summary.
Everything else is verified exactly as before: a publish that reported success
with missing artifacts or signatures is still red, and so is main's own head
whatever its publish concluded (nothing newer will publish it). An unknown head
or malformed sha fails closed (verify).

Checkout ref and permissions are unchanged. Also a targeted SC2016 directive
on the issue step's printf (literal Markdown fences), the one actionlint
finding in this file.

//scripts:publish_verify_superseded_test pins the decision (13 cases) and the
step's GITHUB_OUTPUT / notice.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo force-pushed the upgrade/publish-verify-superseded branch from d0fe7df to 777959e Compare October 5, 2026 22:43
@bpalermo
bpalermo merged commit 9b849d6 into main Oct 5, 2026
25 checks passed
@bpalermo
bpalermo deleted the upgrade/publish-verify-superseded branch October 5, 2026 22:50
bpalermo added a commit that referenced this pull request Oct 6, 2026
)

The workflow_run path skips a commit whose publish did not succeed once
main has moved past it (#1277); the --recent sweep still demanded
commit-addressed artifacts for every push head, so the 2026-10-05 sweep
(run 37384419419) went red on the eight consecutive publishes that the
next merge cancelled while pending (b1dc1c0..28b2680: 176 of 736
artifacts "missing").

The sweep now applies the same function to each push head
(select_unsuperseded in scripts/push-heads-lib.sh calls
publish-verify-superseded.sh decide): a superseded head is printed as
`skip <sha> (superseded push head ...)` with a ::notice:: and a job-summary
line; main's head, a head whose publish succeeded (any green re-run wins)
and a head with no publish run on record are still checked. An unreadable
run list or an unknown main head skips nothing. The quiet-day fallback
picks the newest push head that was not superseded.

Test: //scripts:push_heads_superseded_test, canned 2026-10-05 runs.

Closes #1282


Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Co-authored-by: Claude Fable 5.1 <[email protected]>
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