Skip to content

fix(github-app): authorize PR panel reruns - #515

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-pr-rerun-checkbox-authorization-issue
Jun 10, 2026
Merged

fix(github-app): authorize PR panel reruns#515
JSONbored merged 1 commit into
mainfrom
codex/fix-pr-rerun-checkbox-authorization-issue

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Close an authorization gap that allowed any non-bot user who can edit the bot-authored PR panel comment to trigger public-surface publishing with the app installation token.
  • Ensure PR panel manual reruns obey the same review-now/command-authorization policy used for mention commands so only authorized maintainers/collaborators (or allowed PR authors) can trigger public side effects.

Description

  • Add getRepositoryCollaboratorPermission helper in src/github/app.ts which queries the repository collaborator permission for a given login using an installation token.
  • Gate the PR panel rerun path in src/queue/processors.ts by resolving the editing actor's repo association via resolvePrPanelRetriggerActorAssociation, running the existing isAuthorizedCommandActor (policy: review-now), and skipping with audit/usage records when unauthorized.
  • Keep prior behavior for bot senders and missing context, and preserve the normal public-surface flow for authorized invocations; only add the permission lookup and authorization decision before calling maybePublishPrPublicSurface.
  • Add/adjust unit test coverage in test/unit/queue.test.ts to assert both an authorized maintainer rerun and a denied low-permission rerun are handled and audited correctly.

Testing

  • Ran the modified unit tests with npx vitest run test/unit/queue.test.ts --reporter=verbose, which passed (51 tests in the file) including the new unauthorized rerun test.
  • Ran type-checking with npm run typecheck, which succeeded.
  • Attempted full CI npm run test:ci, but it was blocked in this environment because actionlint hit transient DNS errors and the coverage step failed due to a missing local dependency (semver/functions/gte) required by Istanbul/make-dir (external/tooling issue), so test:ci could not complete here.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 6e08f1e Commit Preview URL

Branch Preview URL
Jun 10 2026, 08:49 AM

@dosubot dosubot Bot added the size:M label Jun 9, 2026
@github-actions github-actions Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 9, 2026
@ghost

ghost commented Jun 9, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #515 is no longer open. No action.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 9, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored
JSONbored force-pushed the codex/fix-pr-rerun-checkbox-authorization-issue branch from 939cc58 to 6e08f1e Compare June 10, 2026 08:48
@JSONbored
JSONbored merged commit 7f0f6db into main Jun 10, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/fix-pr-rerun-checkbox-authorization-issue branch June 10, 2026 08:50
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 10, 2026
@JSONbored JSONbored added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant