Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Drop Rails 6.0 EOL #680

Merged
merged 10 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ This repository also contains libraries to aid with interoperablity with vendor

OpenTelemetry Ruby follows the [versioning and stability document][otel-versioning] in the OpenTelemetry specification. Notably, we adhere to the outlined version numbering exception, which states that experimental signals may have a `0.x` version number.

### Library Compatability

This project is managed on a volunteer basis and therefore we have limited capacity to support compatability with unmaintained or EOL libraries.

We will regularly review the instrumentations to drop compatability for any versions of Ruby or gems that reach EOL or no longer receive regular maintenance.

Should you need instrumentation for _older_ versions of a library then you must pin to a specific version of the instrumentation that supports it,
however you will no longer receive any updates for the instrumentationfrom this repository.
arielvalentin marked this conversation as resolved.
Show resolved Hide resolved

> When a release series is no longer supported, it's your own responsibility to deal with bugs and security issues. We may provide backports of the fixes and publish them to git, however there will be no new versions released. If you are not comfortable maintaining your own versions, you should upgrade to a supported version. <https://guides.rubyonrails.org/maintenance_policy.html#security-issues>

Consult instrumentation gem's README file and gemspec for details about library compatability.

### Releases

This repository was extracted from the [OpenTelemetry Ruby repository][otel-ruby]. Versions of libraries contained in this repo released prior to 2022-06-13 are available on the [OpenTelemetry Ruby Releases][otel-ruby-releases] page. Newer versions are available [here][otel-ruby-contrib-releases]
Expand Down
9 changes: 9 additions & 0 deletions instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ Instrumentation-specific documentation can be found in each subdirectory's `READ

You also have the option of installing all of the instrumentation libraries by installing `opentelemetry-instrumentation-all`. See that gem's [README](https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/all) for more.

### Maintenance and Version Compatability

We are a community of volunteers who do our best to provide our users with up to date support for instrumentations,
however we have limited capacity and are unable to support compatability with EOL or unmaintained libraries.

Should you need to instrument an _older_ version of a library you will have to ensure to pin to a instrumtation version that is compatable with that library.
arielvalentin marked this conversation as resolved.
Show resolved Hide resolved

Please review the individual instrumentation READMEs for more information about version compatability.

## How can I get involved?

The source for all OpenTelemetry Ruby instrumentation gems is [on github](https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation).
Expand Down
4 changes: 0 additions & 4 deletions instrumentation/action_pack/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.0' do
gem 'rails', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end
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.0.0')
MINIMUM_VERSION = Gem::Version.new('6.1.0')

install do |_config|
require_railtie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ 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'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.56.1'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
Expand Down
9 changes: 0 additions & 9 deletions instrumentation/action_pack/test/test_helpers/app_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def initialize_app(use_exceptions_app: false, remove_rack_tracer_middleware: fal
new_app.config.filter_parameters = [:param_to_be_filtered]

case Rails.version
when /^6\.0/
apply_rails_6_0_configs(new_app)
when /^6\.1/
apply_rails_6_1_configs(new_app)
when /^7\./
Expand Down Expand Up @@ -73,13 +71,6 @@ def add_middlewares(application)
)
end

def apply_rails_6_0_configs(application)
# Required in Rails 6
application.config.hosts << 'example.org'
# Creates a lot of deprecation warnings on subsequent app initializations if not explicitly set.
application.config.action_view.finalize_compiled_template_methods = ActionView::Railtie::NULL_OPTION
end

def apply_rails_6_1_configs(application)
# Required in Rails 6
application.config.hosts << 'example.org'
Expand Down
4 changes: 0 additions & 4 deletions instrumentation/action_view/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.0' do
gem 'rails', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Instrumentation
module ActionView
# The Instrumentation class contains logic to detect and install the ActionView instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
MINIMUM_VERSION = Gem::Version.new('6.0.0')
MINIMUM_VERSION = Gem::Version.new('6.1.0')
install do |_config|
require_dependencies
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ 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'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.56.1'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
Expand Down
4 changes: 0 additions & 4 deletions instrumentation/active_job/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'activejob-6.0' do
gem 'activejob', '~> 6.0.0'
end

appraise 'activejob-6.1' do
gem 'activejob', '~> 6.1.0'
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.0.0')
MINIMUM_VERSION = Gem::Version.new('6.1.0')

install do |_config|
require_dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ 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.0.0'
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
4 changes: 0 additions & 4 deletions instrumentation/active_record/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'activerecord-6.0' do
gem 'activerecord', '~> 6.0.0'
end

appraise 'activerecord-6.1' do
gem 'activerecord', '~> 6.1.0'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +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.0.0')
MAX_MAJOR_VERSION = 7
MINIMUM_VERSION = Gem::Version.new('6.1.0')

install do |_config|
require_dependencies
Expand All @@ -22,11 +21,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
end

compatible do
# We know that releases after MAX_MAJOR_VERSION are unstable so we
# check the major version number of the gem installed to make sure we
# do not install on a pre-release or full release of the latest
# if it exceeds the MAX_MAJOR_VERSION version.
gem_version >= MINIMUM_VERSION && gem_version.segments[0] <= MAX_MAJOR_VERSION
Comment on lines -25 to -29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you decide to remove the MAX_MAJOR_VERSION logic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the only place we do it and it felt asymmetric

gem_version >= MINIMUM_VERSION
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'
spec.add_dependency 'ruby2_keywords'

spec.add_development_dependency 'activerecord'
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@
end
end

it 'when a version above the maximum supported gem version is installed' do
ActiveRecord.stub(:version, Gem::Version.new('8.0.0')) do
_(instrumentation.compatible?).must_equal false
end
end

it 'it treats pre releases as being equivalent to a full release' do
ActiveRecord.stub(:version, Gem::Version.new('8.0.0.alpha')) do
_(instrumentation.compatible?).must_equal false
end
end

it 'when supported gem version installed' do
_(instrumentation.compatible?).must_equal true
end
Expand Down
4 changes: 0 additions & 4 deletions instrumentation/active_support/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'activesupport-6.0' do
gem 'activesupport', '~> 6.0.0'
end

appraise 'activesupport-6.1' do
gem 'activesupport', '~> 6.1.0'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ 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')

install do |_config|
require_dependencies
end
Expand All @@ -17,8 +19,16 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
defined?(::ActiveSupport)
end

compatible do
gem_version >= MINIMUM_VERSION
end

private

def gem_version
::ActiveSupport.version
end

def require_dependencies
require_relative 'span_subscriber'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ 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'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.56.1'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
Expand Down
4 changes: 0 additions & 4 deletions instrumentation/rails/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.0' do
gem 'rails', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end
Expand Down
4 changes: 2 additions & 2 deletions instrumentation/rails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Or, if you use [bundler][bundler-home], include `opentelemetry-instrumentation-r

### Version Compatibility

EOL versions of Rails are not supported by the latest version of this instrumentation. If you are using an EOL version of Rails and need an earlier version of this instrumentation, then consider installing and pinning the compatible gem version, e.g.:
EOL versions of Rails are not supported by the latest version of this instrumentation. If you are using an EOL version of Rails and need an earlier version of this instrumentation, then consider installing and pinning the compatible gem version, e.g.:

```console
gem opentelemetry-instrumentation-rails, "<version>"
Expand All @@ -23,7 +23,7 @@ gem opentelemetry-instrumentation-rails, "<version>"
| Rails Version | Instrumentation Version |
| --- | --- |
| `5.2` | `= 0.24.1` |
| `6.0` | `~> 0.24.1` |
| `6.0` | `= 0.28.0` |
| `6.1` | `~> 0.24` |
| `7.x` | `~> 0.24` |

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.0.0')
MINIMUM_VERSION = Gem::Version.new('6.1.0')

# This gem requires the instrumentantion gems for the different
# components of Rails, as a result it does not have any explicit
Expand All @@ -24,7 +24,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
private

def gem_version
::ActionPack.version
::Rails.gem_version
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'rack-test', '~> 2.1.0'
spec.add_development_dependency 'rails', '>= 6'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.56.1'
spec.add_development_dependency 'simplecov', '~> 0.22.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ def initialize_app(use_exceptions_app: false, remove_rack_tracer_middleware: fal
new_app.config.log_level = level

case Rails.version
when /^6\.0/
apply_rails_6_0_configs(new_app)
when /^6\.1/
apply_rails_6_1_configs(new_app)
when /^7\./
Expand Down Expand Up @@ -71,13 +69,6 @@ def add_middlewares(application)
)
end

def apply_rails_6_0_configs(application)
# Required in Rails 6
application.config.hosts << 'example.org'
# Creates a lot of deprecation warnings on subsequent app initializations if not explicitly set.
application.config.action_view.finalize_compiled_template_methods = ActionView::Railtie::NULL_OPTION
end

def apply_rails_6_1_configs(application)
# Required in Rails 6
application.config.hosts << 'example.org'
Expand Down