feat(snapshot): add inspect command for local snapshots#331
Open
gtsiolis wants to merge 1 commit into
mainlocalstack/lstk:mainfrom
pro-322-add-inspect-command-for-local-snapshotslocalstack/lstk:pro-322-add-inspect-command-for-local-snapshotsCopy head branch name to clipboard
Open
feat(snapshot): add inspect command for local snapshots#331gtsiolis wants to merge 1 commit intomainlocalstack/lstk:mainfrom pro-322-add-inspect-command-for-local-snapshotslocalstack/lstk:pro-322-add-inspect-command-for-local-snapshotsCopy head branch name to clipboard
gtsiolis wants to merge 1 commit into
mainlocalstack/lstk:mainfrom
pro-322-add-inspect-command-for-local-snapshotslocalstack/lstk:pro-322-add-inspect-command-for-local-snapshotsCopy head branch name to clipboard
Conversation
Add `lstk snapshot inspect <file>`, an offline size breakdown of a local .snapshot archive — no running emulator, no platform call, no auth. It opens the ZIP and tallies bytes per service, combining each service's control-plane state (api_states/) and data-asset payloads (assets/) and aggregating across accounts and regions. Output is one row per service, sorted largest-first, with percentages and a grand total; --json emits the same data for scripts and agents. Cloud (pod:) refs are rejected and pointed at `snapshot show`. Complements `snapshot show`, which reports cloud metadata and resource counts.
Collaborator
|
We are adding json output format for the first time here. What about removing it from here, but do an overall implementation later over all commands that return structured data? My biggest worry is that this becomes the contract we have to stick to as soon as we release it and we should be deliberate about how we format this json (case, structure etc). |
Member
Author
|
Good observation! 😁 Absolutely, already tracked in PRO-307 (draft branch). I will remove from this PR. |
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.
What
Adds
lstk snapshot inspect <file>— an offline, per-service size breakdown of a local.snapshotarchive.No running emulator, no platform call, no auth.
Why
snapshot showis cloud-only and reports resource counts plus one aggregate size — it can't answer "what's eating the space in my local snapshot?".inspectreads the archive directly and attributes bytes per service, combining each service's control-plane state (api_states/) and data payloads (assets/), aggregated across accounts and regions.Details
.snapshotZIP with stdlibarchive/zipand tallies sizes per entry — no emulator, platform, or auth.--jsonemits the same data (raw bytes) for scripts and agents.pod:) refs are rejected and pointed atsnapshot show.SnapshotInspectedEventwith plain + TUI rendering parity. Unit + integration tests; no Docker required.Fix PRO-322.