-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: teach pr-fixer mode to resolve review threads via GitHub GraphQL API #11306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,12 +81,61 @@ | |
| </tool_use> | ||
| <analysis>Monitor checks continuously until all complete. The --watch flag provides real-time updates as check statuses change.</analysis> | ||
| </step> | ||
|
|
||
| <step number="7"> | ||
| <description>Fetch all review threads to find unresolved ones that were addressed.</description> | ||
|
Comment on lines
+85
to
+86
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ordering here contradicts Fix it with Roo Code or mention @roomote and request a fix. |
||
| <tool_use> | ||
| <execute_command> | ||
| <command><![CDATA[gh api graphql -f query=' | ||
| query($owner: String!, $repo: String!, $number: Int!) { | ||
| repository(owner: $owner, name: $repo) { | ||
| pullRequest(number: $number) { | ||
| reviewThreads(first: 100) { | ||
| nodes { | ||
| id | ||
| isResolved | ||
| isOutdated | ||
| comments(first: 1) { | ||
| nodes { | ||
| body | ||
| path | ||
| line | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }' -f owner=RooCodeInc -f repo=Roo-Code -F number=4365]]></command> | ||
| </execute_command> | ||
| </tool_use> | ||
| <analysis>Parse the output to identify unresolved threads. Match each thread's comment body and file path against the changes we just pushed to determine which threads were addressed.</analysis> | ||
| </step> | ||
|
|
||
| <step number="8"> | ||
| <description>Resolve each addressed review thread using the GraphQL mutation.</description> | ||
| <tool_use> | ||
| <execute_command> | ||
| <command><![CDATA[gh api graphql -f query=' | ||
| mutation($threadId: ID!) { | ||
| resolveReviewThread(input: {threadId: $threadId}) { | ||
| thread { | ||
| id | ||
| isResolved | ||
| } | ||
| } | ||
| }' -f threadId=PRT_kwDOExample123]]></command> | ||
| </execute_command> | ||
| </tool_use> | ||
| <analysis>Repeat for each thread that was addressed. Only resolve threads where the feedback was acted on. Leave threads unresolved if they are open questions or were intentionally not addressed.</analysis> | ||
| </step> | ||
| </workflow> | ||
|
|
||
| <key_takeaways> | ||
| <takeaway>Always gather all information before proposing a solution.</takeaway> | ||
| <takeaway>Use the GitHub CLI to get a complete picture of the PR's status.</takeaway> | ||
| <takeaway>The --watch flag on gh pr checks provides real-time monitoring of CI status.</takeaway> | ||
| <takeaway>After addressing review feedback, resolve the corresponding review threads on GitHub using the GraphQL API instead of just checking off checkboxes.</takeaway> | ||
| </key_takeaways> | ||
| </example> | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
review_thread_operationscommand group uses inline/hardcoded values in the GraphQL query string (e.g.,owner:"[owner]"), while every other GraphQL example in this PR -- including thefetch_threads_queryandresolve_thread_mutationelements in this same file -- uses parameterized GraphQL variables with-f/-Fflags. The parameterized approach handles type coercion properly (-Ffor Int), avoids shell quoting pitfalls, and is theghCLI's recommended pattern. Having both styles in the same file could lead the agent to copy the less robust inline approach from this quick-reference section.Fix it with Roo Code or mention @roomote and request a fix.