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:
silverwind
2026-07-28 05:26:17 +00:00
committed by silverwind
parent 21aa4684d9
commit 80114e32e6
6 changed files with 285 additions and 23 deletions
+7 -1
View File
@@ -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 {