Skip to content

deprecate: --cartesian and --use-reservation warn instead of doing nothing - #699

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/674-675-deprecate-inert-flags
Oct 5, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/674-675-deprecate-inert-flags

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #674. Fixes #675.

Both flags were parsed into package globals that nothing read — accepted, no effect, no warning. Found by #688's wiring gate.

Neither should be implemented, and #674's premise was partly mine to correct

I filed #674 claiming --cartesian "silently produces the wrong run count" and ranked it the costliest of the three unwired flags. That was wrong, and I've corrected it on the issue. With a param file the run count comes from params:/grid:; the flag is simply inert, with no alternate interpretation to produce. What's true is narrower: it advertises a capability, does nothing, and says nothing.

Looking at what it would actually cross:

  • The cartesian product already exists as the param file's grid: key (pkg/params.expandGrid) — named value lists in, one param set per combination out, with sorted-key iteration so sweep indexes are deterministic.
  • The input --cartesian implies, a repeatable --param lr=0.1,0.2, does not exist.
  • --params is inline JSON and returns inline --params not yet implemented, use --param-file for now — fails closed with a clear message, so that one is already honest.
  • params: in a file is a list of complete sets, so there are no lists to cross.

Implementing it would add a second way to do what grid: does, for an input format that doesn't exist. --reservation-id (#216) likewise already supersedes --use-reservation and is wired through to RunInstances' CapacityReservationSpecification.

So both are deprecated toward the thing that works:

$ spawn launch x --use-reservation --cartesian ...
Flag --use-reservation has been deprecated, it never did anything; use --reservation-id <cr-...> instead
Flag --cartesian has been deprecated, it never did anything; use the param file's grid: key for a cartesian product

Deprecated rather than deleted, following the --subnet / --security-group / --key-pair precedent: existing scripts keep working, but with a warning instead of silence. --use-reservation is the one I'd most want warned about — it reads as "draw on the capacity I already pay for" and delivered an on-demand instance at on-demand price.

Manifests updated

Both stay in knownUnwiredFlags (they are still read by nothing, which is the honest state) with the reason now recorded as deliberately not implemented rather than to be fixed. In sweepFlagCoverage they move from sweepKnownGap to sweepNA — a deprecated inert flag is not a sweep gap to chase.

That leaves --vpc (#673) as the only genuinely unwired flag with real consequences: it has no LaunchConfig field at all, so spawn launch --vpc vpc-xxx silently launches in the default VPC. That one needs implementing, not deprecating, and it is next.

Gates

gofmt -l empty, go vet ./..., go test -short ./..., make check-docs (regenerated), changelog gate, semgrep → 0 findings. Warnings verified against a real built binary.

…thing

Both were parsed into globals nothing read: accepted, no effect, no
word about it.

Neither is implemented, deliberately. The cartesian product already
exists as the param file's grid: key, and the input --cartesian implies
(a repeatable --param lr=0.1,0.2) does not exist — --params is inline
JSON that fails closed, and params: is already a list of complete sets
with no lists to cross. --reservation-id supersedes --use-reservation.

Corrects my own #674 text, which claimed --cartesian 'silently produces
the wrong run count'. It does not; with a param file the count comes
from params:/grid: and the flag is inert. Over-stated, corrected on the
issue.
@scttfrdmn
scttfrdmn merged commit d857690 into main Oct 5, 2026
6 checks passed
@scttfrdmn
scttfrdmn deleted the fix/674-675-deprecate-inert-flags branch October 5, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant