Skip to content

fix(launch): carry --tag and --team to sweep members and the batch queue (#1356) - #1365

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1356-sweep-tags-team
Oct 27, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1356-sweep-tags-team

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1356

spawn launch --tag k=v and --team were merged in runLaunch only after the parameter-sweep and batch-queue dispatches had returned, so on those paths both flags were accepted and silently dropped.

Paths

Path Before Now
Single launch merged same merge, through the shared applyLaunchFlagTags
Foreground sweep dropped sweepBaseConfig merges them into the base config; buildLaunchConfigFromParams copies base tags into every member
Detached sweep dropped the same base config, so seedDetachedBootstrap renders them (through aws.LaunchTagger) into each member's uploaded spawn_tags. The orchestrator's memberTags already passes every rendered tag through except the four it owns (spawn:managed, spawn:sweep-id/-name/-index), so no Lambda code change
Multi-region sweep dropped same as foreground/detached: the tags come per member from the base config, whatever the row's region (the gate uses a two-region file)
Batch queue dropped batchQueueLaunchConfig merges them. It is built before the region lookup, upload, key pair and IAM role, and preflightLaunchTags (#1336) now runs on it, so a set over the 50-tag limit is refused before any AWS call
spawn schedule create / scheduler-handler n/a the command has no --tag or --team (cobra refuses them as unknown flags), so nothing is dropped; there is a gate for that

Team: --team sets spawn:team-id, plus spawn:team-name when the team resolves. That is exactly what a single launch sets, on every path.

Reserved prefix: parseKVTags refuses a spawn: key, on every path. runLaunch now runs that check before the identity lookup and before any dispatch, so a sweep or batch queue is refused with the single launch's error and makes no AWS call. The spawn-managed tags buildTags writes still win over config.Tags.

#1336 interaction: preflightSweepTags(*baseConfig, ...) now counts the --tag values, because they are in the base config.

Gates (each run red against a revert that compiles)

  • TestSweepMembersCarryTagAndTeamFlags: foreground members (as Launch tags them) and detached members (the uploaded spawn_tags), across two regions. Revert (dropping applyLaunchFlagTags from sweepBaseConfig): 16 missing-tag failures.
  • TestBatchQueueInstanceCarriesTagAndTeamFlags. Revert (dropping it from batchQueueLaunchConfig): fails.
  • TestReservedTagFlagRefusedOnEveryLaunchPath: sweep and batch configs return the single launch's error, and so does runLaunch on both dispatches, with 0 AWS calls (counting endpoint). Reverts: each per-path revert fails it. Removing the early runLaunch check makes 1 AWS call per path and gives the batch queue a different error.
  • TestBatchQueueOverTheTagLimitMakesNoAWSCall. Revert (dropping the batch preflightLaunchTags): fails at config load, with no TagLimitError.
  • TestScheduleCreateRefusesTagAndTeamFlags. Mutation (adding a --tag flag to schedule create): fails.
  • lambda/sweep-orchestrator TestMemberKeepsTheCLIsTeamAndUserTags pins the pass-through of user and team tags. It has no code change to revert; the check was a mutation that adds spawn:team-id to the owned set, which makes it fail.

Checks

make check steps 1–6 pass (gofmt, vet, every GOOS, staticcheck, golangci-lint 0 issues in all 10 modules, hermetic short tests, nested modules, tidy). check-build-tags fails, and fails the same way on unmodified main on this machine (the /private/tmp path issue). semgrep scan --config=auto --error . finds 0. make api-snapshot and make cli-iam-actions produce no changes. No help text changed.

Live deploy

None. The sweep-orchestrator Lambda is unchanged apart from a new test file, and no IAM changes.

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.48148% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/launch_single.go 66.66% 5 Missing ⚠️
cmd/launch_batchqueue.go 84.00% 4 Missing ⚠️
cmd/launch_flag_tags.go 92.85% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…eue (#1356)

spawn launch --tag and --team were merged in runLaunch only after the
parameter-sweep and batch-queue paths had been handed off, so both
accepted and silently dropped them. applyLaunchFlagTags now merges them
on every path: the single launch, sweepBaseConfig (every foreground,
detached and multi-region member starts from it) and
batchQueueLaunchConfig. A malformed or spawn:-prefixed --tag is refused
before any AWS call on every path.
@scttfrdmn
scttfrdmn force-pushed the fix/1356-sweep-tags-team branch from 3cdb712 to d4d69ac Compare October 27, 2026 05:10
@scttfrdmn
scttfrdmn merged commit 8afc227 into main Oct 27, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1356-sweep-tags-team branch October 27, 2026 05:30
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.

spawn launch --tag and --team are silently dropped on parameter-sweep and batch-queue launches

1 participant