Add Repo Filter and Sort to Mirror List

I’ll inspect the working tree and staged changes first, then read the relevant diffs closely from a review perspective.
The tree has four modified CLI files and nothing staged. I’m reading the command/client changes first, then I’ll check whether the tests exercise the risky paths.
The change adds generic table filter/sort helpers and wires them into repo mirror list, including JSON. I’m checking the surrounding command plumbing and column definitions now, because most review risk is in how Cobra flags and rendered rows line up.
The command wiring is mostly straightforward. I’m looking at the test helper that swaps the package-level client seam next, since parallelism or stale fake clients can make these tests flaky.
I don’t see a correctness issue yet. I’m running the targeted unit tests for the new helpers and the mirror-list command paths to catch anything the diff read might miss.
The targeted tests pass. I’m doing one last pass against the generated API shapes to make sure the new client-side filtering is not accidentally missing pagination or optional-field behavior.
The generated shape confirms ListAvailableMirrors is not paginated, while ListMirrors is paginated and the code still fetches all pages before filtering. I’m ready to summarize the review.
No findings.
I reviewed the four changed files and ran the targeted tests:
They pass. The filter/sort helpers line up with the rendered table columns, repo mirror list still fetches all paginated mirror pages before filtering, and ListAvailableMirrors is confirmed non-paginated in the generated client. Residual risk: I did not run the full suite.
I’ll refresh the diff and focus on what changed since the last review, then check the affected code paths for regressions.
The modified file set is the same, but the shared helper diff grew. I’m reading the new helper behavior and command integration side by side.
The new piece is repeatable --filter with AND semantics plus precomputed sort keys. I don’t see an obvious command-path bug in the diff; I’m running the targeted tests again, then I’ll do a final edge-case pass.
Targeted tests still pass. I’m running the broader CLI package tests once because these helpers live in shared command plumbing, even though only mirror list calls them today.
No findings.
I reviewed the added repeatable --filter behavior, AND matching, and the precomputed sort-key path. The mirror list command still fetches all mirror pages before client-side filter/sort, and the available-mirrors path remains non-paginated.
Verification run:
I did not run integration or E2E tests.
I’m checking the exact test coverage points so I can answer concretely rather than hand-wave.
I’m happy with the current suite as merge-quality. It covers:
- helper semantics: bare/scoped filters, AND filters, case-insensitivity, empty results, unknown columns, stable sort in corecmd_test.go
- command wiring: repeatable
--filter, table sort, JSON filtering, error paths, and--show-availablein repo_mirror_test.go - the risky implementation path: fetch all pages, then filter/sort before render in repo_mirror.go
I would not add integration or E2E tests for this.
One optional cheap regression test would be worthwhile if you want to lock the scripting contract tighter: assert --sort -repo --json changes JSON order. Current tests prove sorting works and filtering affects JSON, but not that sorting is reflected in JSON output specifically. Not a blocker, just a small extra guard.
I’ll refresh the working diff and compare the new test coverage against the implementation, with findings first if anything looks risky.
The worktree is clean, so the latest changes are likely committed. I’ll inspect the current branch and compare it to its base/upstream rather than only unstaged changes.
The branch is clean and pushed; it has five commits on top of main. I’ll review the full branch diff against main, then focus on the latest “PR finding” fixes.
The final branch now keeps the filter/sort code local to repo_mirror.go rather than shared helpers. I’m reading that final shape and the tests together.
The branch changed from the earlier generic --filter approach to a narrower --repo filter and local sortRows. I’m checking for subtle ordering/flag regressions now, especially the default sort special case and JSON behavior.
I don’t see a clear functional regression in the final diff. I’m running the targeted mirror-list tests and the package tests once more before giving the review verdict.
The targeted tests pass. The broader package test is still running; I’ll wait for it to finish so I don’t leave verification ambiguous.
No blocking findings.
One non-blocking cleanup: repo_mirror.go says “bare cluster/provider substring still match”, but the final implementation is --repo plus server-side --cluster / --provider, not a generic substring filter. I’d reword that comment to avoid stale context.
Verification passed:
Residual risk: I did not run integration or E2E tests, and I don’t think they’re needed for this CLI-only list rendering/filtering change.