Repository navigation
fix: root volume size unreachable on the sweep launch path (#544, #545) - #546
Merged
Merged
Conversation
--volume-size was registered and read on the single-instance launch path but never referenced by launch_sweep.go, and the param-file equivalent, volume_size:, was actively rejected with a message naming "--disk-size" — a flag that has never existed in this codebase (#545). Every sweep row launched at spawn's hardcoded 20 GiB default regardless of what was asked for, the fourth occurrence of this bug class this week (#524, #525, #539). Wires --volume-size and volume_size: into the sweep path following the same applyCLI*ToSweep pattern #525/#539 established: fold the CLI flag into paramFormat.Defaults before the orchestration-path dispatch, with precedence row > CLI flag > file defaults. disk_size: remains a rejected near-miss, now pointing at the real key instead of the nonexistent flag.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ss finding (#544) strconv.Atoi returns int, and the int32(n) conversion right after it tripped trailofbits.go.string-to-int-signedness-cast. strconv.ParseInt(s, 10, 32) does the same bounded parse without a follow-on cast; same behavior for every value RunInstances' BlockDeviceMapping.1.Ebs.VolumeSize can carry.
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.
Summary
--volume-sizeis dropped andvolume_size:is rejected, so every sweep row is hard-pinned at 20 GiB #544:--volume-sizewas registered and read on the single-instance launch path (cmd/launch_config.go) but never referenced bycmd/launch_sweep.go, so every sweep row launched with spawn's hardcoded 20 GiB default (pkg/aws/ebs.go) regardless of the flag. Same bug class as --estimate-only is ignored on the foreground sweep path — --no-detach launches every row instead of estimating #524, Sweep dispatch silently drops --cost-limit and --ttl, then logs "Using safeguards: ttl=..." #525, --iam-role / --iam-policy / --iam-policy-file are silently ignored on the sweep path (0.100.4) #539 — the 4th occurrence this week.sweep_keys.gorejectsvolume_size:/disk_size:by telling the user to use--disk-size, a flag that does not exist #545: the param-file equivalent,volume_size:, was actively rejected with a message naming--disk-size— a flag that has never existed anywhere in this codebase (confirmed viagrep -rn "disk-size", no hits). There was no route through the param file either.applyCLI*ToSweeppattern established by Sweep dispatch silently drops --cost-limit and --ttl, then logs "Using safeguards: ttl=..." #525 (applyCLISpendControlsToSweep) and --iam-role / --iam-policy / --iam-policy-file are silently ignored on the sweep path (0.100.4) #539 (applyCLIIAMToSweep): fold the CLI flag intoparamFormat.Defaultsbefore the orchestration-path dispatch, with precedence row's ownvolume_size:>--volume-sizeCLI flag > file'sdefaults:.disk_size:remains on the rejected near-miss list, but its message now points at the real working key (volume_size:) instead of the nonexistent--disk-sizeflag.Changes
cmd/sweep.go: addedparseVolumeSizeGiB(numeric-shape parsing matchingparseCostLimit's convention — int/float/json.Number/string, plus int32 for the CLI-flag route) and avolume_sizecase inbuildLaunchConfigFromParams's switch.cmd/launch_sweep.go: addedapplyCLIVolumeSizeToSweep, wired in before the detached/foreground dispatch, same seam asapplyCLISpendControlsToSweep/applyCLIIAMToSweep.cmd/sweep_keys.go:volume_sizemoved fromreservedRowKeys(rejected) torecognizedRowKeys(real key);disk_size's message corrected to point atvolume_size:instead of--disk-size.CHANGELOG.md:### Fixedentry under[Unreleased]covering both issues.Structural guard test (not added — rationale)
The issue suggested a test walking
launchCmd.Flags()to assert sweep-path coverage of every flag. I scoped this out:launchCmdregisters ~130 flags, many legitimately CLI-only or applied viabaseConfigcopy rather than adefaults:fold (--interactive,--wait-for-running,--mode,--regions-*,--strata-*,--nist-*, etc.). A blanket assertion would need a large, hand-maintained allowlist to avoid false positives — itself a nontrivial design task — so I left it out of scope for this fix rather than ship a low-signal guard.Test plan
cmd/sweep_volume_size_test.go: precedence (row > CLI > file), row-still-wins, real-key-not-passthrough, bad-value errors,parseVolumeSizeGiBshape coverage.cmd/sweep_keys_test.go: addeddisk_sizecase toTestClassifyRowKeyRejects, plusTestVolumeSizeIsNoLongerRejectedandTestDiskSizeMessageNamesTheRealFlag.test/e2e/tier0_sweep_volume_size_test.go. Since Substrate (pinned v0.97.0) doesn't wireRunInstances'BlockDeviceMappingsinto any queryableDescribeVolumesrecord (confirmed empirically — a launch with--volume-size 77followed byDescribeVolumesreturns zero volumes), these tests use a small recording reverse-proxy that decodes the realBlockDeviceMapping.1.Ebs.VolumeSizeoff the wire-levelRunInstancesrequest and forwards it unmodified to Substrate — strictly stronger than aDescribeVolumesassertion would have been.--volume-size 60, and (b) rejectsvolume_size:in a param file with the old--disk-sizemessage; restored the fix and confirmed all 4 new Tier 0 tests pass.make checkclean.make check-docsclean (flag help text unchanged, no doc drift).lambda/*/go.modmodules build clean (go -C lambda/<dir> build ./...), no drift.go test -tags=e2e_tier0 ./test/e2e/...) green.Cost safety: one real-AWS verification instance was launched and independently confirmed terminated during manual testing (before switching entirely to Substrate-backed testing for the remainder of this work).