Skip to content

Commit 48c1f24

Browse files
feat(snapshots): Add download command for baseline snapshots (#3310)
## Summary - Adds `sentry-cli snapshots download` command for downloading baseline snapshot images from Sentry's preprod system to a local directory - Supports `--app-id` (resolves latest baseline snapshot) or `--snapshot-id` (direct artifact ID), with optional `--branch` filter - Downloads a ZIP from the server and extracts images to `--output` directory (default `./snapshots-base/`) - Adds two API methods: `get_latest_base_snapshot` and `download_snapshot_zip` ### Usage ```bash # Download latest baselines for an app sentry-cli snapshots download --app-id sentry-frontend # Download from a specific branch sentry-cli snapshots download --app-id sentry-frontend --branch main # Download a specific snapshot by ID sentry-cli snapshots download --snapshot-id 259299 # Full local visual regression workflow sentry-cli snapshots download --app-id sentry-frontend pnpm run snapshots sentry-cli snapshots diff ./snapshots-base .artifacts/snapshots --fail-on-diff ``` ## Test plan - [x] `cargo clippy -- -Dwarnings` passes clean - [x] `cargo fmt --check` passes - [x] `cargo test snapshots` — all 4 integration tests pass (including new download help test) - [ ] Manual test: run `sentry-cli snapshots download --app-id sentry-frontend` against real Sentry org 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a9013c4 commit 48c1f24

8 files changed

Lines changed: 1320 additions & 745 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
/src/commands/snapshots @getsentry/emerge-tools @getsentry/owners-sentry-cli
2020
/src/utils/odiff @getsentry/emerge-tools @getsentry/owners-sentry-cli
2121
/tests/integration/build @getsentry/emerge-tools @getsentry/owners-sentry-cli
22+
/tests/integration/snapshots.rs @getsentry/emerge-tools @getsentry/owners-sentry-cli
23+
/tests/integration/_cases/snapshots @getsentry/emerge-tools @getsentry/owners-sentry-cli
2224

2325
# Files without codeowner protection
2426
/CHANGELOG.md

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Features
66

77
- (snapshots) Add `snapshots diff` command for locally comparing directories of PNG snapshot images using odiff ([#3306](https://github.com/getsentry/sentry-cli/pull/3306))
8+
- (snapshots) Add `snapshots download` command for downloading baseline snapshot images from Sentry ([#3310](https://github.com/getsentry/sentry-cli/pull/3310))
89

910
### Fixes
1011

0 commit comments

Comments
 (0)