feat: add pr review (task 0013) #13
Reference in New Issue
Block a user
Delete Branch "task-0013-pr-review"
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?
Implements
.claude/tasks/0013-pr-review.md.Summary
Adds
pr review <n>with the three action switches--approve,--request-changes, and--comment, plus--body/--body-file. Exactly one action flag is required — zero or multiple raiseVALIDATION_ERRORbefore any API call, mirroringpr merge's conflicting-selector rule (adapted from "at most one, with a default" to "exactly one, no default"). Body requirements are left to Gitea: a body-less event it rejects surfaces its 422 asVALIDATION_ERRORcarrying the server's message, via the sharedclassifyHttpError. Output isreview: { number, action }.Built test-first via the
test-driven-developmentskill (one behavior per RED→GREEN cycle);test/pr-review.test.tsadds 10 tests. Full suite 311 passing, typecheck clean.Deliberate deviations (see the task's Implementation Notes):
pr view <n> --reviewssuggestion line — house style shared by every sibling mutation command, kept over the bare output contract.ReviewActioninterface in place of a repeated inline type (addressing a review nit; matches the localMergeMethod/UpdateStyleconvention).Review
Risk — Overall: Medium
prReview/resolveReviewActionplus one dispatch branch, reuses existing helpers.Unaddressed findings:
resolveReviewActionechoesresolveMergeMethod's flag-count-and-throw shape. Left separate — the rules genuinely differ (merge permits a default; review requires exactly one), so the shared shape is too thin to extract honestly.pr view --reviewssuggestion line exceeds the literalreview: { number, action }output contract. Kept — every sibling command adds the same kind of hint.Add `pr review <n>` with the three action switches --approve, --request-changes, and --comment, plus --body/--body-file. Exactly one action flag is required; zero or multiple raise VALIDATION_ERROR before any API call, mirroring the merge shorthand-conflict rule. Body requirements are left to Gitea: a body-less event it rejects surfaces its 422 as VALIDATION_ERROR carrying the server's message. Output is `review: { number, action }`.