Skip to content

feat(array): spawn array command group (#389) - #395

Merged
scttfrdmn merged 2 commits into
mainfrom
feat/389-spawn-array
Jul 19, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
feat/389-spawn-array

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Implements #389 (docs-review follow-up) — first-class job-array reporting.

What

spawn array status <name>    launched vs requested members + MISSING (sparse) indexes
spawn array collect <name>   per-index members (and gaps)
spawn array cancel <name>    terminate members  (--pending spares actively-running)

Members are discovered by grouping EC2 on the spawn:job-array-name / -id tags (the same tags spawn list --job-array-name filters on) — no server-side record, unlike sweeps.

The headline is status surfacing the sparse-index gap: when a --min-viable launch brings up 6 of 8, {total}/JOB_ARRAY_SIZE stays 8 and the launched indexes are whatever subset succeeded (e.g. 0,1,2,4,5,7). A shard scheme assuming a dense 0..7 silently skips the missing work — exactly what the job-arrays docs now warn about, now visible from the CLI.

Deliberately scoped

logs and retry --failed are not included (noted on #389):

  • retry would need the original launch config to relaunch a missing index, but that isn't faithfully recoverable from a surviving member's tags (spawn:command only rides when ≤256 chars; AMI/subnet/SG/user-data aren't tagged). Shipping a lossy relaunch would be worse than none.
  • logs needs SSH/SSM exec plumbing factored into a reusable helper; spawn connect <member> -- tail … covers it today.

Tests

cmd/arraygroup_test.go table-tests missingIndexes (full / sparse / none / size-zero). The AWS-touching paths are thin wrappers over ListInstances + Terminate; no live EC2 in tests.

Notes

  • New docs-gen/array.md generated.
  • gofmt/vet/go test ./cmd/ clean.

Closes #389

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 15.43624% with 126 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/arraygroup.go 15.43% 126 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn force-pushed the feat/389-spawn-array branch from 924fad5 to b7a075c Compare July 19, 2026 16:23
First-class job-array reporting, discovered by grouping EC2 on the
job-array tags (no server-side record, unlike sweeps):

  spawn array status <name>   launched vs requested + MISSING indexes
  spawn array collect <name>  per-index members (+ gaps)
  spawn array cancel <name>   terminate members (--pending spares running)

`status` surfaces the sparse-index gap a --min-viable partial launch
leaves behind — {total} stays the requested count, so a dense-range
shard scheme silently skips the missing indexes. This is the reporting
the job-arrays docs now warn about.

Scoped deliberately: `logs` and `retry --failed` are not included.
`retry` would need the original launch config, which isn't faithfully
recoverable from tags (command >256 chars, AMI/subnet/SG/user-data are
not tagged). Tracked as follow-ups on #389 rather than shipping a
lossy relaunch.

Closes #389
TestFlagConventions requires any local --json to be MarkDeprecated'd
(canonical is root -o/--output), and TestTier0_CommandCoverageGate
requires every top-level command to be classified. Deprecate array
status's --json and defer the array group to Tier 2/3 (its subcommands
act on live instances by tag; the pure missingIndexes logic is
unit-tested).
@scttfrdmn
scttfrdmn force-pushed the feat/389-spawn-array branch from b7a075c to b190e79 Compare July 19, 2026 16:26
@scttfrdmn
scttfrdmn merged commit f1c5b4b into main Jul 19, 2026
6 of 7 checks passed
@scttfrdmn
scttfrdmn deleted the feat/389-spawn-array branch July 19, 2026 16:27
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.

First-class job-array reporting: spawn array status/logs/retry/collect/cancel

1 participant