Skip to content

Commit

Permalink
fix: Stop testing against Ruby 2.7
Browse files Browse the repository at this point in the history
This is the first commit signaling dropping support for Ruby 2.7 where we no longer run compatability tests in CI.

#363
  • Loading branch information
arielvalentin committed Mar 25, 2023
1 parent 3efcbdf commit 9b16221
Show file tree
Hide file tree
Showing 74 changed files with 201 additions and 323 deletions.
4 changes: 2 additions & 2 deletions .github/actions/test_gem/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ runs:
# ...but not for appraisals, sadly.
- name: Install Ruby ${{ inputs.ruby }} with dependencies
if: "${{ steps.setup.outputs.appraisals == 'false' }}"
uses: ruby/setup-ruby@v1.139.0
uses: ruby/setup-ruby@v1.144.1
with:
ruby-version: "${{ inputs.ruby }}"
working-directory: "${{ steps.setup.outputs.gem_dir }}"
Expand All @@ -68,7 +68,7 @@ runs:
# If we're using appraisals, do it all manually.
- name: Install Ruby ${{ inputs.ruby }} without dependencies
if: "${{ steps.setup.outputs.appraisals == 'true' }}"
uses: ruby/setup-ruby@v1.139.0
uses: ruby/setup-ruby@v1.144.1
with:
ruby-version: "${{ inputs.ruby }}"
bundler: "latest"
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/ci-contrib-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ jobs:
with:
gem: "opentelemetry-propagator-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-propagator-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand All @@ -51,7 +45,7 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-propagator-${{ matrix.gem }}"
ruby: "jruby-9.4.0.0"
ruby: "jruby-9.4.2.0"
- name: "Test truffleruby"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
Expand Down Expand Up @@ -89,12 +83,6 @@ jobs:
with:
gem: "opentelemetry-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand All @@ -103,7 +91,7 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-${{ matrix.gem }}"
ruby: "jruby-9.4.0.0"
ruby: "jruby-9.4.2.0"
- name: "Test truffleruby"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/ci-contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ jobs:
with:
gem: "opentelemetry-propagator-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-propagator-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand All @@ -53,7 +47,7 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-propagator-${{ matrix.gem }}"
ruby: "jruby-9.4.0.0"
ruby: "jruby-9.4.2.0"

resource-detectors:
strategy:
Expand Down Expand Up @@ -82,19 +76,13 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
ruby: "3.0"
- name: "Test JRuby"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-${{ matrix.gem }}"
ruby: "jruby-9.4.0.0"
ruby: "jruby-9.4.2.0"
8 changes: 1 addition & 7 deletions .github/workflows/ci-instrumentation-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -107,7 +101,7 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "jruby-9.4.0.0"
ruby: "jruby-9.4.2.0"
- name: "Truffleruby Filter"
id: truffleruby_skip
shell: bash
Expand Down
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.0"
- name: "Test Ruby 2.7"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand All @@ -74,7 +69,7 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "jruby-9.4.0.0"
ruby: "jruby-9.4.2.0"
- name: "Truffleruby Filter"
id: truffleruby_skip
shell: bash
Expand Down
34 changes: 2 additions & 32 deletions .github/workflows/ci-instrumentation-with-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,14 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
- name: "Test JRuby"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "jruby-9.4.0.0"
ruby: "jruby-9.4.2.0"
services:
memcached:
image: memcached:alpine
Expand Down Expand Up @@ -89,11 +84,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -131,11 +121,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -189,11 +174,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand All @@ -219,7 +199,7 @@ jobs:
- que
os:
- ubuntu-latest
name: mysql / ${{ matrix.gem }} / ${{ matrix.os }}
name: postgresql / ${{ matrix.gem }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -238,11 +218,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -284,11 +259,6 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/ci-instrumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,9 @@ jobs:
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "3.0"
- name: "Test Ruby 2.7"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "2.7"
yard: true
rubocop: true
build: true
- name: "JRuby Filter"
id: jruby_skip
shell: bash
Expand All @@ -95,4 +92,4 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "jruby-9.4.0.0"
ruby: "jruby-9.4.2.0"
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: "2.7"
ruby_version: "3.0"
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: "2.7"
ruby_version: "3.0"
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: "2.7"
ruby_version: "3.0"
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: "2.7"
ruby_version: "3.0"
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: "2.7"
ruby_version: "3.0"
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 = '>= 2.6.0'\n")
insert_into_file("#{instrumentation_all_path}/opentelemetry-instrumentation-all.gemspec", gemspec_text, after: "spec.required_ruby_version = '>= 3.0'
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
6 changes: 3 additions & 3 deletions .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 = '>= 2.7.6'
spec.required_ruby_version = '>= 3.0'

spec.add_dependency 'opentelemetry-api', '~> <%= opentelemetry_version %>'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> <%= instrumentation_base_version %>'
Expand All @@ -32,9 +32,9 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.0'
spec.add_development_dependency 'opentelemetry-test-helpers'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.41.1'
spec.add_development_dependency 'rubocop', '~> 1.48.1'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
spec.add_development_dependency 'webmock', '~> 3.7.6'
spec.add_development_dependency 'yard', '~> 0.9'
Expand Down
4 changes: 3 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: '2.7.6'
TargetRubyVersion: '3.0'
NewCops: enable
Exclude:
- Rakefile
Expand All @@ -9,6 +9,8 @@ AllCops:
- "**/**/vendor/bundle/**/*"
Bundler/OrderedGems:
Enabled: false
Gemspec/DevelopmentDependencies:
Enabled: false
Gemspec/RequiredRubyVersion:
Enabled: false
Lint/ConstantDefinitionInBlock:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration for Ruby base image
ARG ALPINE_VERSION=3.17
ARG RUBY_VERSION=3.1
ARG RUBY_VERSION=3.2

FROM ruby:"${RUBY_VERSION}-alpine${ALPINE_VERSION}" as ruby

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
source 'https://rubygems.org'

gem 'rake', '~> 13.0'
gem 'rubocop', '~> 1.48.0'
gem 'rubocop', '~> 1.48.1'
6 changes: 2 additions & 4 deletions instrumentation/action_pack/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
appraise 'rails-7.0' do
gem 'rails', '~> 7.0.0'
end
appraise 'rails-7.0' do
gem 'rails', '~> 7.0.0'
end
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 = '>= 2.6.0'
spec.required_ruby_version = '>= 3.0'

spec.add_dependency 'opentelemetry-api', '~> 1.0'
spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.21.0'
Expand All @@ -33,10 +33,10 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
spec.add_development_dependency 'opentelemetry-test-helpers'
spec.add_development_dependency 'rails'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'rails', '>= 6'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.41.1'
spec.add_development_dependency 'rubocop', '~> 1.48.1'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
spec.add_development_dependency 'webmock', '~> 3.7.6'
spec.add_development_dependency 'yard', '~> 0.9'
Expand Down
Loading

0 comments on commit 9b16221

Please sign in to comment.