Skip to content

fix: read an empty release run listing through check-runs - #36953

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
crew/issue-radar/fix-36859-promotion-empty-listing
Nov 14, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
crew/issue-radar/fix-36859-promotion-empty-listing

Conversation

@kyleseaman

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A stable promotion finds the same-commit prerelease run even when GitHub's head_sha runs listing answers empty.

scripts/release_promotion.py resolve reads actions/workflows/release.yml/runs filtered by event=push, status=success and head_sha. That listing is a filtered search that can answer no runs for a commit whose runs exist (#23245). On an empty answer the resolver raised no successful prerelease workflow run exists for this exact commit and base, so the stable promotion was refused for a commit whose prerelease run had succeeded.

Why it matters

The refusal is loud, so nothing wrong ships, but a release stops and the message sends the operator looking for a run that is there. Every other reader of this listing already reads an empty answer through the commit's check-runs (#32383, #33367); this one did not.

Not a goal

What changed (motivation → approach → change)

  • Symptom: a stable promotion refused with "no successful prerelease workflow run exists" for a commit whose prerelease release.yml run succeeded.
  • Cause: resolve_candidate took an empty head_sha listing as "no run".
  • Change: when the listing is empty, _release_runs_named_by_check_runs reads the commit's check-runs (every row, filter=all, paged), takes the run ids their Actions job links name (.../<repo>/actions/runs/<id>/job/<job>), fetches each run, and keeps the release.yml push runs. Those go through the unchanged select_candidate_runs (success, exact head_sha, v<base>- branch). Any read that fails raises PromotionError, so an unreadable run is a read failure, never an absent run. This is the same rule as republish_withheld_verdict.py::_head_runs.
  • release.yml resolve-promotion gains checks: read for that read; the two permission pins and the empty-listing paragraph in docs/ci/ci-and-reviews.md are updated.

Backwards compatibility

Compatible: a non-empty listing takes the same path as before; only an empty listing now does an extra read before it concludes.

Removes nothing: the change only adds a fallback read and one read-only token permission.

Tests

  • test_an_empty_runs_listing_is_read_through_the_commits_check_runs: an empty listing plus check-runs naming the release run (two jobs) and a ci.yml run resolves the release run, reads check-runs once with filter=all, fetches the release run once, and never reads the ci.yml run's artifacts.
  • test_a_named_run_that_cannot_be_read_is_a_read_failure_not_an_absent_run: a named run whose fetch fails raises the API error, not the "no run" refusal.
  • test_stable_tag_resolves_candidate_and_never_enters_build_jobs and TestReleasePermissions::test_release_jobs_follow_least_privilege_split: pin checks: read on resolve-promotion.

Proof: PROVEN test/test_release_promotion.py::test_a_named_run_that_cannot_be_read_is_a_read_failure_not_an_absent_run, test/test_release_promotion_contract.py::test_stable_tag_resolves_candidate_and_never_enters_build_jobs, test/test_workflow_permissions.py::TestReleasePermissions::test_release_jobs_follow_least_privilege_split (head 620f40d)

Locally: test_release_promotion.py, test_release_promotion_contract.py, test_workflow_permissions.py, test_stable_release_gate.py: 103 passed; local-gate.py backend related tests: 764 passed.

Manual verification

N/A: the empty listing cannot be produced on demand (the issue says so), so the stubbed gh tests above are the reproduction.

Related Issues

Fixes #36859

Sibling sweep

Swept: git grep -nE "runs?[^"]*head_sha|"head_sha": *source_sha|head_sha=$" -- scripts .github
Sibling: scripts/release_promotion.py -- changed here
Sibling: .github/scripts/republish_withheld_verdict.py -- not affected -- already reads an empty listing through check-runs (#32383)
Sibling: .github/workflows/pr-readiness.yml -- not affected -- already reads an empty listing through check-runs (#32383)
Sibling: .github/workflows/ai-review-human-override.yml -- not affected -- already reads an empty listing through check-runs (#32383)
Sibling: .github/workflows/pr-size-override.yml -- not affected -- already reads an empty listing through check-runs (#33367)
Sibling: .github/workflows/merge-queue-readiness.yml -- not affected -- already reads an empty listing through check-runs (#33367)
Sibling: .github/scripts/await-fast-gate.sh -- tracked in #33264
Sibling: .github/workflows/issue-gate-retrigger.yml -- tracked in #33264

Pattern harvest

Rule candidate: semgrep
Pattern: a head_sha-filtered actions/runs listing whose empty answer is taken as "no run" without a check-runs read

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

release_promotion.py resolve reads the release.yml runs listing
filtered by head_sha, which is a filtered search that can answer no
runs for a commit whose runs exist (#23245). An empty answer refused
a stable promotion for a commit whose prerelease run succeeded.

An empty listing is now read through the commit check-runs (every
row, filter=all), the runs their Actions job links name are fetched,
and release.yml push runs are kept, the rule the other readers apply.
An unreadable named run fails the resolve, never reads as absent.
resolve-promotion gains checks: read for that read.

Fixes #36859
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 620f40d0c6f50c96ffcc51bce099c6bf4ae65ac9 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 620f40d0c6f50c96ffcc51bce099c6bf4ae65ac9 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: this reuses the check-runs fallback that the sibling readers already use, adds one read-only permission, and leaves candidate selection unchanged.

[DESIGN-REVIEWED] 620f40d

Description read

[DESCRIPTION-READ] 187d8d3344da0e6cf61f6d448eaa7f2d049bfbbf5f8e5d0a5b220eb8ba318602

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 620f40d0c6f50c96ffcc51bce099c6bf4ae65ac9 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The fix is at mechanism level and tied to #36859. The only overlap is with the check-runs parsing in republish_withheld_verdict.py, which lives in another tree and handles errors differently.

Notes

  • Item 1 — second spelling of .github/scripts/republish_withheld_verdict.py::_run_ids_from_check_runs: the new marker = f"/{repository}/actions/runs/" … split(marker, 1)[1].split("/", 1)[0] is the same check-runs → run-id parse (1 existing Python copy, found by grepping actions/runs/.*details_url|check-runs\?filter=all). That copy returns None where this one raises, and they sit in different trees, so this is a note, not a duplicate that blocks. Subtraction: replace the hand-rolled page/len(rows) < 100 loop with gh api --paginate --slurp, the same call the existing copy makes.

What this change ships

Inventory (4 items) — 3 justified

Intent: let a stable release promotion find the same-commit prerelease run when GitHub's head_sha listing comes back empty. FIX.

  1. An empty release-run listing now falls back to the run ids the commit's check-runs name, then fetches each run — duplicate of .github/scripts/republish_withheld_verdict.py::_run_ids_from_check_runs (parse only)
  2. A named run that cannot be read now fails as a read error instead of a "no run" refusal — justified
  3. The resolve-promotion job gains the checks: read token permission — justified
  4. The ci-and-reviews doc lists release_promotion.py among the readers that follow the empty-listing rule — justified

[FIRST-PRINCIPLES-REVIEWED] 620f40d

Description read

[DESCRIPTION-READ] 378b203c78d3822179fb89dbb1281a8c6db184eace6b2fc6200390341960417e

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 620f40d0c6f50c96ffcc51bce099c6bf4ae65ac9 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 620f40d

Verdict parsed from the review's SHA-scoped output markers for commit 620f40d0c6f50c96ffcc51bce099c6bf4ae65ac9.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 620f40d0c6f50c96ffcc51bce099c6bf4ae65ac9 false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 620f40d0c6f50c96ffcc51bce099c6bf4ae65ac9 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 620f40d

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 620f40d0c6f50c96ffcc51bce099c6bf4ae65ac9 false-positive: <reason, 20 to 500 characters>

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: the decider estimates an 8% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes.

An empty head_sha runs listing is now read through the commit's check-runs: every row is read (filter=all, paged), the named runs are fetched from the repo's own API and only release.yml push runs are kept. Those still go through the unchanged select_candidate_runs (successful run, exact SHA, v- branch), so a forged check-run link cannot widen what can be selected. The stable tag's own in-progress run is excluded by its branch and its missing conclusion. Any failed read raises instead of reporting "no run". checks: read is added to the resolve-promotion job and both permission pins are updated. The new tests would fail without the change. The non-empty listing path is unchanged.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 620f40d0c6 · 153 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Nov 14, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 14, 2026 02:02

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. On this head the review checked that the check-runs fallback runs only when the release.yml runs listing comes back empty. It keeps only same-repo push runs of release.yml, and the kept runs still go through the unchanged select_candidate_runs and verify_bundle. A named run that cannot be read raises PromotionError. With the base script, both new tests fail: one hits the old refusal from #36859, the other a wrong error match. With the fix they pass. Removing the path filter makes the main test fail.
Security: the only new grant is a read-only checks: read on the resolve-promotion job, and both permission pins are updated. Only a push run of release.yml in this repo can become a candidate, so the fallback trusts nothing the existing listing did not already trust.
Done well: the fake API fails on any endpoint it does not expect, so reading the unrelated ci.yml run's artifacts is a hard failure, not a silent pass.
Optional:

  • Add a two-page case: page 1 has exactly 100 rows with no release run, and page 2 names the run. Today, a loop that stops after page 1 still passes every test.
  • Add a release.yml run with a non-push event, so a test covers the event == "push" filter.
  • The Proof line could also name test_an_empty_runs_listing_is_read_through_the_commits_check_runs, which fails without the fix.

@KiroCrewCaptain
KiroCrewCaptain merged commit d532b6d into main Nov 14, 2026
105 of 109 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the crew/issue-radar/fix-36859-promotion-empty-listing branch November 14, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release_promotion takes an empty head_sha run listing as no run

2 participants