mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2026-08-03 15:49:23 +02:00
feat(pull): reply to and resolve review comments (#220)
Adds `reply_comment`, `resolve_thread` and `unresolve_thread` to `pull_request_review_write`, using the endpoints from https://github.com/go-gitea/gitea/pull/36683 and https://github.com/go-gitea/gitea/pull/36441 (SDK v1.2.0, no dependency change). `review_id` is now optional for `pull_request_read` `get_review_comments`, so finding a comment to reply to takes one call instead of one per review. Review comments gained `review_id` and `resolved_by`. Fixes https://gitea.com/gitea/gitea-mcp/issues/129 Verified against gitea.com (1.27.0+dev). Written by Claude (Opus 5). Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/220 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -137,8 +137,9 @@ func slimReviewComment(c *gitea_sdk.PullReviewComment) map[string]any {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return map[string]any{
|
||||
m := map[string]any{
|
||||
"id": c.ID,
|
||||
"review_id": c.ReviewID,
|
||||
"body": c.Body,
|
||||
"path": c.Path,
|
||||
"position": c.LineNum,
|
||||
@@ -149,6 +150,11 @@ func slimReviewComment(c *gitea_sdk.PullReviewComment) map[string]any {
|
||||
"created_at": c.Created,
|
||||
"updated_at": c.Updated,
|
||||
}
|
||||
// the thread's first comment carries the resolver
|
||||
if c.Resolver != nil {
|
||||
m["resolved_by"] = slim.UserLogin(c.Resolver)
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
func slimReviewComments(comments []*gitea_sdk.PullReviewComment) []map[string]any {
|
||||
|
||||
Reference in New Issue
Block a user