Repository navigation
feat(github): Ask to merge a PR that GitHub can merge with no review - #4304
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This comment has been minimized.
This comment has been minimized.
A Junior PR in a repo that requires no review never got a "Ready to merge" Inbox item, because the merge action needed an approval. Use GitHub's merge state instead: `clean` with no open change request is the merge action. Repos that require a review report `blocked` until it approves, so they keep today's behavior. With no approval, the item tells the requester to review the PR before they merge it. Co-Authored-By: BYK <[email protected]>
Co-Authored-By: BYK <[email protected]>
When GitHub still requests a review from a person or a team, the PR asks for that review instead of the merge, even where the repo allows merging without one. A request for only someone else gives no item. Add the approved rule to design/github.md. Co-Authored-By: BYK <[email protected]>
sentry-junior
Bot
force-pushed
the
feat/github-merge-without-required-review
branch
from
November 25, 2026 14:53
b7be6ff to
034a487
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 034a487. Configure here.
BYK
approved these changes
Nov 25, 2026
23 tasks done
BYK
added a commit
that referenced
this pull request
Nov 25, 2026
… in limbo (#4310) The next action of a Junior pull request ("Review requested", "Ready to merge", or the held-draft ask from #4306) is derived only when a webhook that can change it arrives. Two groups of open PRs have no item: - Quiet PRs that went silent before a rule shipped. Example: #2382, where GitHub asked for the requester's review on 11-12, before #3395, and no webhook has come since. About 14 of BYK's PRs are `clean` and not approved. With #4304 they derive `merge`, but no webhook will come to derive it. - **PRs in limbo:** ready PRs that ask nothing of their requester, because no one ever asked for the requester's review. They were opened ready, or became ready, before #3250, or the requester linked GitHub later. **This is a one-off run with a done key, not a recurring poll.** A new started task, `backfillPullRequestActions`, does the run. It follows the `repository-name-repair` one-off (#4192): - After deploy, the GitHub heartbeat starts one page per tick: 50 open Junior PRs, in GitHub id order. Each page has its own task key. - Each page goes through the webhook sync path, `syncGitHubPullRequestActions`, with the same claim and the same concurrency limit of 5. A PR that no person asked for returns before any GitHub read. - After the last page, the task sets `pull-request-action-backfill:v1:done` in plugin state, and the heartbeat never starts it again. To run it again after a later rule ships, bump `VERSION` in `pull-request-action-backfill.ts`. ## Limbo `inLimbo` in `pull-request-action.ts` uses only what `nextAction` already reads, plus the head commit time. An open Junior PR is in limbo when all of these are true: - The derived action is none. - It is not a draft, and auto-merge is off. - It has a stored requester with a linked GitHub login. - GitHub has no pending user review request for the requester. A pending request for another person or a team does not count, because it asks the requester for nothing. - The requester has not reviewed or commented since the last push (the head commit's `committedDate`). - No reviewer approved it. Such a PR waits only on others. - No reviewer, the requester included, requests changes. On such a PR, Junior acts next. For each PR in limbo, the backfill asks for the requester's review on GitHub. It uses `requestPullRequestReviewers`, the same call that #3250 makes on `ready_for_review`. It asks only the requester, and never code owners or teams. The next read then derives the normal "Review requested" item. To show approval on a PR that is not `clean`, the merge-state read now computes `reviewOutcome` for every open PR. `nextAction` still reads it only for `clean` PRs. **Side effect:** after deploy, the backfill sends one GitHub review request to the requester on each PR in limbo, for all users. GitHub data from 11-25: 98 open, ready Junior PRs, from 21 requesters, have an assignee that GitHub does not ask for a review, are not approved, have no change request, and have auto-merge off. This is an upper bound. PRs that derive `merge`, PRs where the requester commented after the last push, and PRs with no stored requester or linked login are not asked. BYK has 34 of these PRs. About 14 of them derive "Ready to merge" under #4304, so BYK gets about 20 review requests. Dismissed items stay dismissed. The sync changes an item only when the derived action is different from the saved one. getsentry/sentry-rust#1400 has `merge` saved, so its dismissed "Ready to merge" item does not come back. A PR in limbo has no saved action, so asking for its review cannot bring back a dismissed item. Started plugin tasks now get `inboxItems` and `users.readIdentity`, as plugin routes do. The task needs them to show items and to map the requester's linked GitHub login. PRs that go into limbo after this one-off are handled by the PR stacked on this one. ## Proposed design/github.md rule (not edited here) > A ready Junior PR always has an Inbox ask or a pending GitHub review request for its requester. When it asks nothing of the requester, Junior asks for the requester's review on GitHub once the required checks pass, but not after a push when the requester has already reviewed or commented. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A6eedb91e2d3dfa1fd070e65575e7799d --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A6eedb91e2d3dfa1fd070e65575e7799d) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A6eedb91e2d3dfa1fd070e65575e7799d/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
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.

A Junior PR in a repo that requires no review never gets a "Ready to merge" Inbox item, because the merge action needs an approval. Such PRs (for example getsentry/skillet#45 and getsentry/platformicons#251) are clean and mergeable but never show in Code · Mine's "Waiting on you".
The merge action now follows GitHub's merge state: the PR is open, not a draft, auto-merge is off, the state is
clean, no reviewer still requests changes, and GitHub requests no review. A repo that requires a review reportsblockeduntil someone approves, so it keeps today's behavior. Junior still never approves or merges.GitHubPullRequestMergeState.approvedbecomesreviewOutcome(approved,changesRequested, or unset), because the action now has to tell "no approval" apart from "a reviewer requests changes".A pending review request comes first
When GitHub still requests a review from a person or a team, the action is never
merge, even when the state isclean:reviewaction ("Review requested").The new
reviewPendingflag counts every node ofreviewRequests, not onlyrequestedReviewers, because a team that the App cannot read comes back with no login. This also applies where GitHub requires a review: an approved PR that still has a pending request asks for that review, not the merge.Wording
With no approval, the item keeps the
Ready to merge · #Ntitle and its text says:The dashboard keys the kind, icon, and Code · Mine head off the title (
askKind.tsx,inboxAsks.tsx,inboxModel.ts,codeChangeHead.ts). The Inbox hides item text only when it repeats the head (textRepeatsHead), so this text shows on the row and makes clear that nobody reviewed the PR. The text stays true after a later approval, which matters because the item changes only when the action changes.Dismissed items
The action stays
merge, so an item that a person dismissed, such as getsentry/sentry-rust#1400's, does not come back. Existing PRs get the new action on their next webhook.design/github.mdThe rule takes the approved text. @BYK, the last sentence is new and mirrors your answer about pending reviews; tweak it as you like:
via @BYK.
--
View Session [Sentry]