feat: implement POST /pulls/{owner}/{repo}/{index}/review — approve, request-changes, and comment actions #96
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?
Description
The PR detail view (implemented in #60) renders a review form with a textarea and radio buttons for approve/request-changes/comment. The
SubmitReview()function is listed in the roadmap aggregation layer (ROADMAP.md Phase 1.4), but the end-to-end POST handler wiring needs to be verified and completed.What to Do
internal/gitea/client.gohas a workingSubmitReview(owner, repo string, index int, state, body string) errormethod using the Gitea SDKapproved,request_changes,commentgitea.ReviewStateApprove,gitea.ReviewStateRequestChanges,gitea.ReviewStateCommentPOST /pulls/{owner}/{repo}/{index}/reviewhandler ininternal/handlers/pulls.goreview_state(radio),review_body(textarea)client.SubmitReview()hx-postpointing at this handlerAcceptance Criteria
SubmitReview()method exists ininternal/gitea/client.goand compilesPOST /pulls/{owner}/{repo}/{index}/reviewhandler is registered in the muxRoadmap Reference
ROADMAP.md Phase 1.4 —
SubmitReview()in aggregation layerROADMAP.md Phase 1.5 —
POST /pulls/{owner}/{repo}/{index}/reviewrouteROADMAP.md Phase 2.2 — PR Detail view: "review form: textarea + radio (approve/request changes/comment) + submit"
Triage: Already Implemented
Code review shows this feature is already fully wired:
internal/gitea/client.golines 831-851):SubmitReview()exists, accepts owner, repo, index, reviewType (APPROVED/REQUEST_CHANGES/COMMENT), and body. Calls cache invalidation after write.internal/handlers/handlers.goline 57):POST /pulls/{owner}/{repo}/{index}/reviewis wired toh.SubmitReview.eventandbody, callsclient.SubmitReview(), returns HTMX inline response on success or redirects for non-HTMX.internal/templates/pull_detail.htmllines 37-58): Review form with textarea, radio buttons for all 3 states, andhx-postsubmission.All acceptance criteria are met. Closing as already complete.