feat(git-guards): block gh pr comment, enforce GraphQL review threads#56
feat(git-guards): block gh pr comment, enforce GraphQL review threads#56JacobPEvans merged 2 commits intomainfrom
Conversation
gh pr comment creates top-level issue comments that cannot be resolved or tracked in PR reviews. Add DENY_GH list to git-permission-guard that blocks this command and directs to GitHub GraphQL API for proper review threads with file/line references. (claude)
Summary of ChangesHello @JacobPEvans, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to a0d5240 in 1 minute and 16 seconds. Click for details.
- Reviewed
53lines of code in1files - Skipped
0files when reviewing. - Skipped posting
0draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_9oGFqYVvtHdgGAKh
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Pull request overview
Adds a new gh command deny rule in the git permission guard to prevent creating untracked/unresolvable PR feedback via gh pr comment, and nudges contributors toward using review threads instead.
Changes:
- Introduces
DENY_GHwith a rule blockinggh pr commentand explaining preferred review-thread workflows. - Refactors
main()to computesub_tokensonce and reuse it for both deny and ask checks. - Enforces deny checks for
ghsubcommands prior to existingASK_GHchecks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable guard to block gh pr comment and guide users towards creating resolvable review threads using the GraphQL API. The refactoring to calculate sub_tokens only once is also a nice cleanup. I have a couple of suggestions to improve consistency with project conventions and enhance the robustness of the new logic.
…pty pattern guard - Remove redundant 'BLOCKED:' prefix from DENY_GH reason (deny() already prepends it) - Replace inline GraphQL examples with references to documented workflows to prevent staleness and flag inconsistency with repo conventions - Add `if tokens` guard in DENY_GH check to prevent empty-pattern match-all Co-Authored-By: Claude <noreply@anthropic.com>
|
Fixed in commit 70dcaee. Removed the leading 'BLOCKED: ' from the DENY_GH reason string — |
JacobPEvans
left a comment
There was a problem hiding this comment.
Fixed in commit 70dcaee. Added if tokens and guard before the slice comparison so an empty pattern string can't match all commands.
Summary
DENY_GHlist togit-permission-guard.pythat blocksgh pr comment— which creates top-level issue comments that cannot be resolved or tracked in PR reviewsaddPullRequestReview,addPullRequestReviewThreadReply,resolveReviewThread)sub_tokensonce before both DENY and ASK checks to avoid duplicationTest plan
gh pr comment 123 --body "test"→ deniedgh pr comment(bare) → deniedgh api graphql→ allowed (not blocked)gh pr close,gh pr merge→ ask (existing ASK_GH preserved)gh pr view,gh issue list→ allowedgit push --force→ ask (existing ASK_GIT preserved)ls -la→ allowed (non-git/gh early exit)🤖 Generated with Claude Code
Important
Adds
DENY_GHto blockgh pr commentand enforces GraphQL review threads ingit-permission-guard.py.DENY_GHlist ingit-permission-guard.pyto blockgh pr commentto enforce using GitHub GraphQL API for review threads.sub_tokensonce before both DENY and ASK checks to avoid duplication inmain()function.gh pr comment 123 --body "test"andgh pr comment(bare) are denied.gh api graphqland other non-git/gh commands are allowed.gh pr close,gh pr merge, andgit push --forceis preserved.This description was created by
for a0d5240. You can customize this summary. It will automatically update as commits are pushed.