fix: add missing required flags to instance create help texts#25
Conversation
📝 WalkthroughWalkthroughUpdated the ChangesInstance create required flags fix
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/commands/instance.go (1)
387-392: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd test coverage for the new required-flag validations.
No test evidence is provided confirming
instance createreturns the expected errors when--storage-categoryor--network-planare omitted, unlike the existingTestNetworkCreateIsolatedRequiresNetworkPlanpattern for network create.#!/bin/bash # Confirm whether instance create already has tests for these required flags rg -n 'instanceCreateExec|storage-category is required|network-plan is required' internal/commands/commands_test.go🤖 Prompt for 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. In `@internal/commands/instance.go` around lines 387 - 392, Add test coverage for the new required-flag checks in instance create by extending the existing command tests around instanceCreateExec in commands_test.go. Add cases that omit --storage-category and --network-plan separately, then assert the command returns the same validation errors currently produced by the storageCategory and networkPlan checks in internal/commands/instance.go, following the style of TestNetworkCreateIsolatedRequiresNetworkPlan for expected-error assertions. Ensure the tests exercise the instance create path directly so the required-flag behavior is verified end to end.
🤖 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.
Nitpick comments:
In `@internal/commands/instance.go`:
- Around line 387-392: Add test coverage for the new required-flag checks in
instance create by extending the existing command tests around
instanceCreateExec in commands_test.go. Add cases that omit --storage-category
and --network-plan separately, then assert the command returns the same
validation errors currently produced by the storageCategory and networkPlan
checks in internal/commands/instance.go, following the style of
TestNetworkCreateIsolatedRequiresNetworkPlan for expected-error assertions.
Ensure the tests exercise the instance create path directly so the required-flag
behavior is verified end to end.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e7ad7152-a60d-496c-ba68-7cb5605de527
📒 Files selected for processing (1)
internal/commands/instance.go
Fixes #24
This PR fixes the
zcp instance createcommand examples which were missing required flags, causing the command to fail when users copied and ran the examples.Changes made
Summary by CodeRabbit