Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[PLAT-5608]: Automatically add the correct suffix to endpoint #48

Merged
merged 5 commits into from
Dec 14, 2020

Conversation

bengourley
Copy link
Contributor

Goal

Only accepting the full/absolute URL meant that On-Premise needed to know unecessary detail about the different paths on the upload server, and also meant some commands were unnecessarily repetitive:

bugsnag-source-maps upload-react-native --endpoint https://bugsnag.my-company.com/react-native-source-map ...

Design

Based on the kind of source map being uploaded (which we know becuase there is a separate command/library for each) we can predict what the path of the URL is: either /sourcemap¹ or /react-native-source-map

¹ the path /source-map exists (which is correctly named) but for now we use /sourcemap – it has existed for longer so supports older On-Premise versions.

Changeset

  • Added a small utility to build the full endpoint URL
  • Ensured backward compatibility is maintained (e.g. if the --endpoint provided includes a path longer than /, it will use that verbatim)

Testing

Updated unit tests.

bengourley and others added 2 commits December 14, 2020 09:40
Co-authored-by: Joe Haines <hello@joehaines.co.uk>
Co-authored-by: Joe Haines <hello@joehaines.co.uk>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants