Repository navigation
refactor(aws): split client.go into domain files (#322 #323 #324) - #336
Merged
Merged
Conversation
Pure same-package reorganization of the 2379-LOC pkg/aws/client.go, no behavior change. All methods hang off the single-field *Client, so moves are mechanical. - tags.go (NEW): buildTags + managedResourceTags + propagatableSnapshotTags + intToBase36/slugifyDNSLabel helpers. #324: added section comments to buildTags (base/naming/lifecycle/notify/storage/jobarray/custom). - securitygroup.go (NEW): CreateOrGet{MPI,Windows,DCV}SecurityGroup, EnsureLustrePorts, GetDefaultVPC, sgHasUDP8443. - ebs.go (NEW): buildBlockDevices, AttachDeviceName, estimateVolumeSize, rootVolumeSizeFrom{AMI,Mappings}. - iam.go (existing): moved SetupSporedIAMRole + waitForInstanceProfile + sporedDCVRolePolicy const here. #323: extracted the inline assume-role trust policy to a named sporedTrustPolicy const. - client.go: now construction + Launch + instance lifecycle (2379→~1340). Verified: func inventory conserved (60 → 58 in client-family + 2 into iam); go build ./..., go vet, gofmt clean; full pkg/aws test suite green incl. TestBuildInlinePolicy (the statement-count gotcha); rebuilt bin/spawn and diffed the full command+flag tree against main — byte-identical. Part of the 2026-07-11 audit (#328, Phase 3).
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Jul 11, 2026
Closed
scttfrdmn
added a commit
that referenced
this pull request
Jul 15, 2026
Finish the pkg/aws god-package split begun in #336. GetEFSDNSName moves to efs.go; LookupEC2OnDemandPrice and its regionToLocationName map move to pricing.go (the map is only used by that function). Same-package move — all callers and the exported API are unchanged. client.go drops from 1350 to 1251 LOC of cohesive client/launch/lifecycle code. Closes #325.
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 #322, #323, #324. Part of the audit tracker #328 (Phase 3). Pure internal reorganization — zero behavior change, public API unchanged.
What moved
pkg/aws/client.gowas 2379 LOC / 60 funcs. Every method hangs off the single-fieldtype Client struct { cfg aws.Config }, so moving methods between same-package files is 100% mechanical.tags.go(new)buildTags,managedResourceTags,propagatableSnapshotTags,intToBase36,slugifyDNSLabelsecuritygroup.go(new)CreateOrGet{MPI,Windows,DCV}SecurityGroup,EnsureLustrePorts,GetDefaultVPC,sgHasUDP8443ebs.go(new)buildBlockDevices,AttachDeviceName,estimateVolumeSize,rootVolumeSizeFrom{AMI,Mappings}iam.go(existing)SetupSporedIAMRole,waitForInstanceProfile,sporedDCVRolePolicyconstclient.goLaunch+ instance lifecycle (→ ~1340 LOC)Bundled cleanups
sporedTrustPolicyconst, alongsidesporedDCVRolePolicyiniam.go.buildTags(base identity / naming & DNS / lifecycle / notifications / storage / job-array / custom) — comment-only.Verification
go build ./...,go vet ./pkg/aws,gofmt -lclean.go test ./pkg/awsgreen, includingTestBuildInlinePolicy(the hardcoded spored-statement-count assertion — unchanged, this PR doesn't touch the policy).bin/spawnand diffed the full recursive command+flag tree againstmain→ byte-identical (a pkg-internal split must be invisible to the CLI).TestCatalogValid(feat(plugin): permissions declaration block (#388) #392) still fails onmain.