Skip to content

Commit

Permalink
Merge pull request #1153 from alphagov/replace-airbrake-with-sentry
Browse files Browse the repository at this point in the history
Replace airbrake with sentry via govuk_app_config
  • Loading branch information
h-lame authored Sep 25, 2017
2 parents f7fc777 + 9effac2 commit e303a3b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ gem 'rack_strip_client_ip', '0.0.2'
gem 'actionpack-page_caching', '1.1.0'
gem 'uglifier', ">= 1.3.0"
gem 'sass-rails', "5.0.6"
gem 'airbrake', github: 'alphagov/airbrake', branch: 'silence-dep-warnings-for-rails-5'
gem 'nokogiri', "~> 1.7"
gem 'redis', "~> 3.3.3"
gem 'govuk_publishing_components', '~> 1.10.0', require: false
gem 'govuk_app_config', '~> 0.3.0'

group :development do
gem 'image_optim', '0.17.1'
Expand Down
22 changes: 10 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
GIT
remote: git://github.com/alphagov/airbrake.git
revision: ad9c926a56535c48f95c33824a76e10bc8f91179
branch: silence-dep-warnings-for-rails-5
specs:
airbrake (4.3.8)
builder
multi_json
rails (>= 5.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -83,6 +73,8 @@ GEM
erubis (2.7.0)
execjs (2.6.0)
exifr (1.2.3.1)
faraday (0.13.1)
multipart-post (>= 1.2, < 3)
fspath (2.1.1)
gds-api-adapters (48.0.0)
link_header
Expand All @@ -108,6 +100,9 @@ GEM
govuk-lint (0.6.1)
rubocop (~> 0.35.0)
scss_lint (~> 0.44.0)
govuk_app_config (0.3.0)
sentry-raven (~> 2.6.3)
statsd-ruby (~> 1.4.0)
govuk_frontend_toolkit (7.0.1)
railties (>= 3.1.0)
sass (>= 3.2.0)
Expand Down Expand Up @@ -170,7 +165,7 @@ GEM
metaclass (~> 0.0.1)
money (6.9.0)
i18n (>= 0.6.4, < 0.9)
multi_json (1.12.1)
multipart-post (2.0.0)
netrc (0.11.0)
nio4r (2.1.0)
nokogiri (1.8.0)
Expand Down Expand Up @@ -250,6 +245,8 @@ GEM
scss_lint (0.44.0)
rake (~> 10.0)
sass (~> 3.4.15)
sentry-raven (2.6.3)
faraday (>= 0.7.6, < 1.0)
shoulda (3.5.0)
shoulda-context (~> 1.0, >= 1.0.1)
shoulda-matchers (>= 1.4.1, < 3.0)
Expand All @@ -272,6 +269,7 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
statsd-ruby (1.4.0)
test-unit (3.1.3)
power_assert
thor (0.19.4)
Expand Down Expand Up @@ -305,13 +303,13 @@ PLATFORMS

DEPENDENCIES
actionpack-page_caching (= 1.1.0)
airbrake!
better_errors
binding_of_caller
capybara (~> 2.5.0)
gds-api-adapters (~> 48.0)
govuk-content-schema-test-helpers (~> 1.4)
govuk-lint (~> 0.6.0)
govuk_app_config (~> 0.3.0)
govuk_frontend_toolkit (~> 7.0.1)
govuk_publishing_components (~> 1.10.0)
govuk_template (= 0.22.2)
Expand Down
10 changes: 0 additions & 10 deletions config/initializers/airbrake.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/emergency_banner/display.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def content
@content = begin
client.hgetall("emergency_banner").try(:symbolize_keys)
rescue => e
Airbrake.notify_or_ignore(e) if defined?(Airbrake)
GovukError.notify(e)
nil
end
end
Expand Down
5 changes: 2 additions & 3 deletions test/unit/emergency_banner/display_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
end

context "#enabled?" do
should "return enabled is false when redis connection times out and send an error to Airbrake" do
should "return enabled is false when redis connection times out and send an error notification" do
err = Redis::CannotConnectError.new("Timed out connecting to Redis")
Redis.any_instance.stubs(:hgetall).with("emergency_banner").raises(err)

Airbrake.expects(:notify_or_ignore)
.with(err)
GovukError.expects(:notify).with(err)
refute @banner.enabled?
end

Expand Down

0 comments on commit e303a3b

Please sign in to comment.