Skip to content

Commit

Permalink
intial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lodewiges committed Feb 17, 2025
1 parent 7d785cc commit 3bed348
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 44 deletions.
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ gem 'redis', '~> 5.3'
gem 'roo', '~> 2.10', '>= 2.10.1'
gem 'ruby-filemagic', '~> 0.7', '>= 0.7.3'
gem 'rubyzip', '~> 2.4', '>= 2.4.1'
gem 'sentry-raven', '~> 3.1', '>= 3.1.2'
gem 'sentry-rails', '~> 5.5'
gem 'sentry-ruby', '~> 5.5'
gem 'sentry-sidekiq', '~> 5.5'
gem 'sepa_king', '~> 0.14'
gem 'sidekiq', '~> 7.3', '>= 7.3.8'
gem 'sidekiq-scheduler', '~> 5.0', '>= 5.0.6'
Expand Down
22 changes: 14 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ GEM
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
bigdecimal (3.1.9)
bigdecimal (3.1.9-java)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bootsnap (1.18.4)
Expand Down Expand Up @@ -161,10 +163,6 @@ GEM
railties (>= 5.0.0)
faker (3.5.1)
i18n (>= 1.8.11, < 2)
faraday (2.2.0)
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-net_http (2.0.1)
fastimage (2.2.6)
ffi (1.17.1)
ffi-compiler (1.3.2)
Expand Down Expand Up @@ -444,12 +442,18 @@ GEM
ruby-vips (2.2.2)
ffi (~> 1.12)
logger
ruby2_keywords (0.0.5)
rubyzip (2.4.1)
rufus-scheduler (3.9.2)
fugit (~> 1.1, >= 1.11.1)
sentry-raven (3.1.2)
faraday (>= 1.0)
sentry-rails (5.22.4)
railties (>= 5.0)
sentry-ruby (~> 5.22.4)
sentry-ruby (5.22.4)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
sentry-sidekiq (5.22.4)
sentry-ruby (~> 5.22.4)
sidekiq (>= 3.0)
sepa_king (0.14.0)
activemodel (>= 4.2)
iban-tools
Expand Down Expand Up @@ -592,7 +596,9 @@ DEPENDENCIES
rubocop-rspec
ruby-filemagic (~> 0.7, >= 0.7.3)
rubyzip (~> 2.4, >= 2.4.1)
sentry-raven (~> 3.1, >= 3.1.2)
sentry-rails (~> 5.5)
sentry-ruby (~> 5.5)
sentry-sidekiq (~> 5.5)
sepa_king (~> 0.14)
sidekiq (~> 7.3, >= 7.3.8)
sidekiq-scheduler (~> 5.0, >= 5.0.6)
Expand Down
9 changes: 4 additions & 5 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class ApplicationController < JSONAPI::ResourceController
include Pundit::Authorization

before_action :set_paper_trail_whodunnit
before_action :set_raven_context
before_action :set_sentry_context
protect_from_forgery with: :null_session
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized

Expand All @@ -27,12 +27,11 @@ def current_application

private

# See https://github.com/getsentry/raven-ruby/blob/master/docs/integrations/rails.rst
def set_raven_context
Raven.user_context(
def set_sentry_context
Sentry.set_user(
id: current_user.try(:id)
)
Raven.extra_context(
Sentry.set_extras(
params: params.to_unsafe_h,
url: request.url
)
Expand Down
8 changes: 0 additions & 8 deletions app/jobs/sentry_job.rb

This file was deleted.

12 changes: 4 additions & 8 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Raven.configure do |config|
Sentry.init do |config|
config.dsn = Rails.application.config.x.sentry_dsn
config.environments = %w[production staging]
config.release = ENV['BUILD_HASH']
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)

config.async = lambda { |event|
SentryJob.perform_later(event.to_hash)
}
config.enabled_environments = %w[production staging]
config.environment = Rails.env
config.release = ENV.fetch('BUILD_HASH', nil)
end
14 changes: 0 additions & 14 deletions spec/jobs/sentry_job_spec.rb

This file was deleted.

0 comments on commit 3bed348

Please sign in to comment.