Skip to content

Commit

Permalink
feat!: Set minimum supported version to Ruby 3.1 (#1216)
Browse files Browse the repository at this point in the history
* feat!: Set minimum supported version to Ruby 3.1

Ruby 3.0 is no longer receiving security updates.

Per our manitenace policy we will only provide updates for Ruby and library versions that are at a minimum receiving security updates.

Any users that require Ruby support prior to 3.0 should pin their versions

> Ruby 3.0
> status: eol
> release date: 2020-12-25
> normal maintenance until: 2023-04-01
> EOL: 2024-04-23

cc: #1211

* squash: Temporarily disable rule

https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Naming/BlockForwarding

* fix: Duplicate block

* squash: use correct rule

* squash: Apply code review comments

* squash: remove post-install msg
  • Loading branch information
arielvalentin authored Jan 16, 2025
1 parent 717f1c3 commit 4780480
Show file tree
Hide file tree
Showing 65 changed files with 68 additions and 126 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/ci-contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ jobs:
with:
gem: "opentelemetry-helpers-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-helpers-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -89,12 +83,6 @@ jobs:
with:
gem: "opentelemetry-propagator-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-propagator-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -134,15 +122,9 @@ jobs:
with:
gem: "opentelemetry-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-${{ matrix.gem }}"
yard: true
rubocop: true
build: true
ruby: "3.0"
- name: "Test JRuby"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
Expand Down Expand Up @@ -177,12 +159,6 @@ jobs:
with:
gem: "opentelemetry-processor-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-processor-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/ci-instrumentation-with-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -95,11 +90,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -137,11 +127,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -195,11 +180,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -244,11 +224,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -290,11 +265,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/ci-instrumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
release-process-request:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
env:
ruby_version: "3.0"
ruby_version: "3.1"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
release-update-open-requests:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
env:
ruby_version: "3.0"
ruby_version: "3.1"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-perform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
release-perform:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
env:
ruby_version: "3.0"
ruby_version: "3.1"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: ruby/setup-ruby@v1.207.0
with:
ruby-version: "3.0"
ruby-version: "3.1"
bundler: latest
bundler-cache: false
working-directory: ${{ matrix.path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-request-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
release-request:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
env:
ruby_version: "3.0"
ruby_version: "3.1"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
release-request:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
env:
ruby_version: "3.0"
ruby_version: "3.1"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
release-retry:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
env:
ruby_version: "3.0"
ruby_version: "3.1"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .instrumentation_generator/instrumentation_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def add_to_instrumentation_all
insert_into_file("#{instrumentation_all_path}/Gemfile", gemfile_text, after: "gemspec\n")

gemspec_text = "\n spec.add_dependency '#{instrumentation_gem_name}', '~> 0.0.0'"
insert_into_file("#{instrumentation_all_path}/opentelemetry-instrumentation-all.gemspec", gemspec_text, after: "spec.required_ruby_version = '>= 3.0'\n")
insert_into_file("#{instrumentation_all_path}/opentelemetry-instrumentation-all.gemspec", gemspec_text, after: "spec.required_ruby_version = '>= 3.1'\n")

all_rb_text = "\nrequire '#{instrumentation_gem_name}'"
insert_into_file("#{instrumentation_all_path}/lib/opentelemetry/instrumentation/all.rb", all_rb_text, after: "# SPDX-License-Identifier: Apache-2.0\n")
Expand Down
2 changes: 1 addition & 1 deletion .instrumentation_generator/templates/gemspec.tt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> <%= opentelemetry_version %>'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> <%= instrumentation_base_version %>'
Expand Down
8 changes: 7 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require: rubocop-performance

AllCops:
TargetRubyVersion: '3.0'
TargetRubyVersion: '3.1'
NewCops: enable
Exclude:
- Rakefile
Expand Down Expand Up @@ -38,6 +38,12 @@ Metrics/PerceivedComplexity:
Naming/FileName:
Exclude:
- '**/opentelemetry-*'
### TODO: Enable this is a separate PR
Naming/BlockForwarding:
Enabled: false
Style/ArgumentsForwarding:
Enabled: false
#######################
Style/Documentation:
Exclude:
- "**/test/**/*"
Expand Down
1 change: 0 additions & 1 deletion POST_INSTALL_MESSAGE
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
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.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ This repository also contains libraries to aid with interoperability 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 Compatibility
### Ruby and Library Compatibility

All libraries in this repository require Ruby Versions 3.1 or newer.

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

Expand Down
2 changes: 1 addition & 1 deletion helpers/mysql/opentelemetry-helpers-mysql.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-common', '~> 0.21'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-common', '~> 0.21'

Expand Down
5 changes: 0 additions & 5 deletions instrumentation/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,6 @@ If we determine the service container slows down the test suite significantly, i
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.1"
- name: "Test Ruby 3.0"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
yard: true
rubocop: true
build: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-active_support', '~> 0.7'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-active_support', '~> 0.7'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-active_support', '>= 0.7.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-instrumentation-active_model_serializers', '~> 0.21.0'
spec.add_dependency 'opentelemetry-instrumentation-aws_lambda', '~> 0.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-common', '~> 0.21'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1'
Expand Down
Loading

0 comments on commit 4780480

Please sign in to comment.