Skip to content

Commit

Permalink
feat!: Drop Support for EoL Rails 6.1
Browse files Browse the repository at this point in the history
This change removes support for Rails 6.1, which has reached EoL.

Users must pin to previous versions of gems and will no longer receive features or bug fixes for instrumentations earlier than this release

Fixes open-telemetry#1223
  • Loading branch information
arielvalentin committed Nov 5, 2024
1 parent 2c4f8c9 commit e67303f
Show file tree
Hide file tree
Showing 23 changed files with 41 additions and 104 deletions.
15 changes: 4 additions & 11 deletions instrumentation/action_mailer/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,11 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end

appraise 'rails-7.0' do
gem 'rails', '~> 7.0.0'
end

appraise 'rails-7.1' do
gem 'rails', '~> 7.1.0'
%w[7.0.0 7.1.0].each do |version|
appraise "rails-#{version}" do
gem 'rails', "~> #{version}"
end
end

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
appraise 'rails-7.2' do
gem 'rails', '~> 7.2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module ActionMailer
# })
# end
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.1.0')
MINIMUM_VERSION = Gem::Version.new('7')
EMAIL_ATTRIBUTE = %w[email.to.address email.from.address email.cc.address email.bcc.address].freeze

install do |_config|
Expand Down
14 changes: 4 additions & 10 deletions instrumentation/action_pack/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end

appraise 'rails-7.0' do
gem 'rails', '~> 7.0.0'
end

appraise 'rails-7.1' do
gem 'rails', '~> 7.1.0'
%w[7.0.0 7.1.0].each do |version|
appraise "rails-#{version}" do
gem 'rails', "~> #{version}"
end
end

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Instrumentation
module ActionPack
# The Instrumentation class contains logic to detect and install the ActionPack instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.1.0')
MINIMUM_VERSION = Gem::Version.new('7')

install do |_config|
require_railtie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.67.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.22.0'
Expand Down
14 changes: 4 additions & 10 deletions instrumentation/action_view/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end

appraise 'rails-7.0' do
gem 'rails', '~> 7.0.0'
end

appraise 'rails-7.1' do
gem 'rails', '~> 7.1.0'
%w[7.0.0 7.1.0].each do |version|
appraise "rails-#{version}" do
gem 'rails', "~> #{version}"
end
end

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module ActionView
# })
# end
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.1.0')
MINIMUM_VERSION = Gem::Version.new('7')
install do |_config|
require_dependencies
end
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/active_job/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# SPDX-License-Identifier: Apache-2.0

%w[6.1.0 7.0.0 7.1.0].each do |version|
%w[7.0.0 7.1.0].each do |version|
appraise "activejob-#{version}" do
gem 'activejob', "~> #{version}"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Instrumentation
module ActiveJob
# The Instrumentation class contains logic to detect and install the ActiveJob instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.1.0')
MINIMUM_VERSION = Gem::Version.new('7')

install do |_config|
require_dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'

spec.add_development_dependency 'activejob', '>= 6.1'
spec.add_development_dependency 'appraisal', '~> 2.5'
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'minitest', '~> 5.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,7 @@
_(process_span.events.first.attributes['exception.message']).must_equal 'This job raises an exception'
end

it 'captures errors that were handled by rescue_from in versions earlier than Rails 7' do
skip 'rescue_from jobs behave differently in Rails 7 and newer' if ActiveJob.version >= Gem::Version.new('7')
RescueFromJob.perform_later

_(process_span.status.code).must_equal OpenTelemetry::Trace::Status::ERROR
_(process_span.status.description).must_equal 'Unexpected ActiveJob Error RescueFromJob::RescueFromError'

_(process_span.events.first.name).must_equal 'exception'
_(process_span.events.first.attributes['exception.type']).must_equal 'RescueFromJob::RescueFromError'
_(process_span.events.first.attributes['exception.message']).must_equal 'I was handled by rescue_from'
end

it 'ignores errors that were handled by rescue_from in versions of Rails 7 or newer' do
skip 'rescue_from jobs behave differently in Rails 7 and newer' if ActiveJob.version < Gem::Version.new('7')
RescueFromJob.perform_later

_(process_span.status.code).must_equal OpenTelemetry::Trace::Status::OK
Expand Down Expand Up @@ -318,15 +305,13 @@

describe 'active_job callbacks' do
it 'makes the tracing context available in before_perform callbacks' do
skip "ActiveJob #{ActiveJob.version} subscribers do not include timing information for callbacks" if ActiveJob.version < Gem::Version.new('7')
CallbacksJob.perform_now

_(CallbacksJob.context_before).wont_be_nil
_(CallbacksJob.context_before).must_be :valid?
end

it 'makes the tracing context available in after_perform callbacks' do
skip "ActiveJob #{ActiveJob.version} subscribers do not include timing information for callbacks" if ActiveJob.version < Gem::Version.new('7')
CallbacksJob.perform_now

_(CallbacksJob.context_after).wont_be_nil
Expand Down
14 changes: 4 additions & 10 deletions instrumentation/active_record/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'activerecord-6.1' do
gem 'activerecord', '~> 6.1.0'
end

appraise 'activerecord-7.0' do
gem 'activerecord', '~> 7.0.0'
end

appraise 'activerecord-7.1' do
gem 'activerecord', '~> 7.1.0'
%w[7.0.0 7.1.0].each do |version|
appraise "activerecord-#{version}" do
gem 'activerecord', "~> #{version}"
end
end

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Instrumentation
module ActiveRecord
# The Instrumentation class contains logic to detect and install the ActiveRecord instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.1.0')
MINIMUM_VERSION = Gem::Version.new('7')

install do |_config|
require_dependencies
Expand Down Expand Up @@ -45,7 +45,7 @@ def patch_activerecord
::ActiveSupport.on_load(:active_record) do
# Modules to prepend to ActiveRecord::Base are grouped by the source
# module that they are defined in as they are included into ActiveRecord::Base
# Example: Patches::PersistenceClassMethods refers to https://github.com/rails/rails/blob/v6.1.0/activerecord/lib/active_record/persistence.rb#L10
# Example: Patches::PersistenceClassMethods refers to https://github.com/rails/rails/blob/v7.0.0/activerecord/lib/active_record/persistence.rb#L10
# which is included into ActiveRecord::Base in https://github.com/rails/rails/blob/914caca2d31bd753f47f9168f2a375921d9e91cc/activerecord/lib/active_record/base.rb#L283
::ActiveRecord::Base.prepend(Patches::Querying)
::ActiveRecord::Base.prepend(Patches::Persistence)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'

spec.add_development_dependency 'activerecord', '>= 6.1'
spec.add_development_dependency 'appraisal', '~> 2.5'
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'minitest', '~> 5.0'
Expand Down
14 changes: 4 additions & 10 deletions instrumentation/active_support/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'activesupport-6.1' do
gem 'activesupport', '~> 6.1.0'
end

appraise 'activesupport-7.0' do
gem 'activesupport', '~> 7.0.0'
end

appraise 'activesupport-7.1' do
gem 'activesupport', '~> 7.1.0'
%w[7.0.0 7.1.0].each do |version|
appraise "activesupport-#{version}" do
gem 'activesupport', "~> #{version}"
end
end

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Instrumentation
module ActiveSupport
# The Instrumentation class contains logic to detect and install the ActiveSupport instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.1.0')
MINIMUM_VERSION = Gem::Version.new('7')

install do |_config|
require_dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'pry-byebug'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec-mocks'
spec.add_development_dependency 'rubocop', '~> 1.67.0'
Expand Down
18 changes: 6 additions & 12 deletions instrumentation/delayed_job/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'delayed_job_4.1-rails-latest' do
gem 'activejob'
end

appraise 'delayed_job_4.1-rails-7.1' do
gem 'activejob', '~> 7.1.0'
%w[7.0.0 7.1.0].each do |version|
appraise "delayed_job-4.1-rails-#{version}" do
gem 'activejob', "~> #{version}"
end
end

appraise 'delayed_job_4.1-rails-7.0' do
gem 'activejob', '~> 7.0.0'
end

appraise 'delayed_job-4.1-rails-6.1' do
gem 'activejob', '~> 6.1.0'
appraise 'delayed_job-4.1-rails-latest' do
gem 'activejob'
end
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'opentelemetry-helpers-sql-obfuscation'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'

spec.add_development_dependency 'activerecord', '> 6.1.0'
spec.add_development_dependency 'appraisal', '~> 2.5'
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'minitest', '~> 5.0'
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/que/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source 'https://rubygems.org'
gemspec

group :test do
gem 'activerecord', '< 7.2.0', '> 6.1.0'
gem 'activerecord', '< 7.2.0', '> 7.0.0'
gem 'pg'
gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation'
gem 'opentelemetry-instrumentation-base', path: '../base'
Expand Down
14 changes: 4 additions & 10 deletions instrumentation/rails/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end

appraise 'rails-7.0' do
gem 'rails', '~> 7.0.0'
end

appraise 'rails-7.1' do
gem 'rails', '~> 7.1.0'
%w[7.0.0 7.1.0].each do |version|
appraise "rails-#{version}" do
gem 'rails', "~> #{version}"
end
end

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/rails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gem opentelemetry-instrumentation-rails, "<version>"
| --- | --- |
| `5.2` | `= 0.24.1` |
| `6.0` | `= 0.28.0` |
| `6.1` | `~> 0.24` |
| `6.1` | `= 0.24` |
| `7.x` | `~> 0.24` |

## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Rails
# The Instrumentation class contains logic to detect and install the Rails
# instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.1.0')
MINIMUM_VERSION = Gem::Version.new('7')

# This gem requires the instrumentantion gems for the different
# components of Rails, as a result it does not have any explicit
Expand Down

0 comments on commit e67303f

Please sign in to comment.