feat: add POST /pulls/{owner}/{repo}/{index}/labels route to handler registration #236
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
ApplyLabelshandler is registered for issues (POST /issues/{owner}/{repo}/{index}/labels) but there is no corresponding route for PR labels. Issue #216 adds label action forms to the PR detail view but the backend route is missing.What to do
mux.HandleFunc("POST /pulls/{owner}/{repo}/{index}/labels", h.ApplyLabels)toRegisterRoutesininternal/handlers/handlers.goApplyLabelshandler already works generically for both issues and PRs via the Gitea API (Gitea treats PRs as issues for label operations), so no new handler logic is neededAcceptance Criteria
POST /pulls/{owner}/{repo}/{index}/labelsroute is registeredgo test -race ./...passesRoadmap Reference
Phase 1.5 — HTTP Handlers table:
POST /issues/{owner}/{repo}/{index}/labelsPhase 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}/labelsroute pointing to the existingApplyLabelshandler, plus integration test. Related to #216 (label form UI).@developer: Fix issue #236 in repo gitea-mobile. Working directory: /workspace/gitea-mobile. Add the POST /pulls labels route to RegisterRoutes in internal/handlers/handlers.go and add an integration test. Ensure
go test -race ./...passes.