fix(cli): validate deploy instance names before setup prompts#604
fix(cli): validate deploy instance names before setup prompts#604Saibabu7770 wants to merge 1 commit into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/cli.test.js`:
- Around line 102-104: The test "deploy rejects command-substitution instance
names" is currently using double quotes so the shell expands $(id) before it
reaches the CLI; update the test to pass a literal $(id) by changing the call to
run in that test (the run(...) invocation in test/cli.test.js) to use single
quotes around $(id) (i.e., run("deploy '$(id)'") ) so the shell does not perform
command substitution and the CLI receives the raw payload to validate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 35943e3b-b885-4659-bc54-40ff08c07eaf
📒 Files selected for processing (2)
bin/nemoclaw.jstest/cli.test.js
|
Thanks for the proposed fix to validate deploy instance names before setup prompts, which may help prevent issues with malformed names and improve the overall user experience. |
|
Thanks for this — validating deploy instance names early prevents confusing failures downstream. The CLI has been refactored to TypeScript since March. Could you rebase against main and verify the validation still fits the current deploy flow? Happy to review once it's updated. |
Wrap validateName for instance and sandbox in executeDeploy so invalid names exit with code 1 and a clear message instead of throwing. Add unit and CLI regression tests that ensure credentials are not read for bad deploy names. Made-with: Cursor
7eb2e25 to
d12420b
Compare
|
Thanks for the contribution. Instance name validation for Feel free to check the current state of |
Fixes #575.
Summary
Validate
nemoclaw deploy <instance-name>input before credential/setup steps.This fails fast on malformed names and prevents API key prompt for invalid input.
Changes
instanceNameat start ofdeploy()inbin/nemoclaw.jstest/cli.test.jsfor:foo;bar$(id)Testing
node --test --test-name-pattern "deploy rejects" test/cli.test.jsSummary by CodeRabbit
Bug Fixes
Tests