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

fix: shorten long tool name for adding pr review comments#697

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
LuluBeatson merged 5 commits intomainfromlulu/fix-long-name
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -589,7 +589,7 @@ The following sets of tools are available (all are on by default):

<summary>Pull Requests</summary>

-**add_pull_request_review_comment_to_pending_review** - Add comment to the requester's latest pending pull request review
-**add_comment_to_pending_review** - Add review comment to the requester's latest pending pull request review
-`body`: The text of the review comment (string, required)
-`line`: The line of the blob in the pull request diff that the comment applies to. For multi-line comments, the last line of the range (number, optional)
-`owner`: Repository owner (string, required)
Expand Down
12 changes: 6 additions & 6 deletionse2e/e2e_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1338,7 +1338,7 @@ func TestPullRequestReviewCommentSubmit(t *testing.T) {

// Add a file review comment
addFileReviewCommentRequest:= mcp.CallToolRequest{}
addFileReviewCommentRequest.Params.Name="add_pull_request_review_comment_to_pending_review"
addFileReviewCommentRequest.Params.Name="add_comment_to_pending_review"
addFileReviewCommentRequest.Params.Arguments=map[string]any{
"owner":currentOwner,
"repo":repoName,
Expand All@@ -1350,12 +1350,12 @@ func TestPullRequestReviewCommentSubmit(t *testing.T) {

t.Logf("Adding file review comment to pull request in %s/%s...",currentOwner,repoName)
resp,err=mcpClient.CallTool(ctx,addFileReviewCommentRequest)
require.NoError(t,err,"expected to call 'add_pull_request_review_comment_to_pending_review' tool successfully")
require.NoError(t,err,"expected to call 'add_comment_to_pending_review' tool successfully")
require.False(t,resp.IsError,fmt.Sprintf("expected result not to be an error: %+v",resp))

// Add a single line review comment
addSingleLineReviewCommentRequest:= mcp.CallToolRequest{}
addSingleLineReviewCommentRequest.Params.Name="add_pull_request_review_comment_to_pending_review"
addSingleLineReviewCommentRequest.Params.Name="add_comment_to_pending_review"
addSingleLineReviewCommentRequest.Params.Arguments=map[string]any{
"owner":currentOwner,
"repo":repoName,
Expand All@@ -1370,12 +1370,12 @@ func TestPullRequestReviewCommentSubmit(t *testing.T) {

t.Logf("Adding single line review comment to pull request in %s/%s...",currentOwner,repoName)
resp,err=mcpClient.CallTool(ctx,addSingleLineReviewCommentRequest)
require.NoError(t,err,"expected to call 'add_pull_request_review_comment_to_pending_review' tool successfully")
require.NoError(t,err,"expected to call 'add_comment_to_pending_review' tool successfully")
require.False(t,resp.IsError,fmt.Sprintf("expected result not to be an error: %+v",resp))

// Add a multiline review comment
addMultilineReviewCommentRequest:= mcp.CallToolRequest{}
addMultilineReviewCommentRequest.Params.Name="add_pull_request_review_comment_to_pending_review"
addMultilineReviewCommentRequest.Params.Name="add_comment_to_pending_review"
addMultilineReviewCommentRequest.Params.Arguments=map[string]any{
"owner":currentOwner,
"repo":repoName,
Expand All@@ -1392,7 +1392,7 @@ func TestPullRequestReviewCommentSubmit(t *testing.T) {

t.Logf("Adding multi line review comment to pull request in %s/%s...",currentOwner,repoName)
resp,err=mcpClient.CallTool(ctx,addMultilineReviewCommentRequest)
require.NoError(t,err,"expected to call 'add_pull_request_review_comment_to_pending_review' tool successfully")
require.NoError(t,err,"expected to call 'add_comment_to_pending_review' tool successfully")
require.False(t,resp.IsError,fmt.Sprintf("expected result not to be an error: %+v",resp))

// Submit the review
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
{
"annotations": {
"title":"Add comment to the requester's latest pending pull request review",
"title":"Addreviewcomment to the requester's latest pending pull request review",
"readOnlyHint":false
},
"description":"Adda comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure).",
"description":"Addreview comment to the requester's latest pending pull request review. A pending review needs to already exist to call this (check with the user if not sure).",
"inputSchema": {
"properties": {
"body": {
Expand DownExpand Up@@ -69,5 +69,5 @@
],
"type":"object"
},
"name":"add_pull_request_review_comment_to_pending_review"
"name":"add_comment_to_pending_review"
}
10 changes: 5 additions & 5 deletionspkg/github/pullrequests.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1151,12 +1151,12 @@ func CreatePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.
}
}

//AddPullRequestReviewCommentToPendingReview creates a tool to add a comment to a pull request review.
funcAddPullRequestReviewCommentToPendingReview(getGQLClientGetGQLClientFn,t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
returnmcp.NewTool("add_pull_request_review_comment_to_pending_review",
mcp.WithDescription(t("TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_TO_PENDING_REVIEW_DESCRIPTION","Adda comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure).")),
//AddCommentToPendingReview creates a tool to add a comment to a pull request review.
funcAddCommentToPendingReview(getGQLClientGetGQLClientFn,t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
returnmcp.NewTool("add_comment_to_pending_review",
mcp.WithDescription(t("TOOL_ADD_COMMENT_TO_PENDING_REVIEW_DESCRIPTION","Addreview comment to the requester's latest pending pull request review. A pending review needs to already exist to call this (check with the user if not sure).")),
mcp.WithToolAnnotation(mcp.ToolAnnotation{
Title:t("TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_TO_PENDING_REVIEW_USER_TITLE","Add comment to the requester's latest pending pull request review"),
Title:t("TOOL_ADD_COMMENT_TO_PENDING_REVIEW_USER_TITLE","Add review comment to the requester's latest pending pull request review"),
ReadOnlyHint:ToBoolPtr(false),
}),
// Ideally, for performance sake this would just accept the pullRequestReviewID. However, we would need to
Expand Down
6 changes: 3 additions & 3 deletionspkg/github/pullrequests_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2137,10 +2137,10 @@ func TestAddPullRequestReviewCommentToPendingReview(t *testing.T) {

// Verify tool definition once
mockClient:=githubv4.NewClient(nil)
tool,_:=AddPullRequestReviewCommentToPendingReview(stubGetGQLClientFn(mockClient),translations.NullTranslationHelper)
tool,_:=AddCommentToPendingReview(stubGetGQLClientFn(mockClient),translations.NullTranslationHelper)
require.NoError(t,toolsnaps.Test(tool.Name,tool))

assert.Equal(t,"add_pull_request_review_comment_to_pending_review",tool.Name)
assert.Equal(t,"add_comment_to_pending_review",tool.Name)
assert.NotEmpty(t,tool.Description)
assert.Contains(t,tool.InputSchema.Properties,"owner")
assert.Contains(t,tool.InputSchema.Properties,"repo")
Expand DownExpand Up@@ -2222,7 +2222,7 @@ func TestAddPullRequestReviewCommentToPendingReview(t *testing.T) {

// Setup client with mock
client:=githubv4.NewClient(tc.mockedClient)
_,handler:=AddPullRequestReviewCommentToPendingReview(stubGetGQLClientFn(client),translations.NullTranslationHelper)
_,handler:=AddCommentToPendingReview(stubGetGQLClientFn(client),translations.NullTranslationHelper)

// Create call request
request:=createMCPRequest(tc.requestArgs)
Expand Down
2 changes: 1 addition & 1 deletionpkg/github/tools.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -89,7 +89,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
// Reviews
toolsets.NewServerTool(CreateAndSubmitPullRequestReview(getGQLClient,t)),
toolsets.NewServerTool(CreatePendingPullRequestReview(getGQLClient,t)),
toolsets.NewServerTool(AddPullRequestReviewCommentToPendingReview(getGQLClient,t)),
toolsets.NewServerTool(AddCommentToPendingReview(getGQLClient,t)),
toolsets.NewServerTool(SubmitPendingPullRequestReview(getGQLClient,t)),
toolsets.NewServerTool(DeletePendingPullRequestReview(getGQLClient,t)),
)
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp