From c7569f50e4c2aee9d58e761997b3c0a3f908cb31 Mon Sep 17 00:00:00 2001 From: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:51:39 -0700 Subject: [PATCH] test: Update Appraisals for Rails 7.2 (#1112) * chore: Add Appraisals for Rails 7.2 * chore: Add ruby version conditions Rails 7.2.0 requires Ruby 3.1. We test on Ruby 3.0. Prevent running the 7.2 tests on that version. * chore: Restrain pg and que to use Rails < 7.2.0 There is also a bottom constraint of Rails (or Rails-related gems) 6.1.0 to prevent cases where Rails 3.2.0 was installed instead. * chore: Adjust pg activerecord to bottom limit of 6.1 The bundle would install activerecord 3.2 without this constraint. --- instrumentation/action_mailer/Appraisals | 6 ++++++ instrumentation/action_pack/Appraisals | 6 ++++++ instrumentation/action_view/Appraisals | 6 ++++++ instrumentation/active_record/Appraisals | 6 ++++++ instrumentation/active_support/Appraisals | 6 ++++++ instrumentation/pg/opentelemetry-instrumentation-pg.gemspec | 2 +- instrumentation/que/Gemfile | 2 +- instrumentation/rails/Appraisals | 6 ++++++ 8 files changed, 38 insertions(+), 2 deletions(-) diff --git a/instrumentation/action_mailer/Appraisals b/instrumentation/action_mailer/Appraisals index 018ce75b2..e6c48d017 100644 --- a/instrumentation/action_mailer/Appraisals +++ b/instrumentation/action_mailer/Appraisals @@ -15,3 +15,9 @@ end appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end + +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') + appraise 'rails-7.2' do + gem 'rails', '~> 7.2.0' + end +end diff --git a/instrumentation/action_pack/Appraisals b/instrumentation/action_pack/Appraisals index 018ce75b2..e6c48d017 100644 --- a/instrumentation/action_pack/Appraisals +++ b/instrumentation/action_pack/Appraisals @@ -15,3 +15,9 @@ end appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end + +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') + appraise 'rails-7.2' do + gem 'rails', '~> 7.2.0' + end +end diff --git a/instrumentation/action_view/Appraisals b/instrumentation/action_view/Appraisals index 018ce75b2..e6c48d017 100644 --- a/instrumentation/action_view/Appraisals +++ b/instrumentation/action_view/Appraisals @@ -15,3 +15,9 @@ end appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end + +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') + appraise 'rails-7.2' do + gem 'rails', '~> 7.2.0' + end +end diff --git a/instrumentation/active_record/Appraisals b/instrumentation/active_record/Appraisals index 36f3effee..36f641b64 100644 --- a/instrumentation/active_record/Appraisals +++ b/instrumentation/active_record/Appraisals @@ -15,3 +15,9 @@ end appraise 'activerecord-7.1' do gem 'activerecord', '~> 7.1.0' end + +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') + appraise 'activerecord-7.2' do + gem 'activerecord', '~> 7.2.0' + end +end diff --git a/instrumentation/active_support/Appraisals b/instrumentation/active_support/Appraisals index 086c10ee9..ef832823b 100644 --- a/instrumentation/active_support/Appraisals +++ b/instrumentation/active_support/Appraisals @@ -15,3 +15,9 @@ end appraise 'activesupport-7.1' do gem 'activesupport', '~> 7.1.0' end + +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') + appraise 'activesupport-7.2' do + gem 'activesupport', '~> 7.2.0' + end +end diff --git a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec index e193ee246..36fbec863 100644 --- a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec +++ b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec @@ -29,7 +29,7 @@ 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' + 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' diff --git a/instrumentation/que/Gemfile b/instrumentation/que/Gemfile index 46bfbfb01..af89399b5 100644 --- a/instrumentation/que/Gemfile +++ b/instrumentation/que/Gemfile @@ -9,7 +9,7 @@ source 'https://rubygems.org' gemspec group :test do - gem 'activerecord' + gem 'activerecord', '< 7.2.0', '> 6.1.0' gem 'pg' gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' gem 'opentelemetry-instrumentation-base', path: '../base' diff --git a/instrumentation/rails/Appraisals b/instrumentation/rails/Appraisals index 018ce75b2..e6c48d017 100644 --- a/instrumentation/rails/Appraisals +++ b/instrumentation/rails/Appraisals @@ -15,3 +15,9 @@ end appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end + +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') + appraise 'rails-7.2' do + gem 'rails', '~> 7.2.0' + end +end