Skip to content

feat(cli): Allow repeated and combined strip flags in sourcemap upload - #2598

Merged
BYK merged 2 commits into
mainfrom
byk/cli-strip-prefix-repeatable
Nov 30, 2026
Merged

BYK merged 2 commits into
mainfrom
byk/cli-strip-prefix-repeatable

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #2596. Follow-up to #2584 (which fixed #2576).

What sentry-cli did

--strip-prefix could be given more than once, and --strip-common-prefix just added rust-sourcemap's ~ (common prefix) entry to the end of the same list. strip_prefixes then removed, from each source, the first prefix in that list it started with.

What v4 did

sentry sourcemap upload took a single --strip-prefix and rejected it together with --strip-common-prefix (the check predates #2584).

What v4 does now

  • --strip-prefix is repeatable. Each uploaded file path and each sources entry loses the first prefix it starts with, still only at a / boundary.
  • --strip-prefix and --strip-common-prefix can be used together:
    • in sources, the map's common prefix is tried after the explicit prefixes, first match wins, as in sentry-cli;
    • in uploaded file paths (which sentry-cli never stripped), the explicit prefix is removed first, then the common prefix of the paths left after that. For example, --strip-prefix build --strip-common-prefix turns build/assets/js/main.js and build/assets/js/vendor.js into main.js and vendor.js.

The flag help, the generated skill reference, and the v3 migration guide describe this.

via @BYK.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 30, 2026 10:39
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>
@sentry-junior
sentry-junior Bot requested a review from BYK November 30, 2026 10:41
@vercel

vercel Bot commented Nov 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 30, 2026 10:41am UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 30, 2026 10:41am UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 30, 2026
@BYK
BYK enabled auto-merge November 30, 2026 10:49
@BYK
BYK added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 1f864ae Nov 30, 2026
28 checks passed
@BYK
BYK deleted the byk/cli-strip-prefix-repeatable branch November 30, 2026 10:58

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — 468b5a1a Deployed Nov 30, 2026 by vercel[bot]
Preview – sentry-local — 468b5a1a Deployed Nov 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sourcemap upload: support repeated and combined strip flags sourcemap upload can't rewrite sources paths inside maps

1 participant