Skip to content

fix(github): Deny pull request approvals at egress - #1500

Merged
dcramer merged 5 commits into
mainfrom
feat/github-deny-pr-approvals
Aug 13, 2026
Merged

fix(github): Deny pull request approvals at egress#1500
dcramer merged 5 commits into
mainfrom
feat/github-deny-pr-approvals

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Junior can still request changes, leave comment reviews, and dismiss its own review. It can no longer greenlight a PR.

This blocks APPROVE at the GitHub egress grant gate for:

  • POST /repos/{owner}/{repo}/pulls/{n}/reviews
  • POST /repos/{owner}/{repo}/pulls/{n}/reviews/{id}/events

Core now inspects those REST bodies before credential grant, including oversized bodies, so an approve attempt cannot skip the check by omitting or bloating the payload. GraphQL mutations remain denied.

Verified:

  • pnpm --filter @sentry/junior-github exec vitest run tests/github-plugin.test.ts -t "pull request review|denies GitHub pull request approvals"
  • pnpm --filter @sentry/junior exec vitest run tests/integration/sandbox-egress-proxy.test.ts -t "denies oversized raw GitHub"
  • lint, typecheck, and file-length checks for the touched packages

Requested by David Cramer.

--

View Junior Session [Sentry]

Block APPROVE on review create/submit while still allowing request-changes, comment reviews, and dismissals. Inspect review REST bodies before credential grant so oversized approve attempts cannot skip the check.

Co-Authored-By: David Cramer <david@sentry.io>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Aug 13, 2026 1:11am

Request Review

@dcramer
dcramer marked this pull request as ready for review August 13, 2026 00:21
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Aug 13, 2026
Co-Authored-By: David Cramer <david@sentry.io>

@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 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 8bad228. Configure here.

Comment thread packages/junior-github/src/plugin.ts Outdated
Require parseable JSON review bodies on POST /reviews so form-encoded or malformed APPROVE payloads cannot skip the no-approve gate. Empty create bodies remain allowed for pending reviews.
Comment thread packages/junior/src/chat/egress/credentialed.ts
Stop skipping GitHub body inspection when an operation is set. Plugin-tool egress always carries an operation, and that short-circuit let APPROVE create-review requests bypass the no-approve gate.
Bring in #1501's owned issue/PR update routing while keeping the no-approve review firewall. Run the review denial before owned-operation early returns, and keep plugin.ts under the line limit via a focused review-policy module.

Co-Authored-By: David Cramer <david@sentry.io>

@dcramer dcramer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we definitely have to move all this github stuff out of core and into the plugin

@dcramer
dcramer merged commit 954a78b into main Aug 13, 2026
38 checks passed
@dcramer
dcramer deleted the feat/github-deny-pr-approvals branch August 13, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant