test: add integration test for POST /issues/{owner}/{repo}/{index}/labels label assignment #110
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 roadmap (Phase 1.4, Phase 1.5) specifies an
ApplyLabel()aggregation function and aPOST /issues/{owner}/{repo}/{index}/labelsroute. While the issue detail view implements label assignment via HTMX, there is no test covering the handler end-to-end.What to do
internal/handlers/issues.gohttptest.NewRecorderand a mock Gitea client (interface-based)Acceptance Criteria
go test ./...passes with the new testRoadmap Reference
Phase 1.4 —
ApplyLabel()thin wrapper for labeling issuesPhase 1.5 —
POST /issues/{owner}/{repo}/{index}/labelsrouteTriaged and assigned to AI-QA. Integration test for the label assignment handler -- covers valid assignment, missing params, and auth cases.
Repo Manager Triage (2026-03-28)
Priority: P2 | Size: Small | Assignee: AI-QA
This issue is unblocked and ready for development. The handler exists at
internal/handlers/handlers.goline 44 (POST /issues/{owner}/{repo}/{index}/labels->h.ApplyLabels). Existing test patterns are ininternal/handlers/handlers_test.go.Key implementation notes:
Handlerstruct (internal/handlers/handlers.go)middleware.TokenFromContext(r.Context())httptest.NewRecorderwith table-driven testsinternal/handlers/handlers_test.goDelegating to @qa-engineer for implementation.
Triaged and implemented. Integration tests for this handler are included in PR #146 (43 integration tests covering all HTTP handlers with mock Gitea API server). Ready for review.
Addressed by PR #146 (merged). Integration tests for this handler are now in master.