Skip to content

Commit

Permalink
Remove sentry (#1183)
Browse files Browse the repository at this point in the history
# What it does

This PR closes #1160 to Remove the outdated Sentry gem, as well as
removes related code causing tests to fail after its removal. Thank you
for your patience

# Implementation notes

I took a very top-down approach to this ticket, first removing the
sentry-raven gem, then running tests and inspecting the related files.
I'm very new to the codebase, so I appreciate any extra pairs of eyes to
my changes.

I noticed my `yarn.lock` file had a *lot* of changes to it. Please take
a look at that commit. I don't know if it had to do with some of the
issues I had in my set up. I'd like to make sure it doesn't cause any
problems in the future. Appreciate it!

# Your bandwidth for additional changes to this PR

- [💚] I have the time and interest to make additional changes to this PR
based on feedback.
- [ ] I am interested in feedback but don't need to make the changes
myself.
- [ ] I don't have time or interest in making additional changes to this
work.
- [ ] Other or not sure (please describe):
  • Loading branch information
chrissycooper authored Nov 11, 2023
1 parent 07c1187 commit 9be5bd4
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 25 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ gem "acts_as_list"

gem "square.rb"
gem "aws-sdk-s3", require: false
gem "sentry-raven"
gem "omniauth-google-oauth2"
gem "omniauth-rails_csrf_protection"

Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sentry-raven (3.1.2)
faraday (>= 1.0)
singleton (0.1.1)
smart_properties (1.17.0)
solargraph (0.44.3)
Expand Down Expand Up @@ -539,7 +537,6 @@ DEPENDENCIES
reverse_markdown
scenic
selenium-webdriver
sentry-raven
solargraph
solargraph-standardrb
sprockets-rails
Expand Down
7 changes: 0 additions & 7 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ApplicationController < ActionController::Base

add_flash_types :success, :error, :warning

before_action :set_raven_context
around_action :set_time_zone
around_action :override_time_in_development, if: -> { Rails.env.development? }

Expand Down Expand Up @@ -60,12 +59,6 @@ def set_time_zone(&block)
end
end

def set_raven_context
if user_signed_in?
Raven.user_context(id: current_user.id, member_id: current_member.try(:id))
end
end

def render_not_found
render "errors/show", status: :not_found
end
Expand Down
7 changes: 0 additions & 7 deletions app/controllers/renewal/payments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Renewal
class PaymentsController < BaseController
before_action :load_member
before_action :set_raven_context
before_action :are_payments_enabled?

def new
Expand All @@ -25,7 +24,6 @@ def create
else
errors = result.error
Rails.logger.error(errors)
Raven.capture_message(errors.inspect)
flash[:error] = "There was a problem connecting to our payment processor."
redirect_to new_renewal_payment_url
end
Expand Down Expand Up @@ -65,7 +63,6 @@ def callback
end

Rails.logger.error(errors)
Raven.capture_message(errors.inspect)
reset_session
flash[:error] = "There was an error processing your payment. Please come into the library to complete signup."
redirect_to renewal_confirmation_url
Expand All @@ -85,10 +82,6 @@ def checkout
)
end

def set_raven_context
Raven.extra_context(session)
end

def are_payments_enabled?
if !@current_library.allow_payments?
render_not_found
Expand Down
7 changes: 0 additions & 7 deletions app/controllers/signup/payments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Signup
class PaymentsController < BaseController
before_action :load_member
before_action :set_raven_context
before_action :are_payments_enabled?

def new
Expand All @@ -23,7 +22,6 @@ def create
else
errors = result.error
Rails.logger.error(errors)
Raven.capture_message(errors.inspect)
flash[:error] = "There was a problem connecting to our payment processor."
redirect_to new_signup_payment_url
end
Expand Down Expand Up @@ -65,7 +63,6 @@ def callback
end

Rails.logger.error(errors)
Raven.capture_message(errors.inspect)
reset_session
flash[:error] = "There was an error processing your payment. Please come into the library to complete signup."
redirect_to signup_confirmation_url
Expand All @@ -85,10 +82,6 @@ def checkout
)
end

def set_raven_context
Raven.extra_context(session)
end

def are_payments_enabled?
if !@current_library.allow_payments?
render_not_found
Expand Down

0 comments on commit 9be5bd4

Please sign in to comment.