From eb00e21ffac1de973172ae9aba905e2affd0a605 Mon Sep 17 00:00:00 2001 From: TonyCTHsu <16049123+TonyCTHsu@users.noreply.github.com> Date: Sun, 22 Sep 2024 00:06:03 +0000 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9F=A4=96]=20Update=20Latest=20Dependen?= =?UTF-8?q?cy:=20https://github.com/DataDog/dd-trace-rb/actions/runs/10976?= =?UTF-8?q?621387?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gemfiles/jruby_9.2_elasticsearch_latest.gemfile.lock | 2 +- gemfiles/jruby_9.2_opensearch_latest.gemfile.lock | 2 +- gemfiles/ruby_2.5_elasticsearch_latest.gemfile.lock | 2 +- gemfiles/ruby_2.5_opensearch_latest.gemfile.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gemfiles/jruby_9.2_elasticsearch_latest.gemfile.lock b/gemfiles/jruby_9.2_elasticsearch_latest.gemfile.lock index 35901d75ce1..51dd265cf16 100644 --- a/gemfiles/jruby_9.2_elasticsearch_latest.gemfile.lock +++ b/gemfiles/jruby_9.2_elasticsearch_latest.gemfile.lock @@ -49,7 +49,7 @@ GEM elasticsearch-api (= 8.15.0) elasticsearch-api (8.15.0) multi_json - faraday (1.10.3) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) diff --git a/gemfiles/jruby_9.2_opensearch_latest.gemfile.lock b/gemfiles/jruby_9.2_opensearch_latest.gemfile.lock index 28afcee9cab..1cbef63d826 100644 --- a/gemfiles/jruby_9.2_opensearch_latest.gemfile.lock +++ b/gemfiles/jruby_9.2_opensearch_latest.gemfile.lock @@ -41,7 +41,7 @@ GEM diff-lcs (1.5.1) docile (1.4.1) dogstatsd-ruby (5.6.1) - faraday (1.10.3) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) diff --git a/gemfiles/ruby_2.5_elasticsearch_latest.gemfile.lock b/gemfiles/ruby_2.5_elasticsearch_latest.gemfile.lock index 7113d384268..3cf848ce739 100644 --- a/gemfiles/ruby_2.5_elasticsearch_latest.gemfile.lock +++ b/gemfiles/ruby_2.5_elasticsearch_latest.gemfile.lock @@ -53,7 +53,7 @@ GEM elasticsearch-api (8.15.0) multi_json extlz4 (0.3.4) - faraday (1.10.3) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) diff --git a/gemfiles/ruby_2.5_opensearch_latest.gemfile.lock b/gemfiles/ruby_2.5_opensearch_latest.gemfile.lock index 2e524651e07..1032d80d3b2 100644 --- a/gemfiles/ruby_2.5_opensearch_latest.gemfile.lock +++ b/gemfiles/ruby_2.5_opensearch_latest.gemfile.lock @@ -45,7 +45,7 @@ GEM docile (1.4.1) dogstatsd-ruby (5.6.1) extlz4 (0.3.4) - faraday (1.10.3) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) From a6b9175c28ad18b7ce2794049b6614f074f73d67 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:57:07 -0400 Subject: [PATCH 2/2] DEBUG-2334 upgrade steep & rbs (#3950) * DEBUG-2334 upgrade steep & rbs * return appsec settings to correct type signature and exclude the file from steep --------- Co-authored-by: Oleg Pudeyev --- Gemfile | 4 ++-- Steepfile | 4 ++++ lib/datadog/core/environment/execution.rb | 10 +++++----- lib/datadog/core/remote/tie.rb | 2 ++ sig/datadog/core/remote/tie.rbs | 4 ++-- sig/datadog/core/telemetry/event.rbs | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 38384131c01..d25788ece52 100644 --- a/Gemfile +++ b/Gemfile @@ -82,8 +82,8 @@ end group :check do if RUBY_VERSION >= '3.0.0' && RUBY_PLATFORM != 'java' - gem 'rbs', '~> 3.2.0', require: false - gem 'steep', '~> 1.6.0', require: false + gem 'rbs', '~> 3.5.0', require: false + gem 'steep', '~> 1.7.0', require: false end gem 'ruby_memcheck', '>= 3' if RUBY_VERSION >= '3.4.0' && RUBY_PLATFORM != 'java' gem 'standard', require: false diff --git a/Steepfile b/Steepfile index dfae78bba26..853aa813e01 100644 --- a/Steepfile +++ b/Steepfile @@ -5,6 +5,8 @@ target :datadog do ignore 'lib/datadog/appsec.rb' ignore 'lib/datadog/appsec/component.rb' + # Excluded due to https://github.com/soutaro/steep/issues/1232 + ignore 'lib/datadog/appsec/configuration/settings.rb' ignore 'lib/datadog/appsec/contrib/' ignore 'lib/datadog/appsec/contrib/auto_instrument.rb' ignore 'lib/datadog/appsec/contrib/integration.rb' @@ -69,6 +71,8 @@ target :datadog do ignore 'lib/datadog/core/metrics/options.rb' ignore 'lib/datadog/core/pin.rb' ignore 'lib/datadog/core/rate_limiter.rb' + # steep fails in this file due to https://github.com/soutaro/steep/issues/1231 + ignore 'lib/datadog/core/remote/tie.rb' ignore 'lib/datadog/core/runtime/ext.rb' ignore 'lib/datadog/core/runtime/metrics.rb' ignore 'lib/datadog/core/transport/ext.rb' diff --git a/lib/datadog/core/environment/execution.rb b/lib/datadog/core/environment/execution.rb index 2049773a8d4..6d4a084ebec 100644 --- a/lib/datadog/core/environment/execution.rb +++ b/lib/datadog/core/environment/execution.rb @@ -25,9 +25,9 @@ def development? # 2. Checking if `Net::HTTP` is referring to the original one # => ::Net::HTTP.equal?(::WebMock::HttpLibAdapters::NetHttpAdapter::OriginalNetHTTP) def webmock_enabled? - defined?(::WebMock::HttpLibAdapters::NetHttpAdapter) && + !!(defined?(::WebMock::HttpLibAdapters::NetHttpAdapter) && defined?(::Net::HTTP) && - ::Net::HTTP.equal?(::WebMock::HttpLibAdapters::NetHttpAdapter.instance_variable_get(:@webMockNetHTTP)) + ::Net::HTTP.equal?(::WebMock::HttpLibAdapters::NetHttpAdapter.instance_variable_get(:@webMockNetHTTP))) end private @@ -68,7 +68,7 @@ def minitest? # Check if we are running from `bin/cucumber` or `cucumber/rake/task`. def cucumber? - defined?(::Cucumber::Cli) + !!defined?(::Cucumber::Cli) end # If this is a Rails application, use different heuristics to detect @@ -80,7 +80,7 @@ def rails_development? # detecting its presence is enough to deduct if this is a development environment. # # @see https://github.com/rails/spring/blob/48b299348ace2188444489a0c216a6f3e9687281/README.md?plain=1#L204-L207 - defined?(::Spring) || rails_env_development? + !!defined?(::Spring) || rails_env_development? end RAILS_ENV_DEVELOPMENT = Set['development', 'test'].freeze @@ -94,7 +94,7 @@ def rails_development? # it's common to have a custom "staging" environment, and such environment normally want to run as close # to production as possible. def rails_env_development? - defined?(::Rails.env) && RAILS_ENV_DEVELOPMENT.include?(::Rails.env) + !!defined?(::Rails.env) && RAILS_ENV_DEVELOPMENT.include?(::Rails.env) end end end diff --git a/lib/datadog/core/remote/tie.rb b/lib/datadog/core/remote/tie.rb index f4279a471ba..ef0d331529a 100644 --- a/lib/datadog/core/remote/tie.rb +++ b/lib/datadog/core/remote/tie.rb @@ -19,6 +19,8 @@ def self.boot barrier = Datadog::Core::Remote.active_remote.barrier(:once) end + # steep does not permit the next line due to + # https://github.com/soutaro/steep/issues/1231 Boot.new(barrier, t) end end diff --git a/sig/datadog/core/remote/tie.rbs b/sig/datadog/core/remote/tie.rbs index b4af9d4f2d4..793db6c802d 100644 --- a/sig/datadog/core/remote/tie.rbs +++ b/sig/datadog/core/remote/tie.rbs @@ -2,14 +2,14 @@ module Datadog module Core module Remote module Tie - class Boot < ::Struct[untyped] + class Boot < ::Struct[[Component::Barrier, Numeric]] def initialize: (Component::Barrier? barrier, Numeric? time) -> void attr_reader barrier: Component::Barrier attr_reader time: Numeric end - def self.boot: () -> (nil | Boot) + def self.boot: () -> Boot? end end end diff --git a/sig/datadog/core/telemetry/event.rbs b/sig/datadog/core/telemetry/event.rbs index 12fd27713c1..4818992176f 100644 --- a/sig/datadog/core/telemetry/event.rbs +++ b/sig/datadog/core/telemetry/event.rbs @@ -24,7 +24,7 @@ module Datadog def agent_transport: (untyped config) -> String - def conf_value: (String name, Object value, Integer seq_id, ?String origin) -> Hash[Symbol, untyped] + def conf_value: (String name, untyped value, Integer seq_id, ?String origin) -> Hash[Symbol, untyped] def to_value: (Object value) -> Object