Repository navigation
refactor(cmd): split launch.go into concern files (#318) - #337
Merged
Merged
Conversation
Pure same-package reorganization of cmd/launch.go (4333 LOC, the biggest file in the repo), no behavior change. Functions grouped by concern into 9 files; launch.go (which held only the package doc + imports after the move) removed. - launch_flags.go — flag var block, launchCmd, init, applyLaunchDefaults, parseIAMRoleTags - launch_single.go — runLaunch, launchWithProgress - launch_sweep.go — parameter-sweep orchestration, rolling queue, detached Lambda - launch_jobarray.go— job-array (legacy + cohort), member config, result rendering - launch_batchqueue.go — launchWithBatchQueue - launch_config.go — buildLaunchConfig, user-data building, attach-volume/EFS parsing - launch_preflight.go — SSH key, instance-type/OS/lifecycle guards, strata - launch_regions.go — region detection + constraint filtering - launch_posthook.go— DNS register, SSH/spored waits, output-id, tty/mode helpers Also fixed TestSporedUnit_NoPrivateTmp: it scanned cmd/launch.go for the pkg/launcher/bootstrap.go (launch.go never contained PrivateTmp — the entry was stale). Repointed the guard at the real emitter, making it meaningful. Verified: 58 funcs conserved (main launch.go 58 → 58 across the split); go build ./..., go vet ./cmd, gofmt clean; full cmd test suite green; rebuilt bin/spawn and diffed the command+flag tree vs main — byte-identical. Part of the 2026-07-11 audit (#328, Phase 3).
scttfrdmn
force-pushed
the
audit/phase3-split-launch
branch
from
July 11, 2026 20:27
ba9bbf3 to
48f5720
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This was referenced Jul 11, 2026
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.
Closes #318. Part of the audit tracker #328 (Phase 3). Pure internal reorganization — the CLI command/flag tree is byte-identical to
main.What changed
cmd/launch.gowas 4333 LOC — the largest file in the repo by ~4×. Functions are regrouped by concern into 9 same-package files (Go resolves package symbols across files, so no imports/exports change):launch_flags.govarblock,launchCmd,init,applyLaunchDefaults,parseIAMRoleTagslaunch_single.gorunLaunch,launchWithProgress(core path)launch_sweep.golaunch_jobarray.golaunch_config.gobuildLaunchConfig, user-data building, attach-volume/EFS parsinglaunch_regions.golaunch_batchqueue.golaunchWithBatchQueuelaunch_posthook.golaunch_preflight.golaunch.goheld only the package doc-comment + imports after the move (all unused), so it was removed.Test fix (bonus)
TestSporedUnit_NoPrivateTmpscannedcmd/launch.gofor the #66PrivateTmp=trueguard — but launch.go never containedPrivateTmp(the entry was stale). The spored systemd unit is actually emitted bypkg/launcher/bootstrap.go. Repointed the guard's file list at the real emitter, so it now meaningfully protects the invariant (and doesn't reference a deleted file).Verification
launch.gohad 58 → 58 across the split files). Nothing dropped.go build ./...,go vet ./cmd,gofmt -lclean.go test ./cmdgreen (excl. pre-existingTestCatalogValid/ feat(plugin): permissions declaration block (#388) #392, which fails onmaintoo).bin/spawn, diffed the full recursive command+flag tree vsmain→ byte-identical.Stacks on #336 (client.go split); both are independent internal reorgs. Expect a CHANGELOG rebase when landing the second.