Skip to content

feat(github): Keep a review ask on ready Junior PRs until the requester answers - #4317

Merged
BYK merged 9 commits into
junior/pr-action-sync-retryfrom
junior/pr-action-limbo-asks
Nov 25, 2026
Merged

BYK merged 9 commits into
junior/pr-action-sync-retryfrom
junior/pr-action-limbo-asks

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Stacked on #4316, on top of #4310, which backfills the PRs that are in limbo now. This PR keeps new PRs out of limbo, and it decides what counts as the requester's answer to a review ask. It applies to webhooks and to the #4310 backfill. Every ask goes only to the requester, through requestPullRequestReviewers, the call #3250 makes on ready_for_review. The next read shows the normal "Review requested" item.

1. Ready PRs that wait on nobody

New PRs can still enter limbo:

  • The requester links GitHub after Junior opens the PR, so the request at open and the request on ready_for_review had no login to ask.
  • The request at open or on ready_for_review fails. Both only log a warning.

inLimbo in pull-request-action.ts decides it. A PR is in limbo when its derived action is none and all of these are true:

  • It is open, not a draft, and auto-merge is off.
  • No review ask for the requester is open: GitHub does not ask them, and no comment-only review keeps an ask open (see 2).
  • The requester has not commented, approved, or requested changes since the last push.
  • No reviewer approved it, so it does not wait only on others, and no reviewer requests changes, so Junior does not act next.
  • The requester did not remove their own review request since the last ask (see 3).

A pending request for another person or a team does not take a PR out of limbo. It asks nothing of the requester.

When a PR is in limbo and the base branch's required checks pass, the sync asks for the requester's review. A webhook asks only a requester who has not commented or reviewed, so a push never asks again. The one-off backfill also asks one who acted before the last push (askAfterRequesterActed). Review-again already reads the required checks, so that reader is now shared as readGitHubRequiredChecksPass. Until the checks pass, each check_suite webhook syncs again. An ask counts only once Junior sends it, so a later check in the same sync can still ask. Each limbo sync costs one more GraphQL read and one REST branch-rules read until the requester is asked.

2. A comment-only review is not an answer

A comment-only review neither approves nor requests changes, but GitHub drops the pending request on it. GitHub also records a reply in a review thread as a comment-only review. Now the ask stays open (askStaysOpen): the requester was asked, then left a comment-only review, and has not approved, requested changes, or removed their own request since. While the ask is open:

  • The derivation treats the requester as asked, so the PR keeps its "Review requested" item until they approve or request changes.
  • The limbo check counts the ask as pending, so Junior sends no new GitHub request.

A plain PR comment still means Junior acts next, as before. A change request still follows the review-again flow.

3. A removed request stays removed

The requester can remove their own review request. GitHub records this as a review_request_removed timeline event with the requester as both actor and reviewer. After that, neither the backfill nor a webhook asks them again, until someone asks them again on GitHub. If another person removes the request, it does not count. The next-action read now includes ReviewRequestRemovedEvent in its timeline.

design/github.md

This PR adds the rule text that BYK confirmed:

  • The change-request bullet now reads "When the requester comments, approves, or requests changes, Junior acts next, and the Inbox stops asking."
  • "A comment-only review is not an answer to a review ask. The ask stays open: the PR keeps asking the requester to review in the Inbox, and Junior does not ask again on GitHub."
  • "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. A push does not ask a requester who has already reviewed or commented."
  • "When the requester removes their own review request, Junior does not ask them again until someone asks them again on GitHub."

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 11:40pm UTC

Request Review

@sentry-junior sentry-junior Bot changed the title feat(github): Ask the requester's review when a ready PR waits on nobody feat(github): Keep a review ask on ready Junior PRs until the requester answers Nov 25, 2026
@sentry-junior
sentry-junior Bot force-pushed the junior/pr-action-limbo-asks branch from 03ad366 to bbe9f83 Compare November 25, 2026 15:22
@sentry-junior
sentry-junior Bot changed the base branch from junior/pr-action-backfill to junior/pr-action-sync-retry November 25, 2026 15:24
@sentry-junior
sentry-junior Bot added this pull request to stack #4307 November 25, 2026 15:24
@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 25, 2026 21:16
@sentry-junior
sentry-junior Bot requested a review from BYK November 25, 2026 21:16
@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 a038a18. Configure here.

Comment thread design/github.md Resolved
@blacksmith-sh

This comment has been minimized.

sentry-junior Bot and others added 9 commits November 25, 2026 23:31
Once the required checks pass, each pull request sync asks for the
requester's review on GitHub when the pull request is in limbo and the
requester has not reviewed or commented on it. This covers a pull request
opened before the requester linked GitHub, and one whose review request
at open or ready failed. Pushes still do not ask a requester who reviewed
or commented again; only the one-off backfill does.

The required-checks read moves out of the review-again read so both use
it.

Co-Authored-By: BYK <[email protected]>
…-removal

A requester's comment-only review neither approves nor requests changes,
so it does not answer the review ask. GitHub drops the request on it, and
the sync now asks for the requester's review again at once. The limbo
check no longer counts a comment-only review as the requester's answer.
A plain comment still means Junior acts next.

When the requester removed their own review request and no one asked them
since, neither the backfill nor a webhook asks them again. The next-action
read now includes the review request removals on the timeline.

Co-Authored-By: BYK <[email protected]>
A ready PR that waits only on a team's review asks nothing of its
requester, so the limbo ask requests their review too.

Co-Authored-By: BYK <[email protected]>
A comment-only review is neither yes nor no, so it does not answer the
requester's review ask, though GitHub drops the request on it. The ask
stays open: the PR keeps its Review requested item, the limbo check
counts the ask as pending, and Junior sends no new GitHub request.

Co-Authored-By: BYK <[email protected]>
…er answers

Add the rules that BYK confirmed: a comment-only review is not an
answer, a ready Junior PR always asks its requester something, and a
self-removed review request stays removed.

Co-Authored-By: BYK <[email protected]>
A check that finds the required checks pending no longer stops a later
check of the same sync from asking, such as one for a webhook that
arrived during it.

Co-Authored-By: BYK <[email protected]>
The next-action test file passed the 1,000-line limit once the stack
added the sync retry tests below the limbo ones.

Co-Authored-By: BYK <[email protected]>
…eps the ask open

A clean merge state returned the merge action before the open ask was
checked, so another reviewer's approval could replace the requester's
review item with a merge item.

Co-Authored-By: BYK <[email protected]>
pull-request-action.ts passed the 1,000-line limit. The functions that
derive the next action and limbo from one GitHub read move to
pull-request-next-action.ts, unchanged.
@sentry-junior
sentry-junior Bot force-pushed the junior/pr-action-limbo-asks branch from 6b4a813 to 190a140 Compare November 25, 2026 23:40
@BYK
BYK merged commit 2b212b3 into main Nov 25, 2026
52 checks passed
@BYK
BYK deleted the junior/pr-action-limbo-asks branch November 25, 2026 23:56
BYK added a commit that referenced this pull request Nov 26, 2026
… request (#4398)

A comment-only review from the requester, such as a reply in a review
thread, used to leave the review ask open. The PR kept asking for a
review in the Inbox, and a clean PR could show "Ready to merge" while
Junior still had to answer. Now Junior handles that review like a change
request:

- The review ask closes, and the PR does not show as ready to merge
while Junior works on it (`requesterFeedback` in
`webhooks/pull-request-next-action.ts`).
- When Junior has marked every comment and the required checks pass, the
review-again flow asks the requester again. The Inbox item says "Every
comment on your review is handled." The feedback tool checks whether the
reviewer is the requester. Other reviewers keep the old rule: only their
latest change request counts.
- **Approval stands.** A comment after the requester approves, with no
new ask since, keeps the approval. The PR stays "Ready to merge", and an
approved held draft keeps `mark_ready`. A change request always counts.
- `askStaysOpen` is removed.

`request_review` (`requestRequesterReview` in
`tools/update-pull-request.ts`) now asks only a requester who has not
reviewed yet, or whose latest review was dismissed. The reviewer lookup
reads comment-only reviews too. After a comment-only review, the
review-again flow decides when to ask again. This supersedes
#4394.

`design/github.md` gets two lines that BYK confirmed:
- The comment-only line now says Junior handles a comment-only review
like a change request: the ask closes while Junior works, and Junior
asks again once it answers and the checks pass.
- The limbo line now starts: "A ready Junior PR always has an Inbox ask
(review or merge) or a pending GitHub review request for its requester."

This continues #4317, which merged before this change
was pushed.

<!-- 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 — 190a1407 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