Skip to content

Implement --dry-run flag for snapshot load#272

Merged
anisaoshafi merged 2 commits into
mainfrom
devx-869-implement-dry-run-flag-for-snapshot-load
Jul 24, 2026
Merged

Implement --dry-run flag for snapshot load#272
anisaoshafi merged 2 commits into
mainfrom
devx-869-implement-dry-run-flag-for-snapshot-load

Conversation

@anisaoshafi

@anisaoshafi anisaoshafi commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Added --dry-run to lstk snapshot load.
When passed with a pod ref, it calls GET /_localstack/pods/{name}/diff instead of loading, and shows a per-service preview of what would be added or modified, without touching running state.

Local snapshot refs return an error since the emulator has no diff endpoint for them.

The --merge flag is also accepted to contextualize the output.

event output
loading Screenshot 2026-05-28 at 19 41 21
success image
error image

ℹ️ Deletions are not tracked, because it's not implemented in cloud pods' backend (in emulator).
ℹ️ During lstk snapshot load --dry-run (pod refs only), --merge is ignored because GET /_localstack/pods/{name}/diff endpoint which is computed by the emulator doesn't support a strategy param, so it has zero effect on the diff computation itself.

@anisaoshafi
anisaoshafi force-pushed the devx-869-implement-dry-run-flag-for-snapshot-load branch 4 times, most recently from 6eba568 to 6cd63f7 Compare May 28, 2026 17:56
@anisaoshafi
anisaoshafi marked this pull request as ready for review May 29, 2026 11:12
@anisaoshafi
anisaoshafi marked this pull request as draft May 29, 2026 16:46
@anisaoshafi
anisaoshafi force-pushed the devx-869-implement-dry-run-flag-for-snapshot-load branch from 6cd63f7 to 984508f Compare July 22, 2026 16:36
@anisaoshafi anisaoshafi added the docs: skip Pull request does not require documentation changes label Jul 22, 2026
@anisaoshafi
anisaoshafi marked this pull request as ready for review July 23, 2026 14:47
@anisaoshafi
anisaoshafi requested a review from a team as a code owner July 23, 2026 14:47

@skyrpex skyrpex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me but I wonder: would it make sense to have a lstk snapshot diff command instead? 🤔

@anisaoshafi

Copy link
Copy Markdown
Collaborator Author

Looks good to me but I wonder: would it make sense to have a lstk snapshot diff command instead? 🤔

Thanks @skyrpex 🙌🏼
@gtsiolis what do you think about an lstk snapshot diff alias that does the same? Could it be confused with sth different? Thanks 🙏🏼

@anisaoshafi

Copy link
Copy Markdown
Collaborator Author

Merging for now, open to later feedback.

@anisaoshafi
anisaoshafi merged commit e7c555b into main Jul 24, 2026
17 checks passed
@anisaoshafi
anisaoshafi deleted the devx-869-implement-dry-run-flag-for-snapshot-load branch July 24, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes semver: patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants