fix: honor create dry-run with explicit types#326
Merged
Conversation
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes brev create --dry-run so it reliably short-circuits before any provisioning logic, including when instance types are explicitly provided via --type (or stdin), and adds a regression test to prevent the issue from returning.
Changes:
- Move the dry-run early return to occur immediately after parsing instance types (before any provisioning path can run).
- Enhance dry-run output to print explicit instance specs directly when they’re provided.
- Add a regression test ensuring
--type ... --dry-rundoes not create workspaces.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/cmd/gpucreate/gpucreate.go |
Ensures --dry-run always returns early; prints explicit instance specs when provided. |
pkg/cmd/gpucreate/gpucreate_test.go |
Adds a test that verifies dry-run with explicit types does not provision. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
cc @theFong |
theFong
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A user running
brev create --dry-run --type ...expects a safe preview of what the CLI would try, but today that path can still provision a real instance. In practice that means surprise spend, confusing behavior, and loss of trust in a flag that is supposed to be non-destructive. This PR fixes that command flow so dry-run consistently stays dry, even when instance types are supplied explicitly, and adds a regression test to keep it that way.Summary
brev create --dry-runbefore any provisioning path, even when instance types come from--typeor stdinRunGPUCreate--type ... --dry-runRoot cause
dry-runonly returned early when no explicit instance types were provided. If--typewas set, the command skipped the old dry-run branch and went on to create a real instance.Validation
go test ./pkg/cmd/gpucreate/...go test ./pkg/cmd/gpusearch/.../tmp/brev-local --no-check-latest create codex-dry-run-live-check --type hyperstack_H100 --dry-run --detached/tmp/brev-local --no-check-latest create codex-dry-run-live-filter --gpu-name H100 --min-vram 80 --dry-runbrev lsremained empty after both live checks