Skip to content

Commit

Permalink
FINALLY IT WORKS
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Aug 23, 2023
1 parent 787bbe0 commit 87ba255
Show file tree
Hide file tree
Showing 72 changed files with 2,077 additions and 11 deletions.
5 changes: 5 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ target :lib do

check "lib"

ignore "lib/datadog/ci/configuration/settings.rb"

library "pathname"
library "json"
library "logger"
library "date"
library "minitest"
library "net-http"

repo_path "vendor/rbs"
library "ddtrace"
library "gem"
library "open3"
library "rspec"
library "cucumber"
end
2 changes: 1 addition & 1 deletion lib/datadog/ci/contrib/minitest/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def before_setup
test_name = "#{class_name}##{name}"

path, = method(name).source_location
test_suite = Pathname.new(path).relative_path_from(Pathname.pwd).to_s
test_suite = Pathname.new(path.to_s).relative_path_from(Pathname.pwd).to_s

span = CI::Test.trace(
configuration[:operation_name],
Expand Down
4 changes: 3 additions & 1 deletion sig/datadog/ci.rbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Datadog
module CI
VERSION: String
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
VERSION: String
class Error < StandardError
end
end
end
2 changes: 1 addition & 1 deletion sig/datadog/ci/configuration/components.rbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Datadog
module CI
module Configuration
module Components
module Components : Datadog::Core::Configuration::Components
def initialize: (untyped settings) -> void

def activate_ci!: (untyped settings) -> untyped
Expand Down
3 changes: 3 additions & 0 deletions sig/datadog/ci/configuration/settings.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ module Datadog
module CI
module Configuration
module Settings
extend Datadog::Core::Configuration::Options::ClassMethods
extend Datadog::Core::Configuration::Base::ClassMethods

def self.extended: (untyped base) -> untyped

def self.add_settings!: (untyped base) -> untyped
Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/ci/contrib/cucumber/instrumentation.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Datadog
module Cucumber
module Instrumentation
def self.included: (untyped base) -> untyped
module InstanceMethods
module InstanceMethods : Cucumber::Runtime
attr_reader datadog_formatter: untyped

def formatters: () -> untyped
Expand Down
5 changes: 3 additions & 2 deletions sig/datadog/ci/contrib/cucumber/integration.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ module Datadog
module Contrib
module Cucumber
class Integration
include Datadog::Tracing::Contrib::Integration
extend Datadog::Tracing::Contrib::Integration

MINIMUM_VERSION: untyped

def self.version: () -> untyped

def self.loaded?: () -> untyped

def self.compatible?: () -> untyped
def compatible?: () -> bool

def auto_instrument?: () -> false

def new_configuration: () -> untyped
Expand Down
4 changes: 3 additions & 1 deletion sig/datadog/ci/contrib/minitest/hooks.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ module Datadog
module CI
module Contrib
module Minitest
module Hooks
module Hooks : ::Minitest::Test
include ::Minitest::Test::LifecycleHooks

def before_setup: () -> (nil | untyped)

def after_teardown: () -> untyped
Expand Down
5 changes: 3 additions & 2 deletions sig/datadog/ci/contrib/minitest/integration.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ module Datadog
module Contrib
module Minitest
class Integration
include Datadog::Tracing::Contrib::Integration
extend Datadog::Tracing::Contrib::Integration

MINIMUM_VERSION: untyped

def self.version: () -> untyped

def self.loaded?: () -> untyped

def self.compatible?: () -> untyped
def compatible?: () -> bool

def auto_instrument?: () -> false

def new_configuration: () -> untyped
Expand Down
1 change: 0 additions & 1 deletion sig/datadog/ci/contrib/rspec/integration.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module Datadog
module RSpec
class Integration
extend Datadog::Tracing::Contrib::Integration
include Datadog::Tracing::Contrib::Integration

MINIMUM_VERSION: untyped

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/ci/test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Datadog
module Test
self.@environment_tags: Hash[String, String]

def self.trace: (untyped span_name, ?::Hash[untyped, untyped] options) { (untyped, untyped) -> untyped } -> untyped
def self.trace: (untyped span_name, ?::Hash[untyped, untyped] options) ?{ (untyped, untyped) -> untyped } -> untyped
def self.set_tags!: (untyped trace, untyped span, ?::Hash[untyped, untyped] tags) -> untyped

def self.passed!: (untyped span) -> untyped
Expand Down
6 changes: 6 additions & 0 deletions vendor/rbs/cucumber/0/cucumber.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Cucumber
end

class Cucumber::Runtime
def formatters: () -> untyped
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
module Datadog
module Core
module Configuration
class AgentSettingsResolver
class AgentSettings < ::Struct[untyped]
def initialize: (adapter: untyped, ssl: untyped, hostname: untyped, port: untyped, uds_path: untyped, timeout_seconds: untyped, deprecated_for_removal_transport_configuration_proc: untyped) -> void
def merge: (**::Hash[untyped, untyped] member_values) -> AgentSettingsResolver

attr_reader adapter: untyped
attr_reader ssl: untyped
attr_reader hostname: untyped
attr_reader port: untyped
attr_reader uds_path: untyped
attr_reader timeout_seconds: untyped
attr_reader deprecated_for_removal_transport_configuration_proc: untyped
end

def self.call: (untyped settings, ?logger: untyped) -> untyped

private

attr_reader logger: untyped

attr_reader settings: untyped

def initialize: (untyped settings, ?logger: untyped) -> void

def call: () -> untyped

def adapter: () -> untyped

def configured_hostname: () -> untyped

def configured_port: () -> untyped

def try_parsing_as_integer: (value: untyped, friendly_name: untyped) -> untyped

def ssl?: () -> untyped

def hostname: () -> untyped

def port: () -> untyped

def uds_path: () -> untyped

def timeout_seconds: () -> untyped

def deprecated_for_removal_transport_configuration_proc: () -> (untyped | nil)

def uds_fallback: () -> untyped

def should_use_uds_fallback?: () -> untyped

def parsed_url: () -> untyped

def pick_from: (*untyped configurations_in_priority_order) -> untyped

def warn_if_configuration_mismatch: (untyped detected_configurations_in_priority_order) -> (nil | untyped)

def log_warning: (untyped message) -> (untyped | nil)

def transport_options: () -> untyped

class DetectedConfiguration
attr_reader friendly_name: untyped

attr_reader value: untyped

def initialize: (friendly_name: untyped, value: untyped) -> void

def value?: () -> untyped
end

TransportOptions: untyped

class TransportOptionsResolver
def initialize: (untyped transport_options) -> void

def adapter: (untyped kind_or_custom_adapter, *untyped args, **untyped kwargs) -> nil
end
end
end
end
end
43 changes: 43 additions & 0 deletions vendor/rbs/ddtrace/0/datadog/core/configuration/option.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module Datadog
module Core
module Configuration
class Option
attr_reader definition: untyped

module Precedence
REMOTE_CONFIGURATION: ::Array[2 | :remote_configuration]
PROGRAMMATIC: ::Array[1 | :programmatic]
DEFAULT: ::Array[0 | :default]
end

def initialize: (untyped definition, untyped context) -> void

def set: (untyped value, ?precedence: untyped) -> untyped

def get: () -> untyped

def reset: () -> untyped

def default_value: () -> untyped

def default_precedence?: () -> untyped

private

def coerce_env_variable: (untyped value) -> untyped

def validate_type: (untyped value) -> untyped

def validate: (untyped type, untyped value) -> untyped

def context_exec: (*untyped args) { () -> untyped } -> untyped

def context_eval: () { () -> untyped } -> untyped

def set_value_from_env_or_default: () -> untyped

attr_reader precedence_set: untyped
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
module Datadog
module Core
module Configuration
class OptionDefinition
IDENTITY: untyped

attr_reader default: untyped

attr_reader experimental_default_proc: untyped

attr_reader env: untyped

attr_reader deprecated_env: untyped

attr_reader env_parser: untyped

attr_reader delegate_to: untyped

attr_reader depends_on: untyped

attr_reader name: untyped

attr_reader on_set: untyped

attr_reader resetter: untyped

attr_reader setter: untyped

def initialize: (untyped name, ?::Hash[untyped, untyped] meta) { () -> untyped } -> untyped

def build: (untyped context) -> untyped

class Builder
attr_reader helpers: untyped

def initialize: (untyped name, ?::Hash[untyped, untyped] options) { (untyped) -> untyped } -> untyped

def depends_on: (*untyped values) -> untyped

def default: (?untyped? value) ?{ () -> untyped } -> untyped

def experimental_default_proc: () { () -> untyped } -> untyped

def delegate_to: () { () -> untyped } -> untyped

def env: (untyped value) -> untyped

def deprecated_env: (untyped value) -> untyped

def env_parser: () { (String env_value) -> untyped } -> untyped

def type: (Symbol value, ?::Hash[untyped, untyped] type_options) -> untyped

def helper: (untyped name, *untyped _args) { () -> untyped } -> untyped

def on_set: () { (untyped value) -> untyped } -> untyped

def resetter: () { (untyped value) -> untyped } -> untyped

def setter: () { (untyped value) -> untyped } -> untyped

def apply_options!: (?::Hash[untyped, untyped] options) -> (nil | untyped)

def to_definition: () -> untyped

def meta: () -> { default: untyped, delegate_to: untyped, depends_on: untyped, on_set: untyped, resetter: untyped, setter: untyped }
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Datadog
module Core
module Configuration
class OptionDefinitionSet < Hash[untyped, untyped]
def dependency_order: () -> untyped

def dependency_graph: () -> untyped
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Datadog
module Core
module Configuration
class OptionSet < Hash[untyped, untyped]
end
end
end
end
Loading

0 comments on commit 87ba255

Please sign in to comment.