Repository navigation
fix(github): Give stacked and queued PRs no merge ask - #4589
Merged
Merged
Conversation
GitHub's merge state checks a pull request only against its base branch, so a PR whose base is the head of another open PR read as clean and got a merge ask. The next-action read now checks for an open PR on the base branch, and a base change (GitHub's retarget after the base merges) syncs the action again. Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
6 screenshot changes — 6 changed · 0 added · 0 removed Review screenshots in Frameshift |
…rges Co-Authored-By: BYK <[email protected]>
GitHub merges a queued pull request, but the next-action read did not check the queue and no queue webhook synced the action, so the merge ask stayed after the requester queued it. The read now includes isInMergeQueue, and enqueued and dequeued sync the action again. Co-Authored-By: BYK <[email protected]>
23 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Junior gave the requester a "Ready to merge" ask in two cases where no person needs to merge yet.
Stacked PRs. GitHub's
mergeStateStatuschecks a PR only against its base branch. A PR whose base is the head branch of another open PR readsCLEANas soon as its own checks and reviews pass. getsentry/toolkit#2520 is an example: its basefeat/cli-wizard-scaffoldis the head of getsentry/toolkit#2519, which is still a draft.baseRefName,baseRef.associatedPullRequests(states: OPEN).totalCount, and the repo's default branch. When the base branch is not the default branch and another open PR has it as its head,baseOpenis set andnextActiongives no merge ask. A review ask still comes. A PR from the default branch, such as a sync into a long-lived branch, does not count.pull_request.editedsyncs the action again, but only whenchanges.baseis set. After the base merges, GitHub retargets the PR, and that edit makes the merge ask show.design/github.mdstates the rule in its own commit.If the base branch is kept after it merges, GitHub does not retarget the PR above it, and this PR does not handle that case. Junior stores no base branch for its open PRs, so handling the base PR's
closedevent would need a GitHub read for each merged PR.PRs in the merge queue. GitHub merges a queued PR, but the read did not check the queue, and no queue webhook synced the action, so the merge ask stayed after the requester queued it.
isInMergeQueue. A queued PR gets no merge ask, and it is not in limbo, so Junior does not ask for the requester's review either.pull_request.enqueuedanddequeuedsync the action again. When a PR leaves the queue without merging, the normal rules decide again, so the merge ask can come back.All of this stays in the one
PullRequestNextActionread, with no new request.Coordination: #4395 generates
nextActionfrom a decision table that must matchmain. It needs matchingbaseOpenandinMergeQueueinputs that blockmerge.via @BYK.
--
View Session [Sentry]