You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 23, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 23, 2026. It is now read-only.
snapshots upload --selective with an empty image dir creates no snapshot even when --all-image-file-names-file lists the full suite #1397
sentry-cli snapshots upload given an empty directory prints "No image files found" and returns early without creating a snapshot, even when --all-image-file-names-file is passed with the complete image list. This makes it impossible to record an "all unchanged" build for a selective upload.
Context
We use selective uploads for PR visual diffing: on each PR we diff against a baseline and upload only changed/added images with --selective --all-image-file-names-file <all names>. The names file is meant to let Sentry tell "skipped" (unchanged, still present) apart from "removed".
Problem
For any PR that changes no images, the selective staging directory is empty. snapshots upload early-returns: in src/commands/snapshots/upload.rs, the if images.is_empty() { ... return Ok(()) } guard runs before--all-image-file-names-file is parsed and before the manifest is POSTed. Result: the PR gets no snapshot build at all, so there is nothing for reviewers/checks to see, and the "everything unchanged" state cannot be represented.
Expected
When --all-image-file-names-file (or --all-image-file-names) is provided, a selective upload with zero image files should still create a snapshot/manifest that references the full name list as unchanged, instead of early-returning.
Version
sentry-cli 3.6.0
Workaround
We currently skip the upload entirely when nothing changed, accepting that all-unchanged PRs have no snapshot build.
Solution Brainstorm
When --all-image-file-names/--all-image-file-names-file is present, treat the name list (not the on-disk image count) as the source of truth for what the snapshot should contain, so an empty upload directory is a valid "everything unchanged" case rather than a no-op.
Concretely, in src/commands/snapshots/upload.rs::execute, the early if images.is_empty() { return Ok(()) } guard fires before --all-image-file-names-file is parsed and before the manifest is POSTed. A zero-image selective upload with a full name list could instead build and POST a manifest with no changed image entries, letting the server record every listed name as unchanged/skipped.
Options, roughly in order of preference:
Skip the empty-dir early return when a full name list is provided, and POST an empty-images manifest (selective: true, full all_image_file_names). The server already knows how to reconcile skipped vs removed from that list.
Add an explicit flag (e.g. --allow-empty) that opts into creating an all-unchanged snapshot.
At minimum, exit non-zero (or warn loudly) when --selective + a names file is given but zero images are uploaded, so callers know no snapshot was created instead of it silently succeeding.
Our current workaround is to detect the zero-change case ourselves and skip the upload, which leaves those PRs without a snapshot build.
Hey @joshdholtz, I am transferring this issue over to the repository of the new Sentry CLI, as we expect the new CLI will fully replace this CLI in the future and are therefore no longer adding new features here.
already covered by #1398 (open, CI green, Closes #1397) — it moves the full-name-list resolution before the empty-dir early return and posts an empty selective manifest instead of no-opping. standing down so this doesn't duplicate that PR; happy to review it if useful.
Activity
linear-code commentedon Aug 5, 2026
CLI-354
EME-1290
szokeasaurusrex commentedon Aug 10, 2026
Hey @joshdholtz, I am transferring this issue over to the repository of the new Sentry CLI, as we expect the new CLI will fully replace this CLI in the future and are therefore no longer adding new features here.
jared-outpost commentedon Aug 10, 2026
already covered by #1398 (open, CI green,
Closes #1397) — it moves the full-name-list resolution before the empty-dir early return and posts an empty selective manifest instead of no-opping. standing down so this doesn't duplicate that PR; happy to review it if useful.fix(snapshots): create all-unchanged selective uploads (#1398)
betegon commentedon Aug 10, 2026
Hey @joshdholtz! thanks for filing this one. we merged a fix for it, and we'll cut a new CLI release early this week.
It's already available on our nightly channel, so it'd be awesome if you could try it out. just run:
and then rerun the upload command
fix(snapshots): Upload empty selective manifests (#3395)