Skip to content

fix(dashmate): print the default config or group when called without an argument - #5655

Merged
shumkov merged 2 commits into
v5.1-devfrom
fix/dashmate/default-command-without-argument
Nov 18, 2026
Merged

shumkov merged 2 commits into
v5.1-devfrom
fix/dashmate/default-command-without-argument

Conversation

@shumkov

@shumkov shumkov commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

dashmate config default and dashmate group default with no argument are meant to print the current default config or group. They declare their argument with default: null and check for null, but oclif never applies an args default: null, so an omitted argument arrives as undefined. 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 the default that 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 printing null.

How Has This Been Tested?

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · 105c731

  • Bots — thepastaclaw ✓
  • Self-review — post /self-reviewed
  • Build green
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

…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]>
@shumkov shumkov added this to the v5.1.0 milestone Oct 29, 2026
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 03945d3 and 105c731.

Files selected for processing: 4
  • packages/dashmate/src/commands/config/default.js
  • packages/dashmate/src/commands/group/default.js
  • packages/dashmate/test/unit/commands/config/default.spec.js
  • packages/dashmate/test/unit/commands/group/default.spec.js
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shumkov

shumkov commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Oct 29, 2026
@thepastaclaw

thepastaclaw commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit 105c731) · triage: low

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: low by gpt-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); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 92% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort medium); agent phase2-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.

@github-actions

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Oct 29, 2026
…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]>
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed labels Oct 30, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: low by gpt-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); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 98% left, weekly 81% left; passed over gemini-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; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort medium); agent phase2-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.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Oct 30, 2026
@shumkov
shumkov merged commit 6dc361f into v5.1-dev Nov 18, 2026
32 of 33 checks passed
@shumkov
shumkov deleted the fix/dashmate/default-command-without-argument branch November 18, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants