Repository navigation
fix(github): Ask to merge only a requester with write access - #4472
Merged
Merged
Conversation
Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…rge ask Co-Authored-By: BYK <[email protected]>
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 399f6a9. Configure here.
BYK
approved these changes
Nov 26, 2026
This was referenced Nov 26, 2026
BYK
pushed a commit
that referenced
this pull request
Nov 26, 2026
…rule (#4476) #4472 gives no merge ask to a requester without write access, but only a webhook sync applies the rule. A quiet pull request whose "Ready to merge" item went to such a requester, like getsentry/shepherd#30, keeps the item until its next GitHub event, which can be never. The one-off backfill re-derives the next action of every open Junior pull request, and `pull-request-action-backfill.ts` says to bump `VERSION` when a new rule must reach quiet pull requests. This bumps it to `v2`, so the heartbeat runs the backfill once more. The sync changes an item only when the derived action is not the saved one, so most pull requests keep their items. A stale merge item closes. Where the requester has not reviewed yet, it becomes a review ask. v1 also asked in limbo where the requester had acted before the last push, to bring limbo asks to quiet pull requests. v2 only brings the merge access rule, so `ASK_AFTER_REQUESTER_ACTED` is off and it asks in limbo as a webhook does. A requester who already reviewed or commented gets no new GitHub review request. Cursor Bugbot found the missing rerun on #4472 after it merged. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3Aa0d5d9396e47d3c04ab85406 --> -- [View Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3Aa0d5d9396e47d3c04ab85406) [[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3Aa0d5d9396e47d3c04ab85406/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
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.

The next-action sync gave the requester a "Ready to merge" item based only on PR state: open, not a draft, auto-merge off,
mergeStateStatusCLEAN, no pending review, no change request. It never checked whether the requester can merge on the repo. Two cases hit @BYK, whose role isreadon both repos. Neither repo requires a review, so GitHub reportsCLEAN:Now
nextActiontakes amergeAccessinput for the requester, and a requester without it gets no merge ask:The access comes from
GET /repos/{owner}/{repo}/collaborators/{login}/permission. It is read with a metadata-only installation token and kept in the plugin cache for 10 minutes. This is the read thatloadRepositoryRolealready does. Both now share one cache entry that holds GitHub's basepermission(admin, write, read, or none) androle_name. Write and admin can merge, and maintain and custom roles map to one of them. I did not use the requester's own token because the sync runs from webhooks and tasks that have none. The endpoint answers for the login, so the App token is enough. A sync reads the access only when the action would be merge or the saved action is merge, so most recomputes read nothing. Nothing is written to tables.The Inbox label comes from the item title, so the dashboard needs no change.
design/github.mdnow states the write-access rule, in the text that @BYK confirmed.For #4395: the generated
github:pull_requesttable needs a new requester input,mergeAccess. It gates the merge rows in the same way ascanMergeinpull-request-next-action.ts. The sync gets it from the cached permission read above.via @BYK.
--
View Session [Sentry]