feat(build): Add --selective flag to snapshots command#3268
Merged
NicoHinderling merged 6 commits intomasterfrom Apr 15, 2026
Merged
feat(build): Add --selective flag to snapshots command#3268NicoHinderling merged 6 commits intomasterfrom
NicoHinderling merged 6 commits intomasterfrom
Conversation
Accept a file listing all expected preview names so that images not present in the upload directory are reported as 'skipped' rather than 'removed'. Validates that every uploaded image appears in the provided list. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
The --all-image-names file now accepts newline-delimited, comma-separated, or a mix of both formats. Co-Authored-By: Claude <noreply@anthropic.com>
Add doc comment to the manifest field, remove unnecessary type annotation, and move validation before upload so unknown images fail fast without waiting for the upload to complete. Co-Authored-By: Claude <noreply@anthropic.com>
szokeasaurusrex
approved these changes
Apr 15, 2026
rbro112
reviewed
Apr 15, 2026
| --head-sha <head_sha> | ||
| The VCS commit sha to use for the upload. If not provided, the current commit sha will be | ||
| used. | ||
| --all-image-names <PATH> |
Member
There was a problem hiding this comment.
I'd elaborate on what a "missing" image is and what this list does to clarify this more. Maybe "Path to a file containing a list of preview names (...). Sentry will use this list to determine what images to diff. Any image in this list will be diffed against the base. Images not uploaded, but present in this list will be marked as 'skipped' rather than 'removed'."
rbro112
reviewed
Apr 15, 2026
| --head-sha <head_sha> | ||
| The VCS commit sha to use for the upload. If not provided, the current commit sha will be | ||
| used. | ||
| --all-image-names <PATH> |
Member
There was a problem hiding this comment.
Also name suggestions: --all-snapshot-file-names or --all-image-file-names, or --diffable-image-file-names
Contributor
Author
There was a problem hiding this comment.
switched to all-image-file-names (in addition to adding the new "selective" flag)
…ll-image-file-names Add --selective boolean flag to indicate the upload contains only a subset of images. Without --all-image-file-names, removals and renames cannot be detected on PRs. With --all-image-file-names, they are. --all-image-file-names now requires --selective (enforced by clap). Add manifest serialization tests for the new fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 tasks
Remove the --all-image-file-names flag entirely, keeping only --selective. Simplifies the selective upload flow by dropping the image name list feature. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NicoHinderling
added a commit
to getsentry/sentry
that referenced
this pull request
Apr 16, 2026
…_image_file_names (#113006) ## Summary Adds backend support for the new sentry-cli `--selective` flag ([sentry-cli PR #3268](getsentry/sentry-cli#3268)). - **`selective` boolean** added to upload API and manifest - **`all_image_names` renamed to `all_image_file_names`** to match CLI naming - **Three categorization modes:** - `selective` + `all_image_file_names`: can distinguish removed vs skipped (like Happo/Chromatic) - `selective` only: all missing base images treated as skipped, no removals (like Argos `--subset`) - Full build: missing = removed (existing behavior) - **Validation:** `all_image_file_names` requires `selective`, `selective` requires `base_sha` - **Baseline guard:** selective builds excluded from `find_base_snapshot_artifact` via `is_selective` DB field and don't trigger waiting-heads comparisons ## Test plan - [x] Unit tests for 3-branch categorization logic (selective+names, selective-only, full) - [x] API validation tests (selective requires base_sha, names requires selective, names rejects empty) - [x] Selective build without names: all missing = skipped - [x] Selective build with names: removed vs skipped distinguished - [x] Fingerprinting excludes skipped images for auto-approval --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
--selectiveflag tosentry-cli build snapshotsto indicate the uploadcontains only a subset of images (e.g. due to sharding or selective test
execution).
The command validates that every uploaded image is listed in the provided
file, failing early if an unknown image is found.