Skip to content
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

Prefer BUGSNAG_RELEASE_STAGE over RAILS_ENV for release_stage #298

Closed
dziemba opened this issue May 25, 2016 · 4 comments
Closed

Prefer BUGSNAG_RELEASE_STAGE over RAILS_ENV for release_stage #298

dziemba opened this issue May 25, 2016 · 4 comments
Labels
feature request Request for a new feature

Comments

@dziemba
Copy link

dziemba commented May 25, 2016

We deploy our projects to multiple release stages, but they all have RAILS_ENV set to production. I think this is a good way to keep the environments in sync, Heroku also agree with me.

When using the bugsnag gem, it currently overrides BUGSNAG_RELEASE_STAGE set in the environment with the current RAILS_ENV value. I think it would be better that RAILS_ENV is only used if BUGSNAG_RELEASE_STAGE is not set.

I have a workaround for this, but I'd prefer not having to add this to all our projects.

Bugsnag.configure do |c|
  c.release_stage = ENV.fetch('BUGSNAG_RELEASE_STAGE') if ENV.key?('BUGSNAG_RELEASE_STAGE')
end

What do you think about changing the precedence of RAILS_ENV and BUGSNAG_RELEASE_STAGE?

@kattrali
Copy link
Contributor

I think that makes sense, thank you for the suggestion, @dziemba.

@snmaynard
Copy link
Contributor

This has now been addressed on master and I will do a release soon!

@dziemba
Copy link
Author

dziemba commented Sep 15, 2016

Thank you very much for this!

@timdiggins
Copy link
Contributor

@snmaynard this is really useful thanks -- could you add it to bugsnag official docs for ease of reference?

e.g. https://docs.bugsnag.com/platforms/ruby/rails/#automatically-captured-diagnostics
bugsnag_docs_ platforms ruby _rails

(add something like will use environment variable BUGSNAG_RELEASE_STAGE or RAILS_ENV)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants