feat(core): Add prepareArtifacts
option for uploading sourcemaps
#794
+214
−84
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.
Problem (kinda)
I realised that some of the logic wrapped around the cli calls in the build plugin manager can lead to some hard to debug pitfalls when combining some commands from using just the cli like
sourcemaps inject
. E.g. the rollup plugin for injecting debugIds also injects a sentryDebugIdIdentifier which is basically a helper for more efficiently finding the injected debugId files before uploading them. When you inject debugIds using the cli only instead, there is no sentryDebugIdIdentifier which then leads source maps not being uploaded.Additionally the plugin manager does quite a lot of expensive file reading/writing:
Solution
This PR adds an option for skipping all these preparation tasks for uploading sourcemaps as they are repetitive tasks when we already injected the debugIds earlier using the CLI . When
prepareArtifacts
is set tofalse
, no temp folder is created and no debug file preparation is done. Instead the files are uploaded directly (similar to usingsentry-cli sourcemaps upload
)Hope this makes sense!