From 135149af9a66adcc181c6c9e1267be39d0aee4f1 Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Mon, 12 Aug 2024 09:31:13 -0700 Subject: [PATCH 1/4] chore: Add Appraisals for Rails 7.2 --- instrumentation/action_mailer/Appraisals | 4 ++++ instrumentation/action_pack/Appraisals | 4 ++++ instrumentation/action_view/Appraisals | 4 ++++ instrumentation/active_record/Appraisals | 4 ++++ instrumentation/active_support/Appraisals | 4 ++++ instrumentation/rails/Appraisals | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/instrumentation/action_mailer/Appraisals b/instrumentation/action_mailer/Appraisals index 018ce75b2..8096ea089 100644 --- a/instrumentation/action_mailer/Appraisals +++ b/instrumentation/action_mailer/Appraisals @@ -15,3 +15,7 @@ end appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end + +appraise 'rails-7.2' do + gem 'rails', '~> 7.2.0' +end diff --git a/instrumentation/action_pack/Appraisals b/instrumentation/action_pack/Appraisals index 018ce75b2..8096ea089 100644 --- a/instrumentation/action_pack/Appraisals +++ b/instrumentation/action_pack/Appraisals @@ -15,3 +15,7 @@ end appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end + +appraise 'rails-7.2' do + gem 'rails', '~> 7.2.0' +end diff --git a/instrumentation/action_view/Appraisals b/instrumentation/action_view/Appraisals index 018ce75b2..8096ea089 100644 --- a/instrumentation/action_view/Appraisals +++ b/instrumentation/action_view/Appraisals @@ -15,3 +15,7 @@ end appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end + +appraise 'rails-7.2' do + gem 'rails', '~> 7.2.0' +end diff --git a/instrumentation/active_record/Appraisals b/instrumentation/active_record/Appraisals index 36f3effee..182dc6783 100644 --- a/instrumentation/active_record/Appraisals +++ b/instrumentation/active_record/Appraisals @@ -15,3 +15,7 @@ end appraise 'activerecord-7.1' do gem 'activerecord', '~> 7.1.0' end + +appraise 'activerecord-7.2' do + gem 'activerecord', '~> 7.2.0' +end diff --git a/instrumentation/active_support/Appraisals b/instrumentation/active_support/Appraisals index 086c10ee9..9ecb3e1ac 100644 --- a/instrumentation/active_support/Appraisals +++ b/instrumentation/active_support/Appraisals @@ -15,3 +15,7 @@ end appraise 'activesupport-7.1' do gem 'activesupport', '~> 7.1.0' end + +appraise 'activesupport-7.2' do + gem 'activesupport', '~> 7.2.0' +end diff --git a/instrumentation/rails/Appraisals b/instrumentation/rails/Appraisals index 018ce75b2..8096ea089 100644 --- a/instrumentation/rails/Appraisals +++ b/instrumentation/rails/Appraisals @@ -15,3 +15,7 @@ end appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end + +appraise 'rails-7.2' do + gem 'rails', '~> 7.2.0' +end From 30457ced4efc40c6fd87b11f448745c3f27fcabc Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Mon, 12 Aug 2024 09:45:14 -0700 Subject: [PATCH 2/4] 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. --- 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/rails/Appraisals | 6 ++++-- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/instrumentation/action_mailer/Appraisals b/instrumentation/action_mailer/Appraisals index 8096ea089..e6c48d017 100644 --- a/instrumentation/action_mailer/Appraisals +++ b/instrumentation/action_mailer/Appraisals @@ -16,6 +16,8 @@ appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end -appraise 'rails-7.2' do - gem 'rails', '~> 7.2.0' +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 8096ea089..e6c48d017 100644 --- a/instrumentation/action_pack/Appraisals +++ b/instrumentation/action_pack/Appraisals @@ -16,6 +16,8 @@ appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end -appraise 'rails-7.2' do - gem 'rails', '~> 7.2.0' +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 8096ea089..e6c48d017 100644 --- a/instrumentation/action_view/Appraisals +++ b/instrumentation/action_view/Appraisals @@ -16,6 +16,8 @@ appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end -appraise 'rails-7.2' do - gem 'rails', '~> 7.2.0' +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 182dc6783..36f641b64 100644 --- a/instrumentation/active_record/Appraisals +++ b/instrumentation/active_record/Appraisals @@ -16,6 +16,8 @@ appraise 'activerecord-7.1' do gem 'activerecord', '~> 7.1.0' end -appraise 'activerecord-7.2' do - gem 'activerecord', '~> 7.2.0' +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 9ecb3e1ac..ef832823b 100644 --- a/instrumentation/active_support/Appraisals +++ b/instrumentation/active_support/Appraisals @@ -16,6 +16,8 @@ appraise 'activesupport-7.1' do gem 'activesupport', '~> 7.1.0' end -appraise 'activesupport-7.2' do - gem 'activesupport', '~> 7.2.0' +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/rails/Appraisals b/instrumentation/rails/Appraisals index 8096ea089..e6c48d017 100644 --- a/instrumentation/rails/Appraisals +++ b/instrumentation/rails/Appraisals @@ -16,6 +16,8 @@ appraise 'rails-7.1' do gem 'rails', '~> 7.1.0' end -appraise 'rails-7.2' do - gem 'rails', '~> 7.2.0' +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') + appraise 'rails-7.2' do + gem 'rails', '~> 7.2.0' + end end From 79d3c1ccb00eb0d76d35ae8d5d273959d082f187 Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Mon, 12 Aug 2024 12:19:02 -0700 Subject: [PATCH 3/4] 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. The gems need updates to support Rails 7.2. --- instrumentation/pg/opentelemetry-instrumentation-pg.gemspec | 2 +- instrumentation/que/Gemfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec index e193ee246..8ac730c83 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', '< 7.2.0', '> 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' From 0a147d6a18252044bffaa75d0f4698310d7fbf4d Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Mon, 12 Aug 2024 12:27:05 -0700 Subject: [PATCH 4/4] chore: Adjust activerecord to bottom limit of 6.1 The bundle would install activerecord 3.2 without this constraint. --- instrumentation/pg/opentelemetry-instrumentation-pg.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec index 8ac730c83..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', '< 7.2.0', '> 6.1.0' + 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'