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

[Reply To Review Comments] Add reply_to_review_comment tool for threaded PR review responses#1443

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

Open
lossyrob wants to merge22 commits intogithub:main
base:main
Choose a base branch
Loading
fromlossyrob:feature/reply-to-review-comments
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
22 commits
Select commitHold shift + click to select a range
8bb523f
Add planning artifacts for reply-to-review-comments feature
lossyrobNov 19, 2025
bbab98d
Merge pull request #1 from lossyrob/feature/reply-to-review-comments_…
lossyrobNov 19, 2025
f5140d4
Add ReplyToReviewComment tool for replying to PR review comments
lossyrobNov 19, 2025
50910fa
Merge pull request #2 from lossyrob/feature/reply-to-review-comments_…
lossyrobNov 20, 2025
31c8768
Register ReplyToReviewComment tool in pull_requests toolset
lossyrobNov 20, 2025
d55854c
Update ImplementationPlan.md with Phase 2 commit hash
lossyrobNov 20, 2025
d2784b0
docs: clarify intentional variable shadowing in error handling
lossyrobNov 20, 2025
087774e
refactor: use responseBody to avoid variable shadowing
lossyrobNov 20, 2025
7289421
Merge pull request #3 from lossyrob/feature/reply-to-review-comments_…
lossyrobNov 20, 2025
8d6c3a9
Add comprehensive tests for ReplyToReviewComment tool
lossyrobNov 20, 2025
558d07d
Update ImplementationPlan.md - Phase 3 complete
lossyrobNov 20, 2025
dbfa30b
docs: add Phase 3 PR link to ImplementationPlan.md
lossyrobNov 20, 2025
01f9323
test: remove E2E test - unit tests provide sufficient coverage
lossyrobNov 20, 2025
540f87f
Merge pull request #4 from lossyrob/feature/reply-to-review-comments_…
lossyrobNov 20, 2025
ef35315
Generate documentation and complete Phase 4 validation
lossyrobNov 20, 2025
bc5e8a7
Merge pull request #5 from lossyrob/feature/reply-to-review-comments_…
lossyrobNov 20, 2025
7248261
Add comprehensive documentation for reply_to_review_comment tool
lossyrobNov 20, 2025
44e7f0f
Merge pull request #6 from lossyrob/feature/reply-to-review-comments_…
lossyrobNov 20, 2025
80dca50
Add manual testing guide.
lossyrobNov 20, 2025
b15f134
Remove .paw directory, as project isn't using PAW directly.
lossyrobNov 20, 2025
68546f8
Merge branch 'main' into feature/reply-to-review-comments
lossyrobNov 25, 2025
572fe53
Merge branch 'main' into feature/reply-to-review-comments
lossyrobNov 27, 2025
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
7 changes: 7 additions & 0 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1002,6 +1002,13 @@ Possible options:
-`pullNumber`: Pull request number (number, required)
-`repo`: Repository name (string, required)

-**reply_to_review_comment** - Reply to a review comment
-`body`: Reply text supporting GitHub-flavored Markdown (string, required)
-`comment_id`: Review comment ID from pull_request_read (number, required)
-`owner`: Repository owner (string, required)
-`pull_number`: Pull request number (number, required)
-`repo`: Repository name (string, required)

-**request_copilot_review** - Request Copilot review
-`owner`: Repository owner (string, required)
-`pullNumber`: Pull request number (number, required)
Expand Down
40 changes: 40 additions & 0 deletionspkg/github/__toolsnaps__/reply_to_review_comment.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
{
"annotations": {
"title": "Reply to a review comment",
"readOnlyHint": false
},
"description": "Reply to a review comment on a pull request. Use this to respond directly within pull request review comment threads, maintaining conversation context at specific code locations.",
"inputSchema": {
"properties": {
"body": {
"description": "Reply text supporting GitHub-flavored Markdown",
"type": "string"
},
"comment_id": {
"description": "Review comment ID from pull_request_read",
"type": "number"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"pull_number": {
"description": "Pull request number",
"type": "number"
},
"repo": {
"description": "Repository name",
"type": "string"
}
},
"required": [
"owner",
"repo",
"pull_number",
"comment_id",
"body"
],
"type": "object"
},
"name": "reply_to_review_comment"
}
92 changes: 92 additions & 0 deletionspkg/github/pullrequests.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1668,6 +1668,98 @@ func RequestCopilotReview(getClient GetClientFn, t translations.TranslationHelpe
}
}

// ReplyToReviewComment creates a tool to reply to a review comment on a pull request.
funcReplyToReviewComment(getClientGetClientFn,t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
returnmcp.NewTool("reply_to_review_comment",
mcp.WithDescription(t("TOOL_REPLY_TO_REVIEW_COMMENT_DESCRIPTION","Reply to a review comment on a pull request. Use this to respond directly within pull request review comment threads, maintaining conversation context at specific code locations.")),
mcp.WithToolAnnotation(mcp.ToolAnnotation{
Title:t("TOOL_REPLY_TO_REVIEW_COMMENT_USER_TITLE","Reply to a review comment"),
ReadOnlyHint:ToBoolPtr(false),
}),
mcp.WithString("owner",
mcp.Required(),
mcp.Description("Repository owner"),
),
mcp.WithString("repo",
mcp.Required(),
mcp.Description("Repository name"),
),
mcp.WithNumber("pull_number",
mcp.Required(),
mcp.Description("Pull request number"),
),
mcp.WithNumber("comment_id",
mcp.Required(),
mcp.Description("Review comment ID from pull_request_read"),
),
mcp.WithString("body",
mcp.Required(),
mcp.Description("Reply text supporting GitHub-flavored Markdown"),
),
),
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
owner,err:=RequiredParam[string](request,"owner")
iferr!=nil {
returnmcp.NewToolResultError(err.Error()),nil
}

repo,err:=RequiredParam[string](request,"repo")
iferr!=nil {
returnmcp.NewToolResultError(err.Error()),nil
}

pullNumber,err:=RequiredInt(request,"pull_number")
iferr!=nil {
returnmcp.NewToolResultError(err.Error()),nil
}

commentID,err:=RequiredBigInt(request,"comment_id")
iferr!=nil {
returnmcp.NewToolResultError(err.Error()),nil
}

body,err:=RequiredParam[string](request,"body")
iferr!=nil {
returnmcp.NewToolResultError(err.Error()),nil
}

client,err:=getClient(ctx)
iferr!=nil {
returnnil,fmt.Errorf("failed to get GitHub client: %w",err)
}

comment,resp,err:=client.PullRequests.CreateCommentInReplyTo(ctx,owner,repo,pullNumber,body,commentID)
iferr!=nil {
returnghErrors.NewGitHubAPIErrorResponse(ctx,
"failed to create reply to review comment",
resp,
err,
),nil
}
deferfunc() {_=resp.Body.Close() }()

ifresp.StatusCode!=http.StatusCreated {
responseBody,err:=io.ReadAll(resp.Body)
iferr!=nil {
returnnil,fmt.Errorf("failed to read response body: %w",err)
}
returnmcp.NewToolResultError(fmt.Sprintf("failed to create reply to review comment: %s",string(responseBody))),nil
}
// Return minimal response with just essential information
minimalResponse:=MinimalResponse{
ID:fmt.Sprintf("%d",comment.GetID()),
URL:comment.GetHTMLURL(),
}

r,err:=json.Marshal(minimalResponse)
iferr!=nil {
returnnil,fmt.Errorf("failed to marshal response: %w",err)
}

returnmcp.NewToolResultText(string(r)),nil
}
}

// newGQLString like takes something that approximates a string (of which there are many types in shurcooL/githubv4)
// and constructs a pointer to it, or nil if the string is empty. This is extremely useful because when we parse
// params from the MCP request, we need to convert them to types that are pointers of type def strings and it's
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp