From ff9a907e2f045eb64fd9a6f6322086e04059f6d9 Mon Sep 17 00:00:00 2001 From: Nico Hinderling Date: Tue, 19 May 2026 11:31:33 -0700 Subject: [PATCH 1/3] docs(snapshots): Document selective uploads for subset/sharded CI runs Adds a Selective Uploads section to the uploading snapshots product docs explaining the --selective flag behavior: only uploaded snapshots are diffed, missing ones are treated as unchanged, and selective uploads with the same commit SHA and app-id are merged. Co-Authored-By: Claude --- .../snapshots/uploading-snapshots/index.mdx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/product/snapshots/uploading-snapshots/index.mdx b/docs/product/snapshots/uploading-snapshots/index.mdx index bb5542c981c9c..52276c2d02e71 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 Uploads + +If you only generate a subset of your snapshots per CI run — for example, because you shard tests across parallel jobs or run only affected tests — 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/). From 6d9fb42002ee7b9683de443f7186a26c9a29b18e Mon Sep 17 00:00:00 2001 From: Nico Hinderling Date: Tue, 19 May 2026 11:37:32 -0700 Subject: [PATCH 2/3] fix(snapshots): Remove incorrect "on PRs" qualifier from selective uploads caveat The limitation that removals and renames cannot be detected with --selective applies universally, not just on PRs. Align the CLI reference with the product docs. Co-Authored-By: Claude --- docs/cli/snapshots.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 264a6b89f631f1a16c2c06e76475a9b58d2e32c5 Mon Sep 17 00:00:00 2001 From: Nico Hinderling Date: Tue, 19 May 2026 11:47:53 -0700 Subject: [PATCH 3/3] docs(snapshots): Rename section to Selective Testing and reorder examples Address review feedback: "Selective Testing" is a more familiar term than "Selective Uploads", and running affected tests is a more common use case than sharding. Co-Authored-By: Claude --- docs/product/snapshots/uploading-snapshots/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/product/snapshots/uploading-snapshots/index.mdx b/docs/product/snapshots/uploading-snapshots/index.mdx index 52276c2d02e71..b161fb167bb5a 100644 --- a/docs/product/snapshots/uploading-snapshots/index.mdx +++ b/docs/product/snapshots/uploading-snapshots/index.mdx @@ -65,9 +65,9 @@ Snapshots supports the following image formats: - PNG - JPEG -## Selective Uploads +## Selective Testing -If you only generate a subset of your snapshots per CI run — for example, because you shard tests across parallel jobs or run only affected tests — pass the `--selective` flag on each upload: +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