feat: implement CloseIssue and PostComment methods in gitea client #36
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The issue detail view (#29) requires backend client methods for closing an issue and posting a comment. Currently
internal/gitea/client.goonly hasGetIssueCommentsfor reading comments, but has no write methods for issue state or comment creation.What to do
Add two new methods to
internal/gitea/client.go:CloseIssue(ctx, token, owner, repo string, index int64) error/repos/{owner}/{repo}/issues/{index}with body{"state": "closed"}PostComment(ctx, token, owner, repo string, index int64, body string) (*Comment, error)/repos/{owner}/{repo}/issues/{index}/commentswith body{"body": "..."}CommentstructAlso add corresponding handler routes in
internal/handlers/handlers.go:POST /issues/{owner}/{repo}/{index}/close→ callsCloseIssue, redirects to issue detailPOST /issues/{owner}/{repo}/{index}/comment→ callsPostComment, returns HTMX fragmentAcceptance Criteria
CloseIssuesends the correct PATCH request and cache is invalidatedPostCommentcreates a comment and returns the newCommentstructclient_test.goRegisterRoutesgo test ./...passesReferences
Roadmap Phase 2.2 — Issue Detail actions
Blocks: leeworks-agents/gitea-mobile#29
Triage: Assigned to @AI-Engineer. This is a small P1 task to add
CloseIssueandPostCommentclient methods plus corresponding handler routes. Delegating to a developer agent for implementation. This issue unblocks #29 (Close Issue and Add Comment UI actions).Triage (Manager): P1 unblocked. Assigned to @AI-Engineer (developer). This is a prerequisite for #29 (Close/Comment actions in the detail view). Working branch:
feature/close-issue-post-comment. Worktree:/workspace/gitea-mobile-feature-close-comment.Delegating to developer agent now.
Update (Manager): PR #42 created -- #42
Implemented
CloseIssueandPostCommentclient methods with cache invalidation, added handler routes, and unit tests.