fix(sourcemaps): don't attempt to treat remote URL as a local file path#1850
Merged
loewenheim merged 2 commits intogetsentry:masterfrom Dec 1, 2023
Merged
fix(sourcemaps): don't attempt to treat remote URL as a local file path#1850loewenheim merged 2 commits intogetsentry:masterfrom
loewenheim merged 2 commits intogetsentry:masterfrom
Conversation
loewenheim
reviewed
Nov 30, 2023
tests/integration/_cases/sourcemaps/sourcemaps-upload-some-debugids.trycmd
Show resolved
Hide resolved
When a sourceMappingURL is a remote URL (e.g. static storage in an S3 bucket), `sentry-cli sourcemaps inject` was treating it like a normal file path, attempting to "normalize" it with the source path, and producing a bogus url such as `path/to/source/dir/https://some-static-host.example.com/path/to/foo.js.map`, which of course doesn't exist, and thus the sourcemap isn't found and doesn't have the debug id injected - even if it's sitting right there in the local directory, next to its corresponding bundled source file. With this change, the sourcemap discovery step does not attempt to use the discovered sourcemap URL if it is a remote URL. Instead, it falls back to guessing the sourcemap location based on the source filename and its location. I also changed a couple trycmd tests to remove the `+` before the timezone offset, as it causes the tests to fail when the local timezone is west of UTC. Fixes getsentry#1846.
Contributor
Author
|
Added an integration test for a |
loewenheim
approved these changes
Nov 30, 2023
Contributor
|
Thank you very much for the contribution! |
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.
When a sourceMappingURL is a remote URL (e.g. static storage in an S3 bucket),
sentry-cli sourcemaps injectwas treating it like a normal file path, attempting to "normalize" it with the source path, and producing a bogus url such aspath/to/source/dir/https://some-static-host.example.com/path/to/foo.js.map, which of course doesn't exist, and thus the sourcemap isn't found and doesn't have the debug id injected - even if it's sitting right there in the local directory, next to its corresponding bundled source file.With this change, the sourcemap discovery step does not attempt to use the discovered sourcemap URL if it is a remote URL. Instead, it falls back to guessing the sourcemap location based on the source filename and its location.
I also changed a couple trycmd tests to remove the
+before the timezone offset,as it causes the tests to fail when the local timezone is west of UTC.
Fixes #1846.