Repository navigation
fix(github): Sync a PR's next action again after GitHub fails the read - #4316
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
sentry-junior
Bot
force-pushed
the
junior/pr-action-sync-retry
branch
from
November 25, 2026 15:20
8250573 to
a2fd9c5
Compare
sentry-junior
Bot
force-pushed
the
junior/pr-action-sync-retry
branch
from
November 25, 2026 19:07
a2fd9c5 to
f12806f
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 3d02b60. Configure here.
BYK
approved these changes
Nov 25, 2026
sentry-junior
Bot
force-pushed
the
junior/pr-action-sync-retry
branch
from
November 25, 2026 22:28
3d02b60 to
6727f86
Compare
sentry-junior
Bot
force-pushed
the
junior/pr-action-sync-retry
branch
from
November 25, 2026 22:42
6727f86 to
d5a0561
Compare
sentry-junior
Bot
force-pushed
the
junior/pr-action-sync-retry
branch
from
November 25, 2026 23:13
b50b9ff to
a070da0
Compare
The webhook next-action sync failed in bursts when the installation ran out of GraphQL rate limit (RATE_LIMIT with HTTP 200, a ZodError before #4122). GitHub does not send a failed webhook again, so a quiet pull request kept its stale action and Inbox item until its next webhook. A rate limit, a GraphQL error without a type, or a GitHub 5xx now starts a task that syncs the pull request again. After a rate limit, the task waits until the GraphQL limit resets. Other failures are logged as before. Co-Authored-By: BYK <[email protected]>
Co-Authored-By: BYK <[email protected]>
…gnature lifetime Co-Authored-By: BYK <[email protected]>
… rate limit again Co-Authored-By: BYK <[email protected]>
sentry-junior
Bot
force-pushed
the
junior/pr-action-sync-retry
branch
from
November 25, 2026 23:40
a070da0 to
776c8f5
Compare
BYK
added a commit
that referenced
this pull request
Nov 25, 2026
…er answers (#4317) 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." <!-- 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]>
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.

GitHub returns GraphQL errors with HTTP 200 and no data, mostly
RATE_LIMITwhen the installation runs out of GraphQL points. These errors failed the webhook next-action sync in bursts (JUNIOR-17B, JUNIOR-1DG). A failed sync keeps the old saved action, and GitHub does not send a failed webhook again. So a quiet pull request kept a stale action and Inbox item until its next webhook.Now three kinds of failure start a
syncPullRequestActionstarted task that syncs the pull request again: a GraphQL rate limit, a GraphQL error with no type (GitHub's own failure), and a GitHub 5xx. The plugin task queue retries the task with backoff a limited number of times. Nothing polls.GET /rate_limit, which does not count against the limit.GitHubGraphqlErrorcarries GitHub's errortypes.startedTaskSyncContext.design/github.mdgets the rule: when GitHub fails the next-action read for a while, Junior syncs the pull request again after the rate limit resets.via @BYK.
--
View Session [Sentry]