feat(snapshot): add inspect command for local snapshots#354
Closed
gtsiolis wants to merge 1 commit into
Closed
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. Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
6bb1c32 to
d30594a
Compare
Member
Author
|
Closing as duplicate of #354. |
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.Note
This branch rebases the work from #331 onto the latest
main(picking up thePullSkippableEvent/ESC-to-skip changes from #341). The cherry-pick applied cleanly with no textual conflicts; both new events coexist in the sink/format switch lists.