From dd90f2e7651e3f70ec2180305869afe4f12fd9bb Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 4 Nov 2024 16:05:45 -0500 Subject: [PATCH 1/2] fix rack 3/rackup situation on ruby 3.4 rack 3.1.0 deletes Rack::VERSION constant (in https://github.com/rack/rack/pull/1966), causing our tests to fail. Use Rack::RELEASE instead of Rack::VERSION to work around the issue --- appraisal/ruby-3.4.rb | 3 +++ gemfiles/ruby_3.4_contrib.gemfile | 1 + spec/datadog/tracing/contrib/suite/integration_spec.rb | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/appraisal/ruby-3.4.rb b/appraisal/ruby-3.4.rb index 4c0cf60bd99..43a4e1eb122 100644 --- a/appraisal/ruby-3.4.rb +++ b/appraisal/ruby-3.4.rb @@ -125,6 +125,9 @@ gem 'sneakers', '>= 2.12.0' gem 'sucker_punch' gem 'que', '>= 1.0.0' + + # When Rack 3+ is used, we need rackup. + gem 'rackup' end [ diff --git a/gemfiles/ruby_3.4_contrib.gemfile b/gemfiles/ruby_3.4_contrib.gemfile index 3afda7b1380..aee3ff4df95 100644 --- a/gemfiles/ruby_3.4_contrib.gemfile +++ b/gemfiles/ruby_3.4_contrib.gemfile @@ -43,6 +43,7 @@ gem "sidekiq", "~> 7" gem "sneakers", ">= 2.12.0" gem "sucker_punch" gem "que", ">= 1.0.0" +gem "rackup" group :check do gem "ruby_memcheck", ">= 3" diff --git a/spec/datadog/tracing/contrib/suite/integration_spec.rb b/spec/datadog/tracing/contrib/suite/integration_spec.rb index b6279e74baf..eaf37eb1f8a 100644 --- a/spec/datadog/tracing/contrib/suite/integration_spec.rb +++ b/spec/datadog/tracing/contrib/suite/integration_spec.rb @@ -8,7 +8,7 @@ require 'rack' # `Rack::Handler::WEBrick` was extracted to the `rackup` gem in Rack 3.0 -require 'rackup' if Rack::VERSION[0] >= 3 +require 'rackup' if Gem::Version.new(Rack::RELEASE) >= Gem::Version.new('3') require 'webrick' RSpec.describe 'contrib integration testing', :integration do From 923a3c0da53c1c403b5d2c1644ed98a12734de1b Mon Sep 17 00:00:00 2001 From: p-datadog Date: Tue, 5 Nov 2024 15:30:26 +0000 Subject: [PATCH 2/2] =?UTF-8?q?[=F0=9F=A4=96]=20Lock=20Dependency:=20https?= =?UTF-8?q?://github.com/DataDog/dd-trace-rb/actions/runs/11687262926?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gemfiles/ruby_3.4_contrib.gemfile.lock | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gemfiles/ruby_3.4_contrib.gemfile.lock b/gemfiles/ruby_3.4_contrib.gemfile.lock index d17af5081a1..5054b7d3ce3 100644 --- a/gemfiles/ruby_3.4_contrib.gemfile.lock +++ b/gemfiles/ruby_3.4_contrib.gemfile.lock @@ -113,6 +113,8 @@ GEM rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) + rackup (2.2.0) + rack (>= 3) rainbow (3.1.1) rake (12.3.3) rake-compiler (1.2.7) @@ -247,6 +249,7 @@ DEPENDENCIES pry-stack_explorer que (>= 1.0.0) rack-test + rackup rake (>= 12.3) rake-compiler (~> 1.1, >= 1.1.1) resque