Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SamMorrowDrums merged 5 commits intogithub:mainfromaryasoni98:issues-374
May 14, 2025

Conversation

aryasoni98
Copy link
Contributor

@aryasoni98aryasoni98 commentedMay 9, 2025
edited by williammartin
Loading

Description

Closes:#374

This PR adds therequest_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.

@aryasoni98aryasoni98 requested a review froma team as acode ownerMay 9, 2025 09:45
@williammartinwilliammartinforce-pushed theissues-374 branch 3 times, most recently from762e9e1 to8098b49CompareMay 12, 2025 15:24
@williammartinwilliammartin changed the base branch frommain to343-remove-comments-from-create_pull_request_reviewMay 12, 2025 15:24
@williammartinwilliammartin changed the base branch from343-remove-comments-from-create_pull_request_review tomainMay 12, 2025 15:25
Copy link
Contributor

@CopilotCopilotAI left a 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.

  • IntroducesRequestCopilotReview handler and argument parsing
  • Registers the new tool inpkg/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
FileDescription
pkg/github/tools.goRegisterRequestCopilotReview in the server toolsets
pkg/github/pullrequests.goImplement tool schema, parsing, and GitHub API call
pkg/github/pullrequests_test.goAdd unit test forRequestCopilotReview
e2e/e2e_test.goAdd end-to-end test for Copilot review workflow
README.mdDocument the newrequest_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,

return mcp.NewToolResultError(err.Error()), nil
}

if _, _, err := client.PullRequests.RequestReviewers(
Copy link
Preview

CopilotAIMay 12, 2025

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.

@williammartin
Copy link
Collaborator

I just cleaned up the commits and force pushed a WIP commit (needs unit testing and probably also GHES considerations) that demonstrates this working. You can see that I requested a review on this PR via the MCP server.

image

Copy link
Contributor

@CopilotCopilotAI left a 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 newrequest_copilot_review tool in the main toolset
  • Implements the tool handler inpullrequests.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
FileDescription
pkg/github/tools.goRegister newRequestCopilotReview tool
pkg/github/pullrequests.goImplement tool handler and GitHub API call
pkg/github/pullrequests_test.goAdd unit tests for success and failure paths
pkg/github/helper_test.goIntroduceexpect helper andexpectations struct
e2e/e2e_test.goAdd full end-to-end test for Copilot review
README.mdDocument the newrequest_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 usespull_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)

@williammartinwilliammartinforce-pushed theissues-374 branch 3 times, most recently fromc193d38 to688f808CompareMay 13, 2025 12:19
Co-authored-by: Sam Morrow <sammorrowdrums@github.com>
SamMorrowDrums
SamMorrowDrums previously approved these changesMay 13, 2025
Copy link
Collaborator

@SamMorrowDrumsSamMorrowDrums left a 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>
@SamMorrowDrumsSamMorrowDrums merged commit7aced2b intogithub:mainMay 14, 2025
9 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@SamMorrowDrumsSamMorrowDrumsSamMorrowDrums approved these changes

@williammartinwilliammartinAwaiting requested review from williammartin

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add ability to request Copilot reviews via MCP
3 participants
@aryasoni98@williammartin@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp