Skip to content

Commit

Permalink
feat!: Drop Support for EoL Rails 6.1 (#1231)
Browse files Browse the repository at this point in the history
* feat!: Drop Support for EoL Rails 6.1

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 #1223

* squash: add missing dependency

* squash: user newer AR versions

* squash: remove post install warning

* squash: load logger

* squash: rubocop fix
  • Loading branch information
arielvalentin authored Jan 16, 2025
1 parent b840de9 commit 717f1c3
Show file tree
Hide file tree
Showing 24 changed files with 24 additions and 44 deletions.
2 changes: 0 additions & 2 deletions POST_INSTALL_MESSAGE
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
Ruby 3.0 has reached EoL 2024-04-23. OTel Ruby Contrib gems will no longer accept new features or bug fixes for Ruby 3.0 after 2025-01-15. Please upgrade to Ruby 3.1 or higher to continue receiving updates.

Rails 6.1 has reached EoL 2024-10-01. OTel Ruby Contrib gems will no longer accept new features or bug fixes for Rails 6.1 after 2025-01-15. Please upgrade to Rails 7.0 or higher to continue receiving updates.
2 changes: 1 addition & 1 deletion instrumentation/action_mailer/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 "action_mailer-#{version}" do
gem 'rails', "~> #{version}"
end
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
8 changes: 4 additions & 4 deletions instrumentation/action_pack/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
#
# SPDX-License-Identifier: Apache-2.0

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

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
%w[7.2.0].each do |version|
appraise "rails-#{version}" do
appraise "action_pack-#{version}" do
gem 'rails', "~> #{version}"
end
end

appraise 'rails-latest' do
appraise 'action_pack-latest' do
gem 'rails'
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module ActionPack
# })
# end
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
6 changes: 3 additions & 3 deletions instrumentation/action_view/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
#
# 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 "action_view-#{version}" do
gem 'rails', "~> #{version}"
end
end

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
%w[7.2.0].each do |version|
appraise "rails-#{version}" do
appraise "action_view-#{version}" do
gem 'rails', "~> #{version}"
end
end

appraise 'rails-latest' do
appraise 'action_view-latest' do
gem 'rails'
end
end
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
2 changes: 1 addition & 1 deletion instrumentation/active_record/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 "activerecord-#{version}" do
gem 'sqlite3', '~> 1.4'
gem 'activerecord', "~> #{version}"
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
2 changes: 1 addition & 1 deletion instrumentation/active_support/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 "activesupport-#{version}" do
gem 'activesupport', "~> #{version}"
end
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.69.1'
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/delayed_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 "delayed_job_4.1-activejob-#{version}" do
gem 'delayed_job', '~> 4.1'
gem 'activejob', "~> #{version}"
Expand Down
1 change: 1 addition & 0 deletions instrumentation/pg/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ source 'https://rubygems.org'
gemspec

group :test do
gem 'activerecord', '>= 7.0.0'
gem 'opentelemetry-instrumentation-base', path: '../base'
gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation'
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
2 changes: 1 addition & 1 deletion instrumentation/rails/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 "rails-#{version}" do
gem 'rails', "~> #{version}"
end
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 717f1c3

Please sign in to comment.