Skip to content

feat(github): Set PR feedback reactions with github_updatePullRequestFeedback - #1781

Merged
dcramer merged 8 commits into
mainfrom
feat/github-pull-request-feedback-reactions
Sep 4, 2026
Merged

dcramer merged 8 commits into
mainfrom
feat/github-pull-request-feedback-reactions

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Closes #1780.

Adds github_updatePullRequestFeedback so Junior can mark its own review-feedback progress with GitHub reactions instead of only text replies.

  • repo, commentKind (conversation | review), commentId, status (reviewing | addressed | declined).
  • Maps status to a reaction: reviewing → eyes, addressed → +1, declined → -1 (GitHub has no checkmark reaction).
  • Lists existing reactions, removes only Junior's own prior status reaction (never touches human reactions), and is a no-op if the target reaction already exists.
  • Conversation comments use /repos/{owner}/{repo}/issues/comments/{id}/reactions; inline review comments use /repos/{owner}/{repo}/pulls/comments/{id}/reactions — GitHub has no shared path.
  • Egress policy now grants installation-write for POST/DELETE on both reaction routes; reads already fall through the existing default-read grant.
  • Resolving the review thread stays a separate call to the existing github_resolvePullRequestReviewThread tool; this tool only owns the reaction.
  • Updated github-code skill docs (SKILL.md, api-surface.md, troubleshooting-workarounds.md) to route agents to the new tool.

Tests: packages/junior-github/tests/update-pull-request-feedback.test.ts (fresh reaction, review-comment path, replace-without-touching-human-reaction, idempotent no-op). pnpm --filter @sentry/junior-github vitest suite (106 tests) and tsc --noEmit pass; oxlint clean.

Requested by David Cramer.

--

View Junior Session [Sentry]

@vercel

vercel Bot commented Sep 4, 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 Sep 4, 2026 8:46pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Sep 4, 2026
@github-actions github-actions Bot added risk: high PR risk score: high and removed risk: medium PR risk score: medium labels Sep 4, 2026
The tool-error-classification check flags new plain Error throws in
tool code. The four throws in updatePullRequestFeedback are HTTP
failures and a missing bot-identity config check, matching the
established system-failure convention already used by sibling
GitHub tools (get-release, resolve-pull-request-review-thread,
update-issue, update-pull-request).

@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 and found 2 potential issues.

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 a15bee3. Configure here.

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A few things need tightening before this lands:

  • createGitHubWebhookRoute reacts whenever normalization produces a PR comment event, even when no resource subscription or event task matches. That means every comment across the installation—including bot status comments—gets 👀. The requested contract is to react only when the event is delivered into a conversation. Add a provider-neutral preflight/match result at the resource-event boundary, then react only when there is a consumer.
  • The reaction tool filters by bot user, then deletes every non-target reaction from that bot. This can remove unrelated Junior reactions such as ❤️ or 🚀, despite the stated contract that it replaces only feedback-status reactions. Restrict stale reactions to eyes, +1, and -1.
  • The reaction call is awaited before publishing, so a missing credential, permission error, rate limit, or transient GitHub failure drops the resource event entirely. This is visible in the current component failure: the webhook returns 500 because GITHUB_APP_ID is absent instead of delivering the subscribed event. The reaction should be best-effort or otherwise must not prevent resource-event delivery; add coverage for that failure path.

Also add the promised race coverage where 👀 is listed but its DELETE returns 404, and the terminal reaction is still created.

@dcramer
dcramer merged commit ae8aa27 into main Sep 4, 2026
56 of 58 checks passed
@dcramer
dcramer deleted the feat/github-pull-request-feedback-reactions branch September 4, 2026 21:17

This branch was successfully deployed

1 active deployment
Preview – junior-docs — bba9e7a1 Deployed Sep 4, 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.

Track pull request feedback with reactions

1 participant