[PLAT-3643] Ensure app_type is consistently resolved #619
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.
Goal
This fixes a couple of issues with
app_type
— we now always use the value set by a user (if one is set) and integrations should now always set the correct valueFor example, before this change Que would have an app type of 'rails' when running in a rails app. This is because the Que integration has to run when it's loaded and so sets its app type before Rails does
Now we always use the new
detected_app_type
property internally (this should only be used within Bugsnag) so that we know any user provided value will be set as the regularapp_type
. Most integrations can then safely overwrite thedetected_app_type
with the exception of Rails and Rack — these integrations can run with other integrations (e.g. Que in Rails) and so need to make sure they don't overwrite an already set valueTests
Automated tests for the
app_type
exist in #616 and tests forapp_type
when integrations are run inside a Rails app exist in #618. This branch is separate so that we can fix the bug before those PRs are reviewed (they're pretty huge!)Shoryuken is missing automated tests because it's a bit more complicated to setup (it needs a mock SQS server); I've tested this manually for now, but we'll add Maze Runner tests for this later
Review
For the submitter, initial self-review:
For the pull request reviewer(s), this changeset has been reviewed for: