feat(cli): add persistent configuration management commands#37
feat(cli): add persistent configuration management commands#37tao-xiaoxin wants to merge 13 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds persistent ChangesPersistent Config Management Commands
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/cli.ts`:
- Around line 281-289: The key handling in the cli.ts subcommand branch exposes
the Owner password when passed positionally, so update the key flow around
setConfigKey to support a safer input path. Use the existing `@clack/prompts`
import to prompt for the secret when no value is provided, and/or add stdin
reading as a fallback in the key command path; keep the current output logic in
place and document the non-positional prompt-based usage as the recommended
approach.
- Around line 52-60: `devspace help config` currently falls through to the
unknown-help-target error because the config-help branch in `src/cli.ts` only
accepts `--help`/`-h`. Update the help handling logic around `normalizeCommand`
and the `printConfigHelp` branch so the command `help` is treated the same as
`--help`/`-h` when the subcommand is `config`, while preserving the existing
behavior for other help targets and the final error path.
In `@src/config-operations.ts`:
- Around line 140-150: The validateHost function only checks the full hostname
string, so it can still accept invalid label patterns like empty labels,
leading/trailing hyphens, or labels over 63 characters. Update validateHost to
validate each hostname label separately after the existing
scheme/slash/whitespace checks, while still allowing valid IPs and localhost,
and keep the invalid-host errors consistent for the validateHost path.
- Around line 168-171: The maskSecret helper currently reveals partial secret
characters by returning the first 3 and last 2 characters for longer values,
which should not happen for human passwords. Update maskSecret in
config-operations.ts to always return a fixed masked/configured marker for any
present secret, while still returning the not-configured marker when the value
is missing. Keep the change localized to maskSecret so any config output using
this helper no longer exposes password material.
- Around line 88-103: The setConfigPublicBaseUrl function is incorrectly
delegating URL values to setConfigDomain, which only validates hostnames and
breaks valid publicBaseUrl entries like https://example.com. Update
setConfigPublicBaseUrl to validate and persist full URLs itself while keeping
setConfigDomain hostname-only, and use the existing
writeDevspaceConfig/loadDevspaceFiles flow so publicBaseUrl continues to be
stored correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c6cacc44-09e0-4dc9-8082-81ecdf0cf525
📒 Files selected for processing (10)
README.mddocs/configuration.mddocs/setup.mdpackage.jsonsrc/cli.test.tssrc/cli.tssrc/config-operations.test.tssrc/config-operations.tssrc/config.tssrc/oauth-store.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/config-operations.ts`:
- Around line 102-106: The MCP URL generation in the config display/update flow
is dropping any existing path from legacy publicBaseUrl values. Update the
config-show output and the update message in src/config-operations.ts to use the
same path-preserving helper used by the publicBaseUrl normalization logic
instead of constructing the URL directly with new URL(MCP_PATH, publicBaseUrl).
Refer to normalizeConfiguredPublicBaseUrl and the message returned after
writeDevspaceConfig so both places preserve the persisted path segment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 197a4dc8-d727-4758-bf0e-5fbb77451b34
📒 Files selected for processing (5)
README.mdsrc/cli.test.tssrc/cli.tssrc/config-operations.test.tssrc/config-operations.ts
✅ Files skipped from review due to trivial changes (1)
- README.md
🚧 Files skipped from review as they are similar to previous changes (3)
- src/config-operations.test.ts
- src/cli.test.ts
- src/cli.ts
Closes #36
Summary by CodeRabbit
devspace configwith effective configuration output and dedicated subcommands for host, port, domain/public URL, and owner password.devspace --help config, plus clearer top-level version/help behavior.