Skip to content

feat(snapshots): Add --all-image-file-names-as-regex flags#3316

Open
NicoHinderling wants to merge 3 commits into
masterfrom
feat/all-image-file-names-as-regex
Open

feat(snapshots): Add --all-image-file-names-as-regex flags#3316
NicoHinderling wants to merge 3 commits into
masterfrom
feat/all-image-file-names-as-regex

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

Add regex variants of the --all-image-file-names flags for selective snapshot uploads. Users can now specify regex patterns instead of literal file names to identify the full set of images in their test suite, enabling removal and rename detection in selective mode.

Two new flags:

  • --all-image-file-names-as-regex <PATTERNS> — comma-separated regex patterns
  • --all-image-file-names-as-regex-file <PATH> — file with one regex pattern per line

All four --all-image-* flags are mutually exclusive (enforced via a clap ArgGroup). Regex patterns are validated at parse time (fail-fast on invalid patterns) and anchored with ^(?:...)$ for full-string matching during upload validation, consistent with the literal flags' exact-match semantics.

Patterns are sent to the backend as all_image_file_names_as_regex in the manifest JSON, separate from the existing all_image_file_names field.

Companion docs PR: https://github.com/getsentry/sentry-docs/pull/TODO (on nico/docs-snapshots-selective-removal-detection branch)

Add regex variants of the --all-image-file-names flags for selective
snapshot uploads. Users can now specify regex patterns instead of
literal file names to identify the full set of images in their test
suite, enabling removal and rename detection in selective mode.

All four flags (literal inline/file, regex inline/file) are mutually
exclusive via a clap ArgGroup. Regex patterns are validated at parse
time and anchored for full-string matching during upload validation.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against bffa71d

Co-Authored-By: Claude <noreply@anthropic.com>
@NicoHinderling NicoHinderling marked this pull request as ready for review May 28, 2026 20:34
@NicoHinderling NicoHinderling requested review from a team as code owners May 28, 2026 20:34
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dae87db. Configure here.

Comment thread src/commands/snapshots/upload.rs Outdated
Patterns using verbose mode with comments (e.g. `(?x)foo # comment`)
are valid on their own but break when anchored as `^(?:...)$` because
the comment consumes the closing group. Validate the anchored form
at parse time so we fail with a clear error instead of panicking
during upload validation.

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread src/commands/snapshots/upload.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants