-
Notifications
You must be signed in to change notification settings - Fork 837
Add ability to request Copilot reviews via MCP #387
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
Conversation
762e9e1
to
8098b49
Compare
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.
Pull Request Overview
Adds an experimental tool to request GitHub Copilot reviews on pull requests, registers it in the server toolset, and provides both unit and end-to-end tests along with documentation.
- Introduces
RequestCopilotReview
handler and argument parsing - Registers the new tool in
pkg/github/tools.go
- Adds unit test (
pullrequests_test.go
), e2e test (e2e_test.go
), and README entry
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/github/tools.go | Register RequestCopilotReview in the server toolsets |
pkg/github/pullrequests.go | Implement tool schema, parsing, and GitHub API call |
pkg/github/pullrequests_test.go | Add unit test for RequestCopilotReview |
e2e/e2e_test.go | Add end-to-end test for Copilot review workflow |
README.md | Document the new request_copilot_review tool |
Comments suppressed due to low confidence (2)
pkg/github/pullrequests.go:1294
- Parameter name 'pullNumber' is camelCase but other tools use snake_case (e.g. 'pull_number'). Rename to 'pull_number' in both the schema and parsing logic.
mcp.WithNumber("pullNumber",
e2e/e2e_test.go:493
- Test uses camelCase 'pullNumber' but the tool schema and other tests expect 'pull_number'. Update this to 'pull_number' for consistency.
"pullNumber": 1,
pkg/github/pullrequests.go
Outdated
return mcp.NewToolResultError(err.Error()), nil | ||
} | ||
|
||
if _, _, err := client.PullRequests.RequestReviewers( |
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.
When the GitHub API does not support requesting Copilot reviews (e.g. returns 404), you should catch that specific status and return a text result with an explanatory message ("requesting a Copilot review is not currently supported by the GitHub API") instead of propagating the raw error.
Copilot uses AI. Check for mistakes.
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.
Pull Request Overview
This PR adds support for requesting a GitHub Copilot review on pull requests via the MCP server, including registering the tool, implementing its handler, and covering it in unit and end-to-end tests.
- Registers a new
request_copilot_review
tool in the main toolset - Implements the tool handler in
pullrequests.go
and adds unit tests - Adds an E2E test for the Copilot review flow and updates the README
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
pkg/github/tools.go | Register new RequestCopilotReview tool |
pkg/github/pullrequests.go | Implement tool handler and GitHub API call |
pkg/github/pullrequests_test.go | Add unit tests for success and failure paths |
pkg/github/helper_test.go | Introduce expect helper and expectations struct |
e2e/e2e_test.go | Add full end-to-end test for Copilot review |
README.md | Document the new request_copilot_review tool |
Comments suppressed due to low confidence (2)
pkg/github/pullrequests.go:1268
- Parameter names in other tools use snake_case (e.g.
pull_number
). To maintain consistency across the API, this should be renamed topull_number
.
mcp.WithNumber("pullNumber",
README.md:461
- The README uses
pull_number
but the tool’s schema and tests expectpullNumber
. Update the docs to match the actual input name or align the code/schema to the documented name.
- - `pull_number`: Pull request number (number, required)
c193d38
to
688f808
Compare
Co-authored-by: Sam Morrow <sammorrowdrums@github.com>
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.
A few minor comments, and a description I haven't tested manually yet.
Co-authored-by: Sam Morrow <sammorrowdrums@github.com>
Co-authored-by: Sam Morrow <sammorrowdrums@github.com>
Description
Closes: #374
This PR adds the
request_copilot_review
tool, which...requests reviews from copilot on PRs where possible. It is an MVP implementation that doesn't try to do anything particularly clever around only exposing the tool for hosts that support it, or playing nice with various error messages that might come back.