Skip to content

Add snapshot save command (local)#210

Merged
anisaoshafi merged 26 commits into
mainfrom
drg-764-migrate-state-commands-from-cli-v1-export
May 13, 2026
Merged

Add snapshot save command (local)#210
anisaoshafi merged 26 commits into
mainfrom
drg-764-migrate-state-commands-from-cli-v1-export

Conversation

@anisaoshafi
Copy link
Copy Markdown
Collaborator

@anisaoshafi anisaoshafi commented Apr 28, 2026

Added a new snapshot subcommand with an initial save action that saves the current LocalStack state to a snapshot file.
Scope for this PR is saving a snapshot locally.
Saving remotely coming next.

@anisaoshafi anisaoshafi force-pushed the drg-764-migrate-state-commands-from-cli-v1-export branch 4 times, most recently from f6bbfbf to 6a24cdf Compare April 28, 2026 13:42
Comment thread cmd/snapshot.go Outdated
Comment thread internal/snapshot/destination.go Outdated
Comment thread internal/snapshot/client.go Outdated
Comment thread internal/snapshot/client.go Outdated
Comment thread internal/snapshot/destination.go Outdated
@gtsiolis
Copy link
Copy Markdown
Member

I've posted a comment[1] in PRO-212 to discuss some potential changes, comments welcome!

@anisaoshafi anisaoshafi force-pushed the drg-764-migrate-state-commands-from-cli-v1-export branch from 19cab09 to cc8b494 Compare April 29, 2026 16:45
@anisaoshafi anisaoshafi force-pushed the drg-764-migrate-state-commands-from-cli-v1-export branch 5 times, most recently from e2a83f0 to b09a963 Compare May 11, 2026 17:02
@anisaoshafi anisaoshafi marked this pull request as ready for review May 11, 2026 17:27
@anisaoshafi anisaoshafi requested a review from silv-io as a code owner May 11, 2026 17:27
@anisaoshafi anisaoshafi force-pushed the drg-764-migrate-state-commands-from-cli-v1-export branch from 36170a5 to 7e45925 Compare May 11, 2026 17:47
@anisaoshafi anisaoshafi changed the title Add snapshot save command Add snapshot save command (local) May 11, 2026
@anisaoshafi anisaoshafi force-pushed the drg-764-migrate-state-commands-from-cli-v1-export branch 2 times, most recently from cc13c98 to c680041 Compare May 12, 2026 13:48
Comment thread internal/snapshot/save_test.go Outdated
Comment thread internal/snapshot/client.go Outdated
Comment thread internal/snapshot/client.go Outdated
Comment thread internal/snapshot/destination_test.go
Comment thread internal/snapshot/destination_test.go Outdated
Comment thread cmd/snapshot.go Outdated
@anisaoshafi anisaoshafi force-pushed the drg-764-migrate-state-commands-from-cli-v1-export branch from 570047a to e5dfa92 Compare May 12, 2026 16:07
@anisaoshafi
Copy link
Copy Markdown
Collaborator Author

@gtsiolis would really appreciate your UX input when you have time to test this 🙏🏼

@gtsiolis
Copy link
Copy Markdown
Member

Looking at this now! 👀

Copy link
Copy Markdown
Member

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UX LGTM on first pass. 🏁

Comment thread cmd/snapshot.go Outdated
Comment thread internal/snapshot/save.go Outdated
defer func() {
sink.Emit(output.SpinnerStop())
if retErr == nil {
sink.Emit(output.MessageEvent{Severity: output.SeveritySuccess, Text: fmt.Sprintf("Snapshot saved to %s", dest)})
Copy link
Copy Markdown
Member

@gtsiolis gtsiolis May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Nice! 🤩 Adding some screenshots for future reference.

Saving Snapshot Saved Snapshot
Image Image

Comment thread internal/snapshot/save.go Outdated
Copy link
Copy Markdown
Member

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed one important question before.

Comment thread internal/snapshot/destination.go
@anisaoshafi anisaoshafi force-pushed the drg-764-migrate-state-commands-from-cli-v1-export branch from c7c3f05 to 6bb4d82 Compare May 13, 2026 11:30
anisaoshafi and others added 26 commits May 13, 2026 16:12
Without this, a failed io.Copy left a corrupt/partial ZIP on disk.
The user had no indication the file was incomplete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Passing nil to runLstk inherited the developer's real $HOME, which
could write to ~/.config/lstk/lstk.log and the file-keyring fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Verify that ErrorEvent is routed to errOut and all other events go to
out, and that nil writer arguments fall back safely without panicking.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix AWS-only guard to correctly reject non-AWS emulator configs, align
container lookup with the for-loop pattern used in aws.go, route
ErrorEvents to stderr via NewPlainSinkSplit, and minor code clarity
improvements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@anisaoshafi anisaoshafi force-pushed the drg-764-migrate-state-commands-from-cli-v1-export branch from fd56fac to 60503f4 Compare May 13, 2026 14:13
@anisaoshafi anisaoshafi merged commit 4a70a9c into main May 13, 2026
12 checks passed
@anisaoshafi anisaoshafi deleted the drg-764-migrate-state-commands-from-cli-v1-export branch May 13, 2026 14:20
@gtsiolis
Copy link
Copy Markdown
Member

That's one small step for snapshots, one giant leap for LocalStack. 💿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants