Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEBUG-2334 upgrade steep & rbs #3950

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,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'
Expand Down
10 changes: 5 additions & 5 deletions lib/datadog/core/environment/execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog/core/remote/tie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/appsec/configuration/settings.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Datadog

def self.add_settings!: (untyped base) -> untyped

def self.enabled: -> bool
def enabled: -> bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look correct 🤔. Including this module in a class does not seem to cause a class to have a #enabled method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a case of soutaro/steep#1232.

end
end
end
Expand Down
4 changes: 2 additions & 2 deletions sig/datadog/core/remote/tie.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/core/telemetry/event.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading