Skip to content

feat(cli): phase-1 consistency — autoscale list, --regions slice, -o json fix (#299 #300 #301) - #332

Merged
scttfrdmn merged 1 commit into
mainfrom
audit/phase1-cli-consistency
Jul 11, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
audit/phase1-cli-consistency

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #299, #300, #301. Part of the audit tracker #328 (Phase 1). All three are additive / backward-compatible — no existing command or flag is removed or renamed.

#301 — bug (Fixed)

spawn validate -o json and spawn snapshot create -o json failed with "unknown shorthand flag": both defined a local --output/-o that collided with the root persistent -o/--output. Removed the locals; both now read getOutputFormat() like every other command. Same JSON/text output as before.

#300 — flag consistency (Changed)

--regions was a raw comma-string on availability, collect, sweep collect, stage upload, stage estimate. Now StringSliceVarP with a -r shorthand (matching spawn list), so it accepts comma-separated or repeated values. Existing --regions us-east-1,us-west-2 invocations are unaffected (no alias needed — the flag name is unchanged, only its type widened).

#299 — additive (Added)

spawn autoscale list (alias ls) lists active auto-scaling groups. The bare autoscale status (no arg) already rendered this exact table and still does — I extracted a shared listAutoscaleGroups helper so both paths share it. No behavior change to status.

Verification

  • go build ./..., go vet ./cmd, gofmt clean.
  • TestFlagConventions + affected cmd tests (validate/snapshot/autoscale/stage/collect) pass.
  • Manual: spawn validate -o json now reaches command logic (previously errored on the shorthand); spawn autoscale list --help and the ls alias resolve. Pre-existing unrelated TestCatalogValid (feat(plugin): permissions declaration block (#388) #392) still fails on main.

CHANGELOG updated under Added / Changed / Fixed.

…json fix (#299 #300 #301)

Three additive/backward-compatible CLI-consistency changes from the
2026-07-11 audit (#328, Phase 1):

#301 (fix): `spawn validate -o json` and `spawn snapshot create -o json`
failed with "unknown shorthand flag" because both defined a local
--output/-o that collided with the root persistent -o/--output. Removed
the locals; both now read getOutputFormat(). Observable output unchanged.

#300 (change): --regions was a raw comma-string on availability, collect,
sweep collect, stage upload, and stage estimate. Now StringSliceVarP with
a -r shorthand (matches `spawn list`), accepting comma-separated OR
repeated values. Existing comma invocations keep working.

#299 (add): `spawn autoscale list` (alias ls) lists active groups. The
bare `autoscale status` already rendered this table; extracted the shared
listAutoscaleGroups helper so both use it. status behavior unchanged.

Verified: go build ./..., go vet ./cmd, gofmt clean; TestFlagConventions
+ affected cmd tests pass; `validate -o json` reaches command logic
instead of erroring; `autoscale list`/`ls` registered.
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 26.66667% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/autoscale.go 9.09% 10 Missing ⚠️
cmd/stage.go 50.00% 4 Missing ⚠️
cmd/availability.go 33.33% 2 Missing ⚠️
cmd/collect.go 33.33% 2 Missing ⚠️
cmd/snapshot.go 0.00% 2 Missing ⚠️
cmd/validate.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit cb40b17 into main Jul 11, 2026
6 of 7 checks passed
@scttfrdmn
scttfrdmn deleted the audit/phase1-cli-consistency branch July 11, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[audit] Add spawn autoscale list (today status [group] overloads both list and detail)

1 participant