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

Release 4.0.0.pre.3 #203

Merged
merged 3 commits into from
Jun 7, 2021
Merged

Release 4.0.0.pre.3 #203

merged 3 commits into from
Jun 7, 2021

Conversation

ChrisBAshton
Copy link
Contributor

@ChrisBAshton ChrisBAshton commented Jun 7, 2021

In the major release which renamed sentry-raven to sentry-ruby,
the rails config was extracted into its own sentry-rails gem:
https://docs.sentry.io/platforms/ruby/guides/rails/

I had hoped to have downstream apps explicitly
require "sentry-rails" only if they need it, however this means
the code is evaluated too late in the process, as GovukError is
already defined at that point. For example, trying to set
config.rails.report_rescued_exceptions in email-alert-api on
govuk_app_config v4.0.0.pre.2 leads to this error:

NoMethodError: undefined method `rails' for #<GovukError::Configuration:0x000055d424a1a8d0>

It seems the only alternative is to include sentry-rails in
GovukAppConfig by default. Most of our apps are Rails apps anyway,
so in practice this should DRY up a bit of configuration across
our apps, as well as making it easier to keep sentry-rails in sync
with sentry-ruby. The only downside is in Rack apps which don't
have Rails, which now have an unnecessary extra dependency - not
a terrible downside in the grand scheme of things.

Depended on by alphagov/email-alert-api#1629.

Trello: https://trello.com/c/4JOuje6O/2546-fix-broken-data-sync-related-sentry-errors-not-being-ignored

In the major release which renamed sentry-raven to sentry-ruby,
the rails config was extracted into its own sentry-rails gem:
https://docs.sentry.io/platforms/ruby/guides/rails/

I had hoped to have downstream apps explicitly
`require "sentry-rails"` only if they need it, however this means
the code is evaluated too late in the process, as GovukError is
already defined at that point. For example, trying to set
`config.rails.report_rescued_exceptions` in email-alert-api on
govuk_app_config v4.0.0.pre.2 leads to this error:

```
NoMethodError: undefined method `rails' for #<GovukError::Configuration:0x000055d424a1a8d0>
```

It seems the only alternative is to include `sentry-rails` in
GovukAppConfig by default. Most of our apps are Rails apps anyway,
so in practice this should DRY up a bit of configuration across
our apps, as well as making it easier to keep sentry-rails in sync
with sentry-ruby. The only downside is in Rack apps which don't
have Rails, which now have an unnecessary extra dependency - not
a terrible downside in the grand scheme of things.
Also fixes the pre-release version formatting in the CHANGELOG.
@ChrisBAshton ChrisBAshton marked this pull request as ready for review June 7, 2021 08:52
Copy link
Contributor

@thomasleese thomasleese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've already got Rails specific configuration in this repo, so I don't see a problem with including this as well.

@ChrisBAshton ChrisBAshton merged commit bf5f3b9 into main Jun 7, 2021
@ChrisBAshton ChrisBAshton deleted the sentry-rails branch June 7, 2021 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants