feat(snapshots): Add --all-image-file-names-as-regex flags#3316
Open
NicoHinderling wants to merge 3 commits into
Open
feat(snapshots): Add --all-image-file-names-as-regex flags#3316NicoHinderling wants to merge 3 commits into
NicoHinderling wants to merge 3 commits into
Conversation
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>
Contributor
|
mtopo27
approved these changes
May 28, 2026
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
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>
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 regex variants of the
--all-image-file-namesflags 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 lineAll four
--all-image-*flags are mutually exclusive (enforced via a clapArgGroup). 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_regexin the manifest JSON, separate from the existingall_image_file_namesfield.Companion docs PR: https://github.com/getsentry/sentry-docs/pull/TODO (on
nico/docs-snapshots-selective-removal-detectionbranch)