ember-cli-deploy-sentry icon indicating copy to clipboard operation
ember-cli-deploy-sentry copied to clipboard

Add an option to be able to upload files with relative path

Open dguayrobotiq opened this issue 6 years ago • 4 comments

Reading through the Sentry doc and their forum, sometimes it's mandatory to upload files with ~ instead of the full path with host and protocol.

So instead of uploading the files like: https://xxx.cloudfront.net/assets/vendor-7d31c95933a91ffe617f81efb6478c75.js

it should be uploaded as: ~/assets/vendor-7d31c95933a91ffe617f81efb6478c75.js

This allow to ignore the the host and protocol. This can be useful in some case for example, when you want to access assets from multiple origins.

dguayrobotiq avatar Mar 28 '18 12:03 dguayrobotiq

So what you need is a mechanism/config option to replace part of the paths with something different?

dschmidt avatar Mar 28 '18 13:03 dschmidt

Yes. It could be a simple useRelativePath flag option I guess? In that case, you get the files from the distDir and then you replace host and protocol by ~ if the flag is true. By checking the code, that could be done in the _uploadFile function?

dguayrobotiq avatar Mar 28 '18 13:03 dguayrobotiq

@dschmidt I found the option --url-prefix in Sentry documentation that could help: https://docs.sentry.io/learn/cli/releases/#upload-source-maps

dguayrobotiq avatar Mar 30 '18 00:03 dguayrobotiq

Okay cool, but that seems to be a feature of the cli and not a documentation of the api endpoint we're using. Anyway this shouldn't be too hard to implement. Mind sending a PR?

dschmidt avatar Mar 31 '18 23:03 dschmidt