Skip to content

ci: a release whose checks fail fails the required Build, so it cannot merge - #8543

Merged
miguel-heygen merged 1 commit into
mainfrom
ci/release-checks-block-merge
Nov 23, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
ci/release-checks-block-merge

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

A release pull request whose release checks fail can no longer merge. The required Build check now waits for Release checks and fails, before building anything, when a release's checks did not succeed.

Why

Release checks runs release-only-diff.mjs --verify on a release pull request and again in the merge queue. In the queue it compares the notes against main as the queue built it. So a pull request that merged after the notes were drafted fails it: "releases/vX.md misses 1 commit(s) merged since the notes were drafted". That is the job's purpose, per its own comment.

But Release checks is not one of main's required checks, and the queue waits only for required ones. Both v0.9.82 and v0.9.83 merged while it was red:

Each shipped in the packages with no line in its release's notes.

How

  • build (required as Build) now needs: [changes, release-checks]. Its new second step fails when the diff is a release (release_diff) and Release checks did not succeed, whether it failed, was cancelled or was skipped.
  • For any other pull request, Release checks is skipped at once, so Build starts as before.
  • Build already runs on release pull requests and in the queue (it passed in the v0.9.83 queue run while Release checks failed), so the gate is always evaluated where it matters.
  • The alternative, adding Release checks to the branch ruleset, is a settings change. This keeps the rule in the workflow, with a test next to the check.

Test plan

  • fails without the fix: scripts/ci/release-only-diff.test.mjs ("a release whose checks fail cannot merge: the required Build fails with them"): against main's ci.yml it fails with "Build waits for the release checks". It parses the workflow and checks that Build needs release-checks and that its second step fails on release_diff == 'true' with any result other than success.
  • On a Linux machine: scripts/ci/release-only-diff.test.mjs and scripts/merge-queue-workflows.test.mjs pass 3 runs in a row; Fallow and pre-push are clean.

No visible change

CI only. A release pull request merges only once its notes list everything it ships.

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 80 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

@vanceingalls vanceingalls 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.

Approved at b286350, CI green. This closes a real hole: v0.9.82 and v0.9.83 merged with a red Release checks because it isn't required.

  • Gate: Build now needs: [changes, release-checks], and its if: keeps !cancelled(), so it still runs when Release checks is skipped or red. The new step 2 fails only when release_diff == 'true' and the release checks result isn't success (failed, cancelled or skipped all block), before any build work.
  • Non-release PRs: release-checks skips at once, so Build starts as before. Cost on a release PR is Build waiting for the verify job.
  • Queue: Build already runs in the merge queue, where the stale-notes check actually fires, so the gate is evaluated where it matters.
  • Test: the workflow-parse test pins the needs, the condition and the step index, and fails against main's ci.yml.

Non-blocking: making Release checks itself required in the ruleset would be the belt-and-braces version. Keeping it in the workflow with a test is a fine call.

@terencecho terencecho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Build is required on main. It now waits for Release checks and fails before checkout when a release diff has a non-success result. I checked both historical release queue commits. Each had a release-only diff against its first parent, which already contained the preceding queued change. This matches the classifier and the new gate. At this PR head, Build also passed with Release checks skipped on the ordinary PR path.

All 21 focused tests passed. The named regression failed against the parent workflow with “Build waits for the release checks.” The release failure path was verified by inspection of the workflow and the historical queue commits.

— tai (automated review)

@jrusso1020 jrusso1020 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.

Verdict: APPROVE at b286350e. Code-owner review for .github/workflows/.

Need ✅ · Size ✅ (+26/−1) · Reuse ✅ · Simpler ✅ · Structure ✅
Risk: low. CI only. Non-release PRs skip Release checks at once, so Build starts as before.

What I checked:

  • The gate fires exactly where the checks run. release_diff is true only on a release-only diff, in a pull request or the merge queue (.github/actions/release-only-diff). release-checks runs on (merge_group && release_diff) || release_only, and on a pull request release_only equals release_diff. So the new step only fails Build when Release checks actually ran and didn't succeed, or was cancelled. It never fails on a skip that was meant to happen.
  • Build runs where the gate matters. In the queue a release's diff touches packages/*/package.json, which is in the code filter, so Build runs there and evaluates the step. On a release pull request, release_only keeps Build running as before. On push and dispatch, release_diff is false, so the step is skipped.
  • Build keeps !cancelled(), so the skipped release-checks on other PRs doesn't skip Build. It's a required check, so a skip would have read as a pass.
  • Only smoke-global-install needs build, and it is unaffected. There's no cycle: release-checks needs only changes.
  • The test parses the workflow with yaml, which is already a root devDependency. Its fails without the fix: line is in the body and the test. Against main's needs: changes, the includes("release-checks") assertion fails.
  • CI at head is green, with Build passing and Release checks skipped as expected on this non-release PR.

— Rames (hf-review)

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 014e0b0 Nov 23, 2026
85 checks passed
@miguel-heygen
miguel-heygen deleted the ci/release-checks-block-merge branch November 23, 2026 01:26
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.

4 participants