Repository navigation
feat: spawn footprint in the libs/footprint schema, and spawn teardown --plan (#1653) - #1663
Merged
Merged
Conversation
…n --plan (#1653) `spawn footprint -o json` is now the shared libs/footprint Report (schema 1): every resource with arn, type, region, scope, name, tags, ownership (tagged|legacy-name|foreign), class (litter|residue|active|user-data|permanent), deletable, reason and depends_on. Breaking change to the JSON shape; the text tables stay and gain a "Teardown view". New inventory sources: managed policies under /spore-host/ (ListPolicies + ListPolicyTags), CloudFormation stacks named like spore.host's, spawn-pipeline-* SNS topics, anything tagged spore-host:managed-by by any tool, and calque's queues, calque-nfs-sg and AMIs (plus calque-* roles/profiles via the name scan), all calque/lagotto resources as ownership foreign. The rules live in pkg/footprintspawn (ownership, class, Patterns); pkg/teardown is the footprint.Deleter over the existing per-type deleters (RemoveResource, egress-proxy teardown, instancerole, bucketsweep, poolqueue's rule). Describe re-derives in-use from the live account and Delete refuses anything in use. `spawn teardown --plan <file|-> --mode report|reap`: report is the default; reap needs --yes, never runs in the infra account, and refuses without the shared-account lease unless the hidden --i-understand-no-lease is passed. libs bumped to v0.53.0. Fixes #1653
Contributor
Author
LIVE check (read-only, 2026-11-17, branch build)
Follow-ups:
|
scttfrdmn
marked this pull request as ready for review
November 17, 2026 00:03
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Fixes #1653. Part of the leave-no-trace epic spore-host/spore-host#752.
What changes
spawn footprint -o jsonnow emits the sharedlibs/footprintReport (schema 1). This breaks the JSON shape:regions/tagged[]/control_plane[]/global[]/notesare gone, replaced by{schema, tool, account, generated_at, resources[], warnings[]}. Each resource carriesarn, type, region, scope, name, ownership, class, deletable, reason, depends_on, tags. I found no consumer of the old shape in spawn, lagotto, spore-host-mcp, spawn-ts or calque (grepped clones). The one consumer inside spawn was the substrate e2e testTestTier0_Footprint_JSONIsParseable, and it is updated here. The text tables stay, with a new "Teardown view" section added.New inventory sources (
pkg/aws/footprint_report.go):/spore-host/, viaListPolicies PathPrefix=/spore-host/andListPolicyTagsDescribeStacks): arole=serviceor infra-account stack ispermanent,*_IN_PROGRESSisactive, a deployed one isresidue, a failed or rolled-back one islitterspawn-pipeline-*SNS topicsspore-host:managed-byby any tool (a second RGT query)calque-*queues,calque-nfs-sg,calque-*AMIs, and calque roles and profiles through the name scan (calque was added to the name prefixes). All of them areforeign.active.Rules (
pkg/footprintspawn, pure, one place):foreignwhen the name is calque-/lagotto-/truffle-, even if it carries a spawn tagtaggedwhenmanaged-by=spawnforeignwhenmanaged-bynames another toollegacy-namepermanent: the boundary,spore-host:permanent,role=service, or the infra accountuser-data: a results bucket not proven empty, any other bucket, AMIs and snapshots, a workstation key, an Elastic IP spawn did not allocateactive: something in use nowresidue: spawn's own machinerylitter: everything elsePatternscover exactly the typespkg/teardowncan delete, and a test holds the two sets equal.spawn teardown --plan <file|-> --mode report|reap(cmd/teardown.go,pkg/teardown):footprint.NewPlanand thenfootprint.Executewith spawn'sByTypedeleter.--yes. It refuses in the infra account or an account it cannot identify.--i-understand-no-leaseis passed. That runs under an in-process stand-in lease (alifecycletesttable) that coordinates with no one.Describere-derives "in use" from the live account, andDeleterefuses anything in use (ErrInUse). This matters becausefootprint.Deletableletsactivethrough.Gates
make checkpasses. I ran it from a space-free copy (/private/tmp), because the clone's path contains a space.scripts/check-build-tags.shgives a false failure when run through the/tmpsymlink and passes from the physical path.make api-snapshotshows additions only.make cli-iam-actionsandmake gen-docswere regenerated. semgrep is clean on the changed files. The e2e tier-0 footprint tests pass against substrate.