Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ target :datadog do

# These first checks are likely the easiest to fix, given they capture a mismatch
# between the already declared type in `.rbs` and the actual type inferred by Steep.
hash[Ruby::DifferentMethodParameterKind] = :information
hash[Ruby::IncompatibleAssignment] = :information

# These checks are a bit harder, because they represent the lack of sufficient type information.
Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/appsec/thread_safe_ref.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Datadog

@mutex: ::Mutex

def initialize: (untyped initial_obj) -> void
def initialize: (WAF::Handle initial_obj, ?finalizer: Symbol) -> void

def acquire: () -> untyped

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/core/crashtracking/component.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module Datadog

def start: -> void

def update_on_fork: (settings: Datadog::Core::Configuration::Settings) -> void
def update_on_fork: (?settings: Datadog::Core::Configuration::Settings) -> void

def stop: -> void

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/core/diagnostics/environment_logger.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Datadog
module EnvironmentLogger
extend EnvironmentLogging

def self.collect_and_log!: (Hash[Symbol, untyped] extra_fields) -> void
def self.collect_and_log!: (?Hash[Symbol, untyped]? extra_fields) -> void
end
module EnvironmentCollector
def self.collect_config!: () -> { date: untyped, os_name: untyped, version: untyped, lang: untyped, lang_version: untyped, env: untyped, service: untyped, dd_version: untyped, debug: untyped, tags: untyped, runtime_metrics_enabled: untyped, vm: untyped, health_metrics_enabled: untyped }
Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/core/environment/agent_info.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Datadog
class AgentInfo
attr_reader agent_settings: Configuration::AgentSettings

def initialize: (Configuration::AgentSettings agent_settings, logger: Core::Logger) -> void
def initialize: (Configuration::AgentSettings agent_settings, ?logger: Core::Logger) -> void

def fetch: -> Remote::Transport::HTTP::Negotiation::Response?
end
Expand Down
6 changes: 3 additions & 3 deletions sig/datadog/core/remote/client.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ module Datadog
attr_reader dispatcher: Remote::Dispatcher

attr_reader capabilities: Capabilities

attr_reader logger: Core::Logger

def initialize: (Datadog::Core::Remote::Transport::Config::Transport transport, Capabilities capabilities, ?repository: Configuration::Repository, logger: Core::Logger) -> void
def initialize: (Datadog::Core::Remote::Transport::Config::Transport transport, Capabilities capabilities, ?logger: Core::Logger, ?repository: Configuration::Repository) -> void

def sync: () -> void

Expand All @@ -38,7 +38,7 @@ module Datadog
def tracer_version: () -> ::String
def native_platform: () -> ::String
def ruby_engine_version: () -> ::String

def process_response: (untyped response) -> untyped
def apply_config: (untyped paths, untyped targets, untyped contents) -> untyped

Expand Down
4 changes: 2 additions & 2 deletions sig/datadog/core/remote/negotiation.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ module Datadog
class Negotiation
@transport_root: Datadog::Core::Remote::Transport::Negotiation::Transport
@logged: ::Hash[::Symbol, bool]

attr_reader logger: Core::Logger

def initialize: (Datadog::Core::Configuration::Settings _settings, Datadog::Core::Configuration::AgentSettings agent_settings, logger: Core::Logger, ?suppress_logging: ::Hash[::Symbol, bool]) -> void
def initialize: (Datadog::Core::Configuration::Settings _settings, Datadog::Core::Configuration::AgentSettings agent_settings, ?logger: Core::Logger, ?suppress_logging: ::Hash[::Symbol, bool]) -> void

def endpoint?: (::String path) -> bool

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/core/semaphore.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Datadog

def signal: () -> void

def wait: (Numeric|nil timeout) -> void
def wait: (?Numeric? timeout) -> void

private

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/core/telemetry/component.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module Datadog

def integrations_change!: () -> void

def app_endpoints_loaded: (Event::AppEndpointsLoaded::endpoints endpoints, page_size: Integer) -> void
def app_endpoints_loaded: (Event::AppEndpointsLoaded::endpoints endpoints, ?page_size: Integer) -> void

def inc: (String namespace, String metric_name, Datadog::Core::Telemetry::Metric::input_value value, ?tags: Datadog::Core::Telemetry::Metric::tags_input, ?common: bool) -> void

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/core/telemetry/request.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Datadog
module Core
module Telemetry
module Request
def self.build_payload: (Event::Base event, int seq_id, ?debug: bool) -> ::Hash[Symbol, untyped]
def self.build_payload: (Event::Base event, int seq_id, ?api_version: String, ?debug: bool) -> ::Hash[Symbol, untyped]

private

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/core/transport/http.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Datadog
module Core
module Transport
module HTTP
def self?.build: (api_instance_class: untyped, agent_settings: untyped, logger: untyped, ?api_version: untyped?, ?headers: untyped?) { (untyped) -> untyped } -> HTTP::Builder
def self?.build: (api_instance_class: untyped, agent_settings: untyped, ?logger: untyped, ?api_version: untyped?, ?headers: untyped?) { (untyped) -> untyped } -> HTTP::Builder

def self?.default_headers: () -> untyped
end
Expand Down
6 changes: 3 additions & 3 deletions sig/datadog/core/transport/http/builder.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ module Datadog
attr_reader default_api: untyped

attr_reader default_headers: untyped

attr_reader logger: Core::Logger

attr_reader api_instance_class: untyped

def initialize: (api_instance_class: untyped, logger: Core::Logger) ?{ (untyped) -> untyped } -> void
def initialize: (api_instance_class: untyped, ?logger: Core::Logger) ?{ (untyped) -> untyped } -> void

def adapter: (untyped config, *untyped args, **untyped kwargs) -> untyped

Expand Down
14 changes: 7 additions & 7 deletions sig/datadog/di/serializer.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ module Datadog
class Serializer
MAX_MESSAGE_COLLECTION_SIZE: Integer
MAX_MESSAGE_ATTRIBUTE_COUNT: Integer

@settings: untyped

@redactor: untyped

@telemetry: Core::Telemetry::Component

def initialize: (untyped settings, untyped redactor, ?telemetry: Core::Telemetry::Component) -> void

attr_reader settings: Datadog::Core::Configuration::Settings

attr_reader redactor: Datadog::DI::Redactor

attr_reader telemetry: Core::Telemetry::Component

def combine_args: (untyped args, untyped kwargs, untyped target_self) -> untyped
def serialize_args: (untyped args, untyped kwargs, untyped instance_vars, ?depth: Integer, ?attribute_count: Integer?) -> untyped
def serialize_vars: (untyped vars, ?depth: Integer, ?attribute_count: Integer?) -> untyped
def serialize_value: (untyped value, ?name: String, ?depth: Integer, ?attribute_count: Integer?) -> untyped
def serialize_value: (untyped value, ?name: String?, ?depth: Integer, ?attribute_count: Integer?, ?type: Class?) -> untyped
def serialize_value_for_message: (untyped value, ?::Integer depth) -> untyped
def self.register: (?condition: Proc) {

def self.register: (?condition: Proc) {
(serializer: Serializer, value: untyped, name: Symbol, depth: Integer, ?attribute_count: Integer?) -> untyped } -> void

private
Expand Down
4 changes: 2 additions & 2 deletions sig/datadog/kit/appsec/events/v2.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ module Datadog

TELEMETRY_METRICS_EVENTS_INTO_TYPES: Hash[::String, ::String]

def self.track_user_login_success: (::String login, ?user_or_id user_or_id, attributes metadata) -> void
def self.track_user_login_success: (::String login, ?user_or_id user_or_id, ?attributes metadata) -> void

def self.track_user_login_failure: (::String login, ?bool user_exists, attributes metadata) -> void
def self.track_user_login_failure: (::String login, ?bool user_exists, ?attributes metadata) -> void

private

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/profiling.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Datadog
def self.start_if_enabled: () -> bool
def self.allocation_count: () -> ::Integer?
def self.enabled?: () -> bool
def self.wait_until_running: () -> true
def self.wait_until_running: (?timeout_seconds: Integer) -> true

private

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module Datadog
def self._native_hold_signals: () -> void
def self._native_resume_signals: () -> void

def wait_until_running: (timeout_seconds: ::Integer?) -> true
def wait_until_running: (?timeout_seconds: ::Integer?) -> true

private

Expand Down
30 changes: 15 additions & 15 deletions sig/datadog/profiling/ext/dir_monkey_patches.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ module Datadog
# The signatures below are somehow inspired on
# https://github.com/ruby/rbs/blob/28849d4522ba18f45d4f6edfca89a515a4816373/core/dir.rbs

# NOTE: Because we have variants for Ruby 2.x and 3.x of the code, there's a bunch of warnings from steep about
# that ("Unknown variable: (kwrestarg :kwargs)"). Any suggestions on how to clean that up are welcome :/
# NOTE: Because we have variants for Ruby 2.x and 3.x of the code, we have to make the parameters untyped using ?,
# or there will be a bunch of warnings from steep about that ("Unknown variable: (kwrestarg :kwargs)").

module DirClassMonkeyPatches
def []: (*untyped) -> Array[String]
def children: (*untyped) -> Array[String]
def each_child: (*untyped) -> Enumerator[String, nil] | (*untyped) { (String filename) -> void } -> nil
def empty?: (path path_name) -> bool
def entries: (*untyped) -> Array[String]
def foreach: (*untyped) -> Enumerator[String, nil] | (*untyped) { (String filename) -> void } -> nil
def glob: (*untyped) -> Array[String] | (*untyped) { (String pathname) -> void } -> nil
def home: (?string? user) -> String
def []: (?) -> Array[String]
def children: (?) -> Array[String]
def each_child: (?) -> Enumerator[String, nil]?
def empty?: (?) -> bool
def entries: (?) -> Array[String]
def foreach: (?) -> Enumerator[String, nil]?
def glob: (?) -> Array[String]?
def home: (?) -> String
end

module DirInstanceMonkeyPatches
def each: () { (String) -> void } -> self | () -> Enumerator[String, self]
def each_child: () { (String) -> void } -> self | () -> Enumerator[String, self]
def children: () -> Array[String]
def tell: () -> Integer
def pos: () -> Integer
def each: (?) -> (Enumerator[String, self] | self)
def each_child: (?) -> (Enumerator[String, self] | self)
def children: (?) -> Array[String]
def tell: (?) -> Integer
def pos: (?) -> Integer
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/tracing/metadata/metastruct.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Datadog

def to_h: () -> ::Hash[String | Symbol, untyped]

def to_msgpack: (untyped packer) -> void
def to_msgpack: (?::MessagePack::Packer? packer) -> void

def pretty_print: (untyped q) -> void
end
Expand Down
9 changes: 5 additions & 4 deletions sig/datadog/tracing/span_operation.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ module Datadog
include Metadata::Tagging
include Metadata::Errors
prepend Metadata::Analytics

@logger: Core::Logger

attr_reader logger: Core::Logger

attr_reader links: untyped
Expand Down Expand Up @@ -36,6 +36,7 @@ module Datadog

def initialize: (
String name,
?logger: Core::Logger,
?events: Events,
?on_error: on_error,
?parent_id: Integer,
Expand Down Expand Up @@ -96,7 +97,7 @@ module Datadog
include Tracing::Events

DEFAULT_ON_ERROR: on_error

attr_reader logger: Core::Logger

attr_reader after_finish: untyped
Expand All @@ -123,7 +124,7 @@ module Datadog

class OnError
def initialize: (untyped default, ?logger: Core::Logger) -> void

attr_reader logger: Core::Logger

def wrap_default: () { (untyped, untyped) -> untyped } -> untyped
Expand Down
Loading