mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2026-03-27 15:25:12 +00:00
Add missing ref and deadline fields to issue responses (#169)
## Summary ### Read (issue responses) - Add `ref` (branch) field to issue responses when non-empty - Add `deadline` (due_date) field to issue responses when non-nil - Applied to `slimIssue()`, `slimIssues()` in `operation/issue/slim.go` and `slimIssues()` in `operation/search/slim.go` ### Write (issue_write) - Add `ref` parameter to `issue_write` tool for both `create` and `update` methods - Allows setting the branch reference on issues via the MCP, consistent with the SDK's `CreateIssueOption.Ref` and `EditIssueOption.Ref` fields Fixes #168 ## Test plan - [ ] `go test ./...` passes - [ ] Verify `issue_read` returns `ref` when a branch is assigned to an issue - [ ] Verify `issue_read` returns `deadline` when a due date is set - [ ] Verify `list_issues` and `search_issues` include these fields - [ ] Verify `issue_write` with method `update` can set `ref` on an issue - [ ] Verify `issue_write` with method `create` can set `ref` on a new issue Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/169 Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com> Co-authored-by: pengu <jeremy@wenjy.fr> Co-committed-by: pengu <jeremy@wenjy.fr>
This commit is contained in:
@@ -63,6 +63,12 @@ func slimIssue(i *gitea_sdk.Issue) map[string]any {
|
||||
"title": i.Milestone.Title,
|
||||
}
|
||||
}
|
||||
if i.Ref != "" {
|
||||
m["ref"] = i.Ref
|
||||
}
|
||||
if i.Deadline != nil {
|
||||
m["deadline"] = i.Deadline
|
||||
}
|
||||
if i.PullRequest != nil {
|
||||
m["is_pull"] = true
|
||||
}
|
||||
@@ -88,6 +94,12 @@ func slimIssues(issues []*gitea_sdk.Issue) []map[string]any {
|
||||
if len(i.Labels) > 0 {
|
||||
m["labels"] = labelNames(i.Labels)
|
||||
}
|
||||
if i.Ref != "" {
|
||||
m["ref"] = i.Ref
|
||||
}
|
||||
if i.Deadline != nil {
|
||||
m["deadline"] = i.Deadline
|
||||
}
|
||||
out = append(out, m)
|
||||
}
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user