Repository navigation
fix(dashmate): print the default config or group when called without an argument - #5655
Conversation
…an argument `dashmate config default` and `dashmate group default` declare their argument with `default: null` and treat null as "print the current default". oclif never applies an args `default: null`, so an omitted argument arrives as undefined and the commands tried to set an undefined default instead of printing it. Moved out of #4283, where it was written test-first and reviewed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 53 minutes. View limit details
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 review |
|
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
✅ Final review complete — no blockers (commit 105c731) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The PR correctly handles omitted oclif positional arguments as undefined and preserves the mutation path for supplied names. The changed dashmate lint and test checks pass, but two non-blocking issues remain: unset defaults are printed as the literal string "null", and the new tests create unused temporary directories that are never removed.
🟡 1 suggestion(s) | 💬 1 nitpick(s)
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — This is a small, self-contained CLI behavior fix that changes omitted-argument handling in two commands and adds focused unit coverage, with no critical subsystem impact. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 99% left, weekly 92% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/dashmate/src/commands/config/default.js`:
- [SUGGESTION] packages/dashmate/src/commands/config/default.js:34-37: No-argument invocation prints "null" when no default is configured
A missing default is a reachable state: newly created config files initialize the default name to null, and removing the current default clears it. In that state, `configFile.getDefaultConfigName()` returns null and `console.log` prints the literal string `null`; the analogous group command does the same at `packages/dashmate/src/commands/group/default.js:34-37`. This is inconsistent with `ConfigBaseCommand`, which treats an unset default as an error and provides actionable guidance. Handle the null result explicitly in both commands, either by raising the same kind of error or by displaying a clear unset-default message.
In `packages/dashmate/test/unit/commands/config/default.spec.js`:
- [NITPICK] packages/dashmate/test/unit/commands/config/default.spec.js:29: New tests create unused temporary directories
`getBaseConfigFactory` accepts no parameters, so the `HomeDir.createTemp()` argument is ignored. Each setup therefore creates a temporary directory that is never used or removed; the same issue appears in `packages/dashmate/test/unit/commands/group/default.spec.js:33`. Call the factory without creating a temporary home directory, or retain the home directory and remove it during teardown.
|
Bots are done — your move: post |
…nting null A new config file, or one whose default was removed, has no default config or group, and the commands printed the literal `null`. They now fail with a message saying how to set one. The tests no longer create a temporary home directory the base config factory ignores. Test would have caught this: the two unset-default tests fail before the fix and pass after it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The change correctly handles omitted oclif arguments as undefined, reports unset defaults instead of printing null, and preserves the locked mutation path for explicitly supplied config or group names. The new tests exercise parser-backed read, unset-default, and set-default behavior for both commands. No in-scope issues were found; the CI snapshot shows no failed code checks, while Build JS and PR Hygiene remain in progress.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — This is a small, self-contained CLI behavior fix in two commands with focused unit tests and no critical-system impact. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 98% left, weekly 81% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
|
Bots are done — your move: post |
Issue being fixed or feature implemented
dashmate config defaultanddashmate group defaultwith no argument are meant to print the current default config or group. They declare their argument withdefault: nulland check fornull, but oclif never applies an argsdefault: null, so an omitted argument arrives asundefined. The commands then threw instead of printing.Split out of #4283, where it was reviewed.
What was done?
Both commands check for an omitted argument (
undefined) and no longer declare thedefaultthat oclif ignores. When no default is set (a new config file, or after the default was removed), they fail with a message saying how to set one, instead of printingnull.How Has This Been Tested?
test/unit/commands/config/default.spec.jsandtest/unit/commands/group/default.spec.js: with no argument each command prints the current default, or reports that none is set; with an argument it sets it. They were written failing first in fix(dashmate): keep the node up when an image pull fails, and stop reporting success when it did not #4283.Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
105c731/self-reviewedWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.