Skip to content

ci: judge only the latest check run per name in auto-tag verify#586

Merged
claude-dataviking merged 1 commit into
mainfrom
ci/auto-tag-latest-check-run
Jul 18, 2026
Merged

ci: judge only the latest check run per name in auto-tag verify#586
claude-dataviking merged 1 commit into
mainfrom
ci/auto-tag-latest-check-run

Conversation

@claude-dataviking

Copy link
Copy Markdown
Contributor

What

Fixes the auto-tag "Verify CI checks passed" step so it judges only the latest check run per (app, name) on the merged head SHA, instead of every run ever parked there. Two side fixes ride along: root server.json is now staged in the version-bump commit, and semver-label.yml's self-heal rerun step is removed as redundant.

Why

The check-runs API returns runs from every check suite ever started on a SHA, and label events don't move the head. So the superseded pre-label opened run of Semver Label (red) — and even a stale in_progress Cloudflare Pages attempt — sat on the SHA forever and made verify refuse to tag. This blocked the first v1.6.0 attempt. GitHub's own merge box collapses check runs to the latest per name; verify now does the same.

Changes

  • .github/scripts/verify-ci-checks.sh (new): the verify logic, extracted so it can be run standalone (read-only, REPO=... HEAD_SHA=... bash .github/scripts/verify-ci-checks.sh) against any SHA. Same gh api + jq style; groups by (app.slug, name), sorts by started_at with id as same-second tiebreak, takes the last, then applies the unchanged incomplete/failed rules (neutral/skipped still pass; the auto-tag check run is still excluded so a prior failed tagging attempt can't block its own recovery rerun).
  • auto-tag.yml: verify step now calls the script; and the bump commit's git add gains root server.jsonscripts/render_server_card.py rewrites it (two version slots) alongside the server card, but it was never staged, so it drifted on main and bit PR chore(release): pre-bump version artifacts to 1.6.0 (un-stall the release train) #583.
  • semver-label.yml: the PR ci(semver-label): fresh-fetch labels + self-heal superseded runs; cut v1.6.0 on merge #584 self-heal step ("flip superseded non-green runs of this check green") is removed. It existed solely to appease the old count-everything verify. Required-check mergeability already uses the latest run per name natively, so nothing else needs it; removing it also drops the actions: write permission.

Validation (read-only, no release cut)

Ran old vs new logic against 9ebceaa (PR #584 head), using filter=all to reconstruct the pre-self-heal state:

Logic Verdict
Old (count every run) ::error::1 check(s) still running (stale in_progress Cloudflare Pages attempt; a failure Semver Label pre-label run sits behind it)
New (latest per name) ✅ ignores 3 superseded runs, All CI checks passed

Also validated against SynthBench PR #334 head 1550a06 (old: ❌ 11 non-green; new: ✅) — same fix lands there in the sibling PR. The next natural release is the live proof; this PR is semver:skip so auto-tag short-circuits.

🤖 Generated with Claude Code

The "Verify CI checks passed" step counted EVERY check run on the merged
head SHA. The check-runs API returns runs from every check suite ever
started there, and label events don't move the head — so superseded
red/cancelled runs (e.g. the pre-label `opened` Semver Label run) parked
on the SHA forever and blocked tagging. This blocked the first v1.6.0
attempt. Fix: extract the logic into .github/scripts/verify-ci-checks.sh
and collapse to the latest run per (app, name) — started_at with id as
same-second tiebreak — before judging, mirroring GitHub's own merge-box
collapse. The script runs standalone (read-only) against any SHA.

Also:
- Stage root server.json in the version-bump commit. render_server_card.py
  rewrites it alongside the server card, but it was missing from git add
  and drifted on main (bit PR #583).
- Remove semver-label.yml's self-heal rerun step (added in PR #584): it
  existed only to flip superseded runs green for the old count-everything
  verify. With latest-per-name evaluation it is dead weight; dropping it
  also drops the actions:write permission.

Validated read-only against 9ebceaa (PR #584 head, filter=all to
reconstruct the pre-self-heal state): old logic refuses (stale
in_progress Cloudflare Pages attempt + failed pre-label Semver Label
run), new logic ignores the 3 superseded runs and passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@claude-dataviking claude-dataviking added the semver:skip Skip version bump on merge label Jul 18, 2026
@claude-dataviking
claude-dataviking merged commit eed28ff into main Jul 18, 2026
23 checks passed
@claude-dataviking
claude-dataviking deleted the ci/auto-tag-latest-check-run branch July 18, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:skip Skip version bump on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant