Commit 48c1f24
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
- src
- api
- commands/snapshots
- tests/integration
- _cases/snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments