Repository navigation
Honor --dry-run everywhere it can create or delete - #10
Merged
Merged
Conversation
--dry-run was gated inside cmd_up only. The bare `orbx`, `orbx shell` and
`orbx run` all parse the flag, then call ensure_up with nothing checking
it -- so they create and fully provision a machine. `orbx down --dry-run`
deletes one. Only `orbx up --dry-run` did what --help promises ("Print
the orb command that would run, then exit").
Caught by running `orbx --dry-run --name testname123` while inspecting
behavior, per AGENTS.md, and finding a provisioned VM afterwards. The orb
stub confirms it:
list -q
create -c .../templates/default.yaml --isolated --mount ... testname123
-m testname123 -u root cat /etc/sandbox-status <- already polling
That matters most for agents: AGENTS.md tells them --dry-run inspects
behavior "without touching OrbStack", so following the docs silently
leaves machines behind.
The gate moves into orbx::dry_run_plan, called by every path that would
mutate OrbStack. It deliberately probes nothing -- no `orb list`, no
machine state -- so a dry run cannot touch OrbStack even to look, which
is what the existing `[ ! -s "$ORB_STUB_LOG" ]` assertion pins. down
prints the `orb delete -f <name>` it would have run.
Verified against the real CLI: three dry runs across the bare form, run,
and down leave `orb list` empty.
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.
--dry-runwas gated insidecmd_uponly. The bareorbx,orbx shell, andorbx runall parse the flag and then callensure_upwith nothing checking it — so they create and fully provision a machine.orbx down --dry-rundeletes one. Onlyorbx up --dry-rundid what--helppromises: "Print the orb command that would run, then exit."I hit this while inspecting behavior the way AGENTS.md recommends —
orbx --dry-run --name testname123— and found a provisioned VM sitting inorb listafterwards. The orb stub shows exactly what happens:This matters most for agents: AGENTS.md tells them
--dry-runinspects behavior "without touching OrbStack", so an agent following the documentation silently leaves machines behind.The fix
The gate moves into
orbx::dry_run_plan, called by every path that would mutate OrbStack. It deliberately probes nothing — noorb list, no machine state — so a dry run cannot touch OrbStack even to look. That property is what the existing[ ! -s "$ORB_STUB_LOG" ]assertion increate.batspins, and the new tests hold the other paths to the same bar.downprints theorb delete -f <name>it would have run.Verification
Against the real CLI, three dry runs leave
orb listempty:4 new tests in
test/create.batscovering the bare form,run,shell, anddown. 77/77 pass, shellcheck clean.Note on keeping the flag
Worth stating why this is a fix rather than a removal:
--dry-runis howtest/create.batsasserts the composedorb createline — config layering, mounts, arch, template resolution — without touching OrbStack. It's the introspection seam the create-path tests rest on, and it's a documented flag of a released version.