fix(settings): require only pull_requests:read for PR comment/label output#434
Merged
JSONbored merged 2 commits intoJun 6, 2026
Conversation
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
JSONbored
approved these changes
Jun 6, 2026
Owner
JSONbored
left a comment
There was a problem hiding this comment.
@philluiz2323 this is the right direction.
A few notes:
- The preview now matches the intended app boundary: PR metadata is read, while comment/label output depends on Issues write.
- The test update captures the exact permission split that regressed.
- This resolves the #433 issue cleanly and avoids asking maintainers for broader PR-write scope than needed.
- No code changes requested.
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.
Summary
src/signals/settings-preview.tscontradicted itself on the GitHub App permissions a repo needs to publish PR comments/labels. Two PRs reached opposite conclusions and both merged:fix(github-app): avoid PR write overprivilege) established that PR comments/labels use GitHub Issues endpoints (needissues: write) and the app only reads PRs, so it setREQUIRED_INSTALLATION_PERMISSIONS.pull_requests = "read"and rewrotebuildWarningsto require onlyissues: write.pull_requests: write.The result was a live self-contradiction:
buildWarnings: "Comments and labels use GitHub Issues endpoints and require GitHub App permission Issues: write".requiredInstallPermissions: listedpull_requests: writefor comment/label, with a comment claiming it "matches REQUIRED_INSTALLATION_PERMISSIONS" -- which now readspull_requests: read, making the comment provably false.activeMissingPermissions: flagged a missingpull_requestspermission as a comment/label blocker.So the maintainer permission checklist (
installPreview.permissions.required/.missing) told maintainers to grantpull_requests: write-- a scope the app never uses -- re-introducing exactly the overprivilege #427 removed, and disagreeing with the same preview's warning text and the app's declared baseline. Closes #433.Scope
src/signals/settings-preview.ts:requiredInstallPermissions-- keeppull_requests: readas the baseline (nowriteupgrade); comment/label outputs addissues: write(unchanged). Replaced the now-false "gated on the Pull requests permission (write)" comment.activeMissingPermissions-- drop themissing.has("pull_requests")check for comment/label output; keep theissues/checkschecks, mirroringbuildWarnings.REQUIRED_INSTALLATION_PERMISSIONS(pull_requests: read) and fix(github-app): avoid PR write overprivilege #427.test/unit/settings-preview.test.ts:pull_requests: read(waswrite).pull_requestsbut withissues: writegranted listspull_requests: read(notwrite) inrequiredand is not flagged as missingpull_requestsfor comment/label output.Validation
npx tsc --noEmit-- clean.npx vitest run test/unit/settings-preview.test.ts test/integration/api.test.ts-- 48/48 (the fix(github-app): avoid PR write overprivilege #427 assertions ofpull_requests: readnow pass alongside these).mcp-clitimeout that passes in isolation).Safety
installPreview.permissionskeeps the same fields; only the (now correct)pull_requestslevel changes, and only for comment/label-output previews.Notes
This reverts the source change from #420, which had landed after #427 and reached the opposite conclusion on the same question; #427's overprivilege decision is the authoritative one.