feat: add pr list (task 0008) #8
Reference in New Issue
Block a user
Delete Branch "task-0008-pr-list"
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?
Task:
.claude/tasks/0008-pr-list.mdSummary
Adds
pr list, introducing the two policies later PR slices reuse:--assignee,--base,--head,--drafthave no Gitea query param, so the whole set is paginated (50/page) and filtered in-process, with the count line's total taken from the filtered set rather than the misleadingX-Total-Count.src/review.tsmodule computes the official-first fallback and maps it to the three lowercase valuesapproved/changes_requested/required(nonone).pr listfetches one review list per rendered PR in parallel.API-supported flags map to their params (
--state,--author→poster,--labelname→ID,--label-id,--sortwith the six Gitea values,--limit,--fields).--searchis refused with a redirect tosearch prs. Default fields:number,title,state,author,draft(bool→yes/no),review; extras:body,createdAt,labels,milestone,mergedAt,url.Also adds a
boolTextfield extractor and a sharedparsePositiveInthelper (the latter also adopted byissue list's--limit, collapsing three copies into one).Deviations
reviewDecisionlives in its own module sopr view/dashboard can reuse it later.--label-idaccepts a comma-separated list and may be combined with--label— a strict superset of the single-value spec, no change for the single-value case.urlextra field pluckshtml_url, matchingissue list's precedent.Review
Risk
Overall: MEDIUM
src/review.tsplus a self-containedprListhandler and oneboolTexthelper; only shared surface isfields.ts, purely additive.listdispatch case reverts cleanly, no schema/API commitment.test/pr-list.test.tscovers defaults, filters, sort, label resolution,--fields,--searchrefusal, and every reviewDecision branch.reviewDecisionencodes branch-protection/approval semantics; the official-first fallback lets an unofficial approval read asapprovedin unprotected repos (display-only but security-adjacent).Standards — unaddressed findings
--searchguard and per-command flag tables duplicateissue list(judgement call, kept): the repo deliberately keeps the two list commands as parallel siblings, so the mirrored parse/query/filter shape is the established style, not accidental duplication. The one true logic duplication the review flagged — positive-integer/--limitparsing — was fixed (nowparsePositiveIntinflags.ts).Spec — unaddressed findings
--label-id(scope creep, kept): spec describes--label-id <id>as a single value; comma support mirrors--labeland is a harmless strict superset.--label+--label-id(scope creep, kept): spec doesn't mention combining them; concatenating the resolved IDs is harmless and never changes single-flag behaviour.