-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BUGSNAG_RELEASE_STAGE and use it in Bugsnag initializer #3123
Conversation
2aa4f8a
to
0ce5375
Compare
config/initializers/bugsnag.rb
Outdated
stages = Rails.configuration.three_scale.error_reporting_stages | ||
config.notify_release_stages = stages if stages.present? | ||
config.notify_release_stages = stages.present? ? stages : %w[production] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are not notified about errors, how would we know about them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would get notified! Just need to set error_reporting_stages
in settings.yml
properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not add staging
by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, staging
is an environment that only exists in SaaS world, so I don't know if there would be much benefit in adding it here. But we can do it also.
@@ -11,6 +11,8 @@ base: &default | |||
daily_weekly_reports_pref: <%= ENV.fetch('ENABLE_DAILY_WEEKLY_REPORTS_PREF', '1') == '1' %> | |||
readonly_custom_domains_settings: <%= ENV.fetch('READONLY_CUSTOM_DOMAINS_SETTINGS', '1') == '1' %> | |||
bugsnag_api_key: <%= ENV['BUGSNAG_API_KEY'] %> | |||
bugsnag_release_stage: <%= ENV.fetch('BUGSNAG_RELEASE_STAGE', Rails.env) %> | |||
error_reporting_stages: <%= ENV.fetch('ERROR_REPORTING_STAGES', 'production') %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, maybe rename this to BUGSNAG_ENABLED_RELEASE_STAGES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to make it more meaningful after bugsnag upgrade
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this config (and environment variable) are not new - it already existed, I just moved it up.
I'd keep it as it is for now, and at some point (probably with the upgrade) rename both the environment variable, and the configuration name.
Just to reduce the amount of changes we do now.
This is a way to set a different
releaseStage
metadata on Bugsnag (e.g.staging
), while still usingRAILS_ENV=production
)NOTE: In order to use a different environment
Rails.configuration.three_scale.error_reporting_stages
(insettings.yml
) must be changed to include the new environment.This env var as added as default one in Bugsnag Ruby in 6.16, see the PR and the release notes.