Skip to content

fix(github): Give no merge ask after the merge queue's checks fail - #4783

Merged
BYK merged 4 commits into
mainfrom
fix/merge-queue-failed-checks-ask
Nov 30, 2026
Merged

BYK merged 4 commits into
mainfrom
fix/merge-queue-failed-checks-ask

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

#4589 closes the merge ask while a PR is in the merge queue and syncs it again on dequeued. When the queue removes a PR because the merge group's checks failed, that sync gave the requester a new "Ready to merge" item. GitHub's mergeStateStatus checks only the PR's head commit, so it still says CLEAN.

#4703 and #4698 show this. Each one was enqueued, the merge group's lint / workspace failed (two leaf Drizzle snapshots against the new main), GitHub removed it with reason failed_checks, and a new merge item came about 3 seconds later. Merging again would fail the same way. The branch needs a push first.

  • The PullRequestNextAction query also reads the last merge queue removal or force push (an aliased timelineItems(last: 1) in the same request). When it is a removal with reason failed_checks and the head commit is older than the removal, mergeQueueFailed is set and nextAction gives no merge ask.
  • A push after the removal, such as a merge of main, or a force push clears it, so the merge ask comes back once the checks pass. Other removals, such as a person taking the PR out, still let the merge ask come back.
  • design/github.md states the rule in its own commit.
  • The next-action read moves from installation-requests.ts to pull-request-merge-state.ts, because the old file went over the 1,000-line limit. Its comment-length baseline entry moves with it.

Not in this PR: after a failed queue run, Junior does not fix its own PR. The merge group's check suites run on gh-readonly-queue/*, not on the PR head, so pull_request.checks.failed does not fire. A follow-up handles it.

via @BYK.

--

View Session [Sentry]

GitHub's merge state checks only the head commit, so a pull request that
the merge queue removed for failed checks still reads clean, and the
dequeued sync gave the requester a new merge ask. The next-action read now
also reads the last merge queue removal. When its reason is failed_checks
and nothing was pushed since, the pull request gets no merge ask.

The next-action read moves to pull-request-merge-state.ts, because
installation-requests.ts went over the file length limit.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 30, 2026 11:29am UTC

Request Review

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@blacksmith-sh

blacksmith-sh Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
tests/integration/thread-input-stop.test.ts/Thread input stop >
keeps a Turn that a worker resumed after the stop read its sign-in pause
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

A force push can move the head to a commit that is older than the merge
queue removal, so the head commit time alone kept the merge ask away.
The same timeline read now also returns the last force push.
@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 30, 2026 11:45
@sentry-junior
sentry-junior Bot requested a review from BYK November 30, 2026 11:45
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 30, 2026

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not in this PR: after a failed queue run, Junior does not fix its own PR. The merge group's check suites run on gh-readonly-queue/*, not on the PR head, so pull_request.checks.failed does not fire. A follow-up handles it.

It is imperative that we fix this as otherwise these conflicting PRs will fall into limbo, not showing up anywhere.

@BYK
BYK added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 533c9e6 Nov 30, 2026
82 of 84 checks passed
@BYK
BYK deleted the fix/merge-queue-failed-checks-ask branch November 30, 2026 12:09

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 2f3cca85 Deployed Nov 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant