Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Load sentry with application to allow initializers to load

Oliver Günthere92ca48163a3
diff --git a/Gemfile b/Gemfile
index befdfc6264f..e5dd62e012c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -186,12 +186,10 @@ gem 'ruby-progressbar', '~> 1.11.0', require: false
gem 'mini_magick', '~> 4.11.0', require: false
-# Sentry error reporting, loaded on demand
-group :sentry do
- gem "sentry-delayed_job", '~> 5.1.0', require: false
- gem "sentry-rails", '~> 5.1.0', require: false
- gem "sentry-ruby", '~> 5.1.0', require: false
-end
+# Sentry error reporting
+gem "sentry-delayed_job", '~> 5.1.0'
+gem "sentry-rails", '~> 5.1.0'
+gem "sentry-ruby", '~> 5.1.0'
group :test do
gem 'launchy', '~> 2.5.0'
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb
index 3c088301a06..5df61ff1f2c 100644
--- a/config/initializers/sentry.rb
+++ b/config/initializers/sentry.rb
@@ -1,19 +1,4 @@
if OpenProject::Logging::SentryLogger.enabled?
- require "sentry-ruby"
- require "sentry-rails"
- require "sentry-delayed_job"
-
- # Explicitly require the send event job
- require File.join(Sentry::Engine.root, 'app/jobs/sentry/send_event_job')
-
- # We need to manually load the sentry initializer
- # as we're dynamically loading it
- # https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/railtie.rb#L8-L13
- OpenProject::Application.configure do |app|
- # need to be placed at last to smuggle app exceptions via env
- app.config.middleware.use(Sentry::Rails::RescuedExceptionInterceptor)
- end
-
##
# Define the SentryJob here, as sentry gets dynamically loaded
class SentryJob < Sentry::SendEventJob