feat(bugs): let bugs list --status accept multiple values#276
feat(bugs): let bugs list --status accept multiple values#276sachiniyer merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94b8717951
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for status in statuses { | ||
| let bugs = fetch_all_bugs(client, repo_id, *status, scan_id).await?; | ||
| combined.extend(bugs); |
There was a problem hiding this comment.
Deduplicate repeated --status values before fetching
fetch_all_bugs_multi_status iterates statuses verbatim and appends each result set, so passing the same state more than once (for example --status resolved --status resolved or --status pending,pending) returns duplicate bug rows and inflated totals/pages instead of a true combined set. Since this command advertises multi-status combination behavior, repeated inputs should be normalized (deduped while preserving first-seen order) before issuing API calls.
Useful? React with 👍 / 👎.
20adde8 to
4e38804
Compare
4e38804 to
9b19d2a
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Triage commonly wants "open + resolved" or "everything" in one go. The single-valued `--status` forced agents to run the command N times and merge with jq. Make it `Vec<BugReviewState>` accepting either repeated `--status` flags or comma-separated values (`--status pending,resolved`); default stays `pending` so existing invocations are unaffected. The bugs API only takes one status per request, so multi-status fans out to one paginated `fetch_all_bugs` call per status and concatenates in the order the user asked for. Multi-status forces the client-side filter+paginate path so result ordering and counts stay consistent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`fetch_all_bugs_multi_status` iterated the input statuses verbatim, so `--status pending,pending` (or `--status pending --status pending`) issued the same paginated API call twice and concatenated the results. Net effect: every bug appeared twice in the combined output, doubling the reported total and inflating page counts. Normalize the statuses with `dedupe_statuses` (preserves first-seen order) before fanning out. Live verification against `usedetail/detail`: --status pending → 302 items, 302 unique IDs --status pending,pending → 302 items, 302 unique IDs (was 604) --status pending --status pending → same (was 604) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
a75903d to
e4515dc
Compare

Summary
--statusforced agents to run the command N times and concatenate withjq.--statusaVec<BugReviewState>accepting either repeated flags (--status resolved --status dismissed) or comma-separated values (--status pending,resolved). Default stayspending— existing invocations are unaffected.fetch_all_bugscall per status and concatenates in the order the user asked for. Multi-status forces the client-side filter+paginate path so result ordering and counts stay consistent.Testing
Automated, run locally and passing:
cargo test— full suite green. 3 new clap-parse tests insrc/lib.rs:bugs_list_status_default_is_pendingbugs_list_status_comma_separated_parsesbugs_list_status_repeated_flag_parsesbugs listtests still pass (default still parses to[Pending], so silent-output and pagination invariants are preserved).cargo clippy -- -D warnings— cleancargo fmt --check— cleancargo xtask check— clean (HELP.md regenerated in 20adde8)Manual end-to-end against live API (repo: usedetail/detail — pending=305, resolved=674, dismissed=109; total=1088):
--status pending,resolved --limit 100→total=979✅ matches 305 + 674--status pending --status resolved --limit 100→total=979✅ comma-separated and repeated-flag forms produce identical results--status pending,resolved,dismissed --limit 100→total=1088✅ matches the full unionbugs list usedetail/detail --format json→total=305, total_pages=7✅ default-pending path unchanged, hitsclient.list_bugsdirectly (no fan-out)🤖 Generated with Claude Code