Repository navigation
feat(cli): Allow repeated and combined strip flags in sourcemap upload - #2598
Merged
Merged
Conversation
As in sentry-cli, `--strip-prefix` can be repeated (each path loses the first prefix it starts with) and combined with `--strip-common-prefix`. In `sources`, the common prefix is tried after the explicit prefixes, as rust-sourcemap's `strip_prefixes` did. Uploaded file paths lose the explicit prefix first, then the common prefix of what's left. Fixes #2596 Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…repeatable Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
BYK
approved these changes
Nov 30, 2026
This branch was successfully deployed
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.
Fixes #2596. Follow-up to #2584 (which fixed #2576).
What sentry-cli did
--strip-prefixcould be given more than once, and--strip-common-prefixjust added rust-sourcemap's~(common prefix) entry to the end of the same list.strip_prefixesthen removed, from each source, the first prefix in that list it started with.What v4 did
sentry sourcemap uploadtook a single--strip-prefixand rejected it together with--strip-common-prefix(the check predates #2584).What v4 does now
--strip-prefixis repeatable. Each uploaded file path and eachsourcesentry loses the first prefix it starts with, still only at a/boundary.--strip-prefixand--strip-common-prefixcan be used together:sources, the map's common prefix is tried after the explicit prefixes, first match wins, as in sentry-cli;--strip-prefix build --strip-common-prefixturnsbuild/assets/js/main.jsandbuild/assets/js/vendor.jsintomain.jsandvendor.js.The flag help, the generated skill reference, and the v3 migration guide describe this.
via @BYK.
--
View Session [Sentry]