Repository navigation
refactor(machine): share machine list loading - #1714
Conversation
❌ Deploy Preview for devsydev failed.
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Shared loading and output paths cmd/machine/list.go |
A shared function loads machine configs, wraps loading errors, and sorts machines by ID. Plain-text output builds rows from the sorted machines, and JSON output marshals them. |
Priority:
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Refactor
Merge Risk: 
Minimal · up to 8b901
-
No actionable issue is identified; the change is ready for normal merge checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description clearly explains what changed, why it changed, behavior-preservation expectations, and validation results. It omits several template sections, including the change-type selection, AI-assistance disclosure, checklist confirmations, and explicit issue reference, but the core information is complete.
-
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
✨ Simplify code
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
CI annotation context is incomplete: annotation collection unavailable or limited
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
✅ Deploy Preview for images-devsy-sh canceled.
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
@greptileai review |
[Low impact] The PR appears safe to merge. SummaryBoth machine-list formats now use
Reviews (2) · Last reviewed commit: "refactor(machine): share machine list lo..." · Reviewed by Greptile |
6760435 to
8b90163
Compare
|
@greptileai review |
|
@coderabbitai review |
|
|
@coderabbitai full review |
|
|
@coderabbitai full review |
✅ Action performed
|
Summary
loadSortedMachinesincmd/machine/list.go: loads each machine config once viaprovider.LoadMachineConfig, wraps errors asload machine config: %w, and stable-sorts by ID.printMachinesPlainandprintMachinesJSONboth consume that result; their duplicated loop, error wrapping, and sort are removed.[]).Why
Plain and JSON machine listing duplicate config loading and ID sorting, so their behavior can drift. A shared loader will provide one sorted inventory to both renderers. This is a narrow cleanup in an otherwise untouched Engine path.
Validation
mise run cli:formatmise run cli:lint:ci: 0 issuesmkdir -p dist && go build ./cmd/machine/...go vet ./cmd/machine/go test ./cmd/machine/... ./pkg/provider/...: passmachine.json. All identical.CodeRabbit CLI
coderabbit review --agent --committed --base-commit dd1a36088de23f80ee3ea3ad6acec9ecb59b3712: completed, 0 findings, reviewedcmd/machine/list.go.Auto-merge
Eligible: yes. Behaviour-preserving; 48 changed non-test lines (27 added, 21 removed); 1 non-test file; no tests touched; no lint rule or
nolintchanged.Next
None.
Summary by CodeRabbit