Skip to content

Conversation

@szokeasaurusrex
Copy link
Member

@szokeasaurusrex szokeasaurusrex commented Dec 3, 2025

Align debug ID injection with the relevant TC39 proposal by upgrading the sourcemap crate to 9.3.0, which serializes the Debug ID on a sourcemap under the "debugId" key, instead of the "debug_id" key. The crate still supports reading the "debug_id" key, but the "debugId" key takes precedence if both keys are present.

These changes primarily affect the sourcemaps inject command, which will now place the debug ID in the "debugId" field rather than the "debug_id" field. The sourcemaps upload command is also affected, as sourcemaps will be rewritten with "debugId" rather than "debug_id". Previously, rewriting preserved the key being used; if a sourcemap contained both keys, both would have been preserved after rewriting, but after these changes, we emit only "debugId". For example, if a sourcemap contains only the "debug_id" key, the rewritten sourcemap will have that key in "debugId" instead; however, if a sourcemap contains both the "debugId" and the "debug_id" keys, the "debug_id" is completely stripped, and its value ignored.

Closes #2221
Closes CLI-44

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

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

Generated by 🚫 dangerJS against a7bea4b

@linear
Copy link

linear bot commented Dec 3, 2025

szokeasaurusrex added a commit to getsentry/rust-sourcemap that referenced this pull request Dec 4, 2025
…134)

The debug ID field on all source maps is now **serialized as `debugId` rather than `debug_id`**.

To maintain backwards-compatibility with source maps that contain a `debug_id` field, we can still read the `debug_id` field. If a source map contains a `debugId` field and a `debug_id` field, **the `debugId` field takes precedence, which is a change from the old behavior**. 

Corresponding Sentry CLI PR: getsentry/sentry-cli#3005

Closes #96 
Closes [CLI-240](https://linear.app/getsentry/issue/CLI-240/turn-debug-id-field-to-debugid)
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/debugId branch from b3b6e0d to bb32428 Compare December 4, 2025 10:57
@szokeasaurusrex szokeasaurusrex changed the title [wip] inject debugId, not debug_id feat(sourcemaps): Inject debugId into sourcemaps, not debug_id Dec 4, 2025
(#3005)

Align debug ID injection [with the relevant TC39
proposal](https://github.com/tc39/ecma426/blob/main/proposals/debug-id.md#debug-ids-in-source-maps)
by upgrading the `sourcemap` crate to
[9.3.0](https://github.com/getsentry/rust-sourcemap/releases/tag/9.3.0),
which serializes the Debug ID on a sourcemap [under the `"debugId"` key,
instead of the `"debug_id"`
key](getsentry/rust-sourcemap#134). The crate
still supports reading the `"debug_id"` key, but the `"debugId"` key
takes precedence if both keys are present.

These changes primarily affect the `sourcemaps inject` command, which
will now place the debug ID in the `"debugId"` field rather than the
`"debug_id"` field. The `sourcemaps upload` command is also affected, as
sourcemaps will be rewritten with `"debugId"` rather than `"debug_id"`.
Previously, rewriting preserved the key being used; if a sourcemap
contained both keys, both would have been preserved after rewriting, but
after these changes, we emit only `"debugId"`. For example, if a
sourcemap contains only the `"debug_id"` key, the rewritten sourcemap
will have that key in `"debugId"` instead; however, if a sourcemap
contains both the `"debugId"` and the `"debug_id"` keys, the
`"debug_id"` is completely stripped, and its value ignored.

Closes #2221 Closes
[CLI-44](https://linear.app/getsentry/issue/CLI-44/time-capsule-dont-open-before-nov-6-2025-emit-debugid-instead-of-debug)
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/debugId branch from bb32428 to a7bea4b Compare December 4, 2025 12:14
@szokeasaurusrex szokeasaurusrex changed the base branch from v3 to graphite-base/3005 December 4, 2025 12:15
@szokeasaurusrex szokeasaurusrex changed the base branch from graphite-base/3005 to szokeasaurusrex/remove-metrics December 4, 2025 12:15
@szokeasaurusrex szokeasaurusrex added the v3.0 Breaking changes to include in version 3.0.0 of Sentry CLI label Dec 4, 2025
@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review December 4, 2025 12:15
@szokeasaurusrex szokeasaurusrex requested a review from a team as a code owner December 4, 2025 12:15
Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

> Bundling completed in [..]
> Bundled 2 files for upload
> Bundle ID: 0b10dfbf-7d11-52a5-9107-d16f625896ad
> Bundle ID: b87a18c0-0d49-5771-bb15-cb1654bc9129
Copy link
Member Author

Choose a reason for hiding this comment

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

Bundle ID changes because the rewritten sourcemap contains debugId, not debug_id. Elsewhere, the hashes we are checking are changing for the same reason

}

/// Tests that debug IDs can be found under the "debugId" field in sourcemaps.
/// Tests that debug IDs can be found under the old "debug_id" field in sourcemaps.
Copy link
Member Author

Choose a reason for hiding this comment

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

As debugId is now the default, I inverted this test as part of this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, just to understand this: the test fixture already contained both debug_id and debugId with different values, so you just need to change from one value to the other here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I guess what I wrote was a bit misleading, I also kinda forgot exactly what I did here 😅

The test previously was checking that if we had "debug_id" and "debugId", we select the "debug_id". I changed the test instead to check that if we only have "debug_id", we can still read the "debug_id". I don't have a test right now that checks the precedence (although, I think it is also fine to keep things that way, as I think this is more an internal detail of the sourcemap create).

"debug_id" still has the same value it had before. This is the relevant fixture, you can see that I just removed the "debugId".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3.0 Breaking changes to include in version 3.0.0 of Sentry CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants