Skip to content

feat(github): Ask to merge a PR that GitHub can merge with no review - #4304

Merged
BYK merged 3 commits into
mainfrom
feat/github-merge-without-required-review
Nov 25, 2026
Merged

BYK merged 3 commits into
mainfrom
feat/github-merge-without-required-review

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

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 reports blocked until someone approves, so it keeps today's behavior. Junior still never approves or merges.

GitHubPullRequestMergeState.approved becomes reviewOutcome (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 is clean:

  • A request for the requester gives the existing review action ("Review requested").
  • A request for only someone else, or a team, gives no item. The PR waits on that reviewer.

The new reviewPending flag counts every node of reviewRequests, not only requestedReviewers, 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 · #N title and its text says:

GitHub says that #N can merge with no review. Review it, then merge it.

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.md

The rule takes the approved text. @BYK, the last sentence is new and mirrors your answer about pending reviews; tweak it as you like:

When a review is requested and still pending, the PR asks for that review instead, even where the repo allows merging without one.

via @BYK.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 25, 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 25, 2026 2:53pm UTC

Request Review

@blacksmith-sh

This comment has been minimized.

sentry-junior Bot and others added 3 commits November 25, 2026 14:22
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]>
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
sentry-junior Bot force-pushed the feat/github-merge-without-required-review branch from b7be6ff to 034a487 Compare November 25, 2026 14:53
@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 25, 2026 15:07
@sentry-junior
sentry-junior Bot requested a review from BYK November 25, 2026 15:07
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 25, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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
BYK merged commit b534ff5 into main Nov 25, 2026
57 checks passed
@BYK
BYK deleted the feat/github-merge-without-required-review branch November 25, 2026 15:12
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

1 active deployment
Preview – junior-docs — 034a4874 Deployed Nov 25, 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