Skip to content

Commit

Permalink
Merge pull request #1262 from alphagov/remove-sentry-raven
Browse files Browse the repository at this point in the history
Remove sentry raven
  • Loading branch information
kentsanggds authored Feb 26, 2024
2 parents 4b90b2e + dc9400d commit a1fe77e
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 32 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ gem "plek"
gem "rest-client"
gem "rubyzip"
gem "sass-rails"
gem "sentry-raven"
gem "sentry-sidekiq"
gem "sidekiq-limit_fetch"
gem "sidekiq-scheduler"
Expand Down
4 changes: 1 addition & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,6 @@ GEM
sentry-rails (5.16.1)
railties (>= 5.0)
sentry-ruby (~> 5.16.1)
sentry-raven (3.1.2)
faraday (>= 1.0)
sentry-ruby (5.16.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
sentry-sidekiq (5.16.1)
Expand Down Expand Up @@ -721,6 +719,7 @@ GEM

PLATFORMS
aarch64-linux
arm64-darwin-22
arm64-darwin-23
x86_64-darwin-21
x86_64-linux
Expand Down Expand Up @@ -766,7 +765,6 @@ DEPENDENCIES
rubocop-govuk
rubyzip
sass-rails
sentry-raven
sentry-sidekiq
sidekiq-limit_fetch
sidekiq-scheduler
Expand Down
20 changes: 0 additions & 20 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class ApplicationController < ActionController::Base

protect_from_forgery with: :exception
before_action :authenticate_user!
before_action :set_raven_context
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found

rescue_from CanCan::AccessDenied do
Expand All @@ -26,23 +25,4 @@ class ApplicationController < ActionController::Base
def record_not_found
render plain: "404 Not Found", status: :not_found
end

def set_raven_context
Raven.extra_context(
params: params.to_unsafe_h,
url: request.url,
environment: Rails.env,
app_environment: ENV["VCAP_APPLICATION"],
)

return unless current_user

Raven.user_context(
id: current_user.id,
name: current_user.name,
email: current_user.email,
organisation_id: current_user.primary_organisation.id,
organisation: current_user.primary_organisation.name,
)
end
end
1 change: 0 additions & 1 deletion app/services/alias_updater_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def assign_alias_to_new_index
rescue StandardError => e
msg = "Could not update alias.\n #{e.message}"
@logger.error msg
Raven.capture_exception msg
end

def remove_index_actions
Expand Down
1 change: 0 additions & 1 deletion app/services/index_deletion_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def run
rescue StandardError => e
msg = "Failed to delete old indexes.\n#{e.message}"
logger.error msg
Raven.capture_exception(e)
end

private
Expand Down
5 changes: 0 additions & 5 deletions config/initializers/raven.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/tasks/search.rake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ namespace :search do

if indexes.include?(legacy_index)
msg = "An alias can not be assigned to index of the same name. Please delete index '#{legacy_index}' before continuing."
Raven.capture_exception msg
raise msg
end

Expand Down

0 comments on commit a1fe77e

Please sign in to comment.