diff --git a/docs/cli/snapshots.mdx b/docs/cli/snapshots.mdx index c91be11a746c8..d1d986110ffec 100644 --- a/docs/cli/snapshots.mdx +++ b/docs/cli/snapshots.mdx @@ -59,7 +59,7 @@ sentry-cli build snapshots ./shard-1 --app-id web-frontend --selective sentry-cli build snapshots ./shard-2 --app-id web-frontend --selective ``` -Sentry merges selective uploads that share the same commit SHA and `app-id`. Removals and renames cannot be detected on PRs when using `--selective`, because Sentry cannot distinguish an intentionally deleted snapshot from one that simply wasn't part of this shard. +Sentry merges selective uploads that share the same commit SHA and `app-id`. Removals and renames cannot be detected when using `--selective`, because Sentry cannot distinguish an intentionally deleted snapshot from one that simply wasn't part of this shard. ## Diff Threshold diff --git a/docs/product/snapshots/uploading-snapshots/index.mdx b/docs/product/snapshots/uploading-snapshots/index.mdx index bb5542c981c9c..b161fb167bb5a 100644 --- a/docs/product/snapshots/uploading-snapshots/index.mdx +++ b/docs/product/snapshots/uploading-snapshots/index.mdx @@ -65,4 +65,21 @@ Snapshots supports the following image formats: - PNG - JPEG +## Selective Testing + +If you only generate a subset of your snapshots per CI run — for example, because you run only affected tests or shard across parallel jobs — pass the `--selective` flag on each upload: + +```bash +sentry-cli build snapshots ./shard-1 --app-id web-frontend --selective +sentry-cli build snapshots ./shard-2 --app-id web-frontend --selective +``` + +When an upload is marked as selective, Sentry only diffs the snapshots you uploaded. Any snapshot that exists in the base build but was not included in the upload is treated as **unchanged** (skipped) rather than removed. Sentry merges selective uploads that share the same commit SHA and `app-id`, so you can upload shards independently and they combine into a single build. + + + Because Sentry cannot distinguish a deliberately deleted snapshot from one + that was not part of the subset, removals and renames cannot be detected when + using `--selective`. + + For the full `sentry-cli build snapshots` flag reference, see [Snapshots (CLI)](/cli/snapshots/).