Repository navigation
fix(github): React to pull request review bodies - #3126
Merged
Merged
Conversation
Submitted reviews with a body get the webhook reviewing reaction, and github_updatePullRequestFeedback can mark them addressed or declined. GitHub has no REST reactions endpoint for a review body, so both use GraphQL addReaction and removeReaction on the review node. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
approved these changes
Nov 10, 2026
Member
|
To be clear it should handle any comments on a PR with a uniform behavior |
Contributor
|
214 screenshot changes — 0 changed · 214 added · 0 removed |
Conversation comments, inline review comments, and review bodies now share the same feedback guidance, and github_updatePullRequestFeedback requires pull_request for each kind. The tool checks that the bot authored that pull request and that the comment is on it.
dcramer
added a commit
that referenced
this pull request
Nov 11, 2026
…3136) Cleanup for #3126, which merged before this pass landed. **Problem:** #3126 gave review bodies their own reaction path. It duplicated the REST list, replace, and add logic in a GraphQL helper. It found Junior's reactions through `viewerHasReacted`, which depends on the credential that egress picks, while REST comments match the bot user id. It also made `reaction_id` optional and added a tool error baseline entry for the new GraphQL throw. **Fix:** - `github_updatePullRequestFeedback` runs one flow for every comment kind: list the bot's reactions, remove its stale state reaction, and add the new one. Only the GitHub calls differ: REST for conversation and inline review comments, GraphQL for review bodies. The existing lookup, removal, and creation errors cover both, so the baseline entry is gone. - Review bodies find Junior's reactions through `reactionGroups.reactors` with `Bot.databaseId`, the same bot user id that REST comments use. - The tool output drops `reaction_id`. GraphQL gives no id for an existing reaction, and no caller reads it. - The webhook shares the REST-to-GraphQL reaction name map with the tool and reports GraphQL error messages. - I removed a guidance assertion in `github-plugin.test.ts` that the event automation snapshot already covers. **Remaining risk:** the GraphQL calls are tested only against fakes. `Bot.databaseId` should equal the REST bot user id, but no live call has checked this. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A0f0c2da6c27982200b4d351cdb09043e --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A0f0c2da6c27982200b4d351cdb09043e) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A0f0c2da6c27982200b4d351cdb09043e/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[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.
Review summaries got no 👀. David's review bodies on #3111, #3109, and #3091 have no reaction, but his conversation comment on #3108 does.
Root cause:
pullRequestFeedbackTargetmarked onlypull_request.comment.createdandpull_request.review_comment.created. Review events set nocommentIdorcommentKind. GitHub also has no REST reactions endpoint for a review body.Fix: every comment on a pull request now gets the same behavior: conversation comments, inline review comments, and review bodies.
commentId(the review id) andcommentKind: "review_body"on its event data.review.commented, and it gets one reaction. Forreview_body, the webhook reads the review'snode_idand sends GraphQLaddReaction(EYES).github_updatePullRequestFeedbackwithrepo,pull_request,comment_id, andcomment_kindfrom Verified details.github_updatePullRequestFeedbackrequirespull_requestfor every kind. It checks that the bot authored that pull request and that the comment is on it, then replaces Junior's state reaction. Review bodies use GraphQLreactionGroups.viewerHasReacted,removeReaction, andaddReaction.reaction_idis now optional, because GraphQL gives no id for a reaction that already exists.AddReviewReactionandRemoveReviewReactiononly for the host operationgithub.pull.review-reaction.update:<repo>.Remaining risk: the GraphQL calls are tested only against fakes.
viewerHasReacteddepends on the installation credential that the egress read grant picks today. The webhook adds one REST read for each review with a body.via @dcramer.
--
View Session [Sentry]