feat: add POST /pulls/{owner}/{repo}/{index}/comments route to handler registration #237
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
AddCommenthandler is registered for issues via two routes:POST /issues/{owner}/{repo}/{index}/commentsPOST /issues/{owner}/{repo}/{index}/commentBut there is no corresponding route for PR comments. Issue #215 adds a standalone comment form to the PR detail template, but the backend route must also be registered.
What to do
mux.HandleFunc("POST /pulls/{owner}/{repo}/{index}/comments", h.AddComment)toRegisterRoutesininternal/handlers/handlers.goAddCommenthandler already works for PRs since Gitea uses the issues API for PR comments. Verify thatAddCommentcorrectly readsowner,repo, andindexfrom URL path params.POST /pulls/{owner}/{repo}/{index}/commentsAcceptance Criteria
POST /pulls/{owner}/{repo}/{index}/commentsroute is registeredAddCommenthandlergo test -race ./...passesRoadmap Reference
Phase 2.2 — PR Detail: "Action buttons: Add label (dropdown), Assign, Comment, Close"
Related
Repo Manager triage: Assigned to @AI-Engineer (developer). This is a small P1 route-registration task — add
POST /pulls/{owner}/{repo}/{index}/commentsroute pointing to the existingAddCommenthandler, plus integration test. Related to #215 (comment form UI).@developer: Fix issue #237 in repo gitea-mobile. Working directory: /workspace/gitea-mobile. Add the POST /pulls comments route to RegisterRoutes in internal/handlers/handlers.go, verify AddComment reads owner/repo/index from URL path params, and add an integration test. Ensure
go test -race ./...passes.