Skip to content

Implicit dependency of sentry-rails in sentry-resque #1541

@adi-pen

Description

@adi-pen

Describe the bug

Sentry.configuration.rails.skippable_job_adapters << "ActiveJob::QueueAdapters::ResqueAdapter"

This line in sentry-resque results in undefined method `rails' for #<Sentry::Configuration:* in rails applications that do not use sentry-rails.

To Reproduce

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org' do
    gem 'rails'
    gem 'sentry-resque'
    # gem 'sentry-rails'
  end
end

require "resque"
require "sentry-resque"

require "rails"
require "action_dispatch"

class TestApp < Rails::Application
  Sentry.init do |config|
    config.breadcrumbs_logger = [:sentry_logger]
    config.dsn = 'https://aaaa@xxxx.ingest.sentry.io/123456'
  end
end

TestApp.initialize!

Expected behavior

It should not result in NoMethodError.

Actual behavior

undefined method `rails' for #<Sentry::Configuration:0x00007f9397b2ae08> (NoMethodError)

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions