Skip to content

Commit

Permalink
adding types
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Aug 22, 2023
1 parent 0c96229 commit ae22958
Show file tree
Hide file tree
Showing 20 changed files with 415 additions and 53 deletions.
3 changes: 3 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ target :lib do
check "lib"

library "pathname"
library "json"
library "logger"
library "date"

repo_path "vendor/rbs"
library "ddtrace"
Expand Down
16 changes: 8 additions & 8 deletions sig/datadog/ci/contrib/cucumber/ext.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ module Datadog
module Contrib
module Cucumber
module Ext
APP: "cucumber"
APP: String

ENV_ENABLED: "DD_TRACE_CUCUMBER_ENABLED"
ENV_ENABLED: String

ENV_OPERATION_NAME: "DD_TRACE_CUCUMBER_OPERATION_NAME"
ENV_OPERATION_NAME: String

FRAMEWORK: "cucumber"
FRAMEWORK: String

OPERATION_NAME: "cucumber.test"
OPERATION_NAME: String

SERVICE_NAME: "cucumber"
SERVICE_NAME: String

STEP_SPAN_TYPE: "step"
STEP_SPAN_TYPE: String

TEST_TYPE: "test"
TEST_TYPE: String
end
end
end
Expand Down
14 changes: 7 additions & 7 deletions sig/datadog/ci/contrib/minitest/ext.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ module Datadog
module Contrib
module Minitest
module Ext
APP: "minitest"
APP: String

ENV_ENABLED: "DD_TRACE_MINITEST_ENABLED"
ENV_ENABLED: String

ENV_OPERATION_NAME: "DD_TRACE_MINITEST_OPERATION_NAME"
ENV_OPERATION_NAME: String

FRAMEWORK: "minitest"
FRAMEWORK: String

OPERATION_NAME: "minitest.test"
OPERATION_NAME: String

SERVICE_NAME: "minitest"
SERVICE_NAME: String

TEST_TYPE: "test"
TEST_TYPE: String
end
end
end
Expand Down
14 changes: 7 additions & 7 deletions sig/datadog/ci/contrib/rspec/ext.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ module Datadog
module Contrib
module RSpec
module Ext
APP: "rspec"
APP: String

ENV_ENABLED: "DD_TRACE_RSPEC_ENABLED"
ENV_ENABLED: String

ENV_OPERATION_NAME: "DD_TRACE_RSPEC_OPERATION_NAME"
ENV_OPERATION_NAME: String

FRAMEWORK: "rspec"
FRAMEWORK: String

OPERATION_NAME: "rspec.example"
OPERATION_NAME: String

SERVICE_NAME: "rspec"
SERVICE_NAME: String

TEST_TYPE: "test"
TEST_TYPE: String
end
end
end
Expand Down
24 changes: 12 additions & 12 deletions sig/datadog/ci/ext/environment.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ module Datadog
module Ext
# Defines constants for CI tags
module Environment
TAG_JOB_NAME: "ci.job.name"
TAG_JOB_NAME: String

TAG_JOB_URL: "ci.job.url"
TAG_JOB_URL: String

TAG_PIPELINE_ID: "ci.pipeline.id"
TAG_PIPELINE_ID: String

TAG_PIPELINE_NAME: "ci.pipeline.name"
TAG_PIPELINE_NAME: String

TAG_PIPELINE_NUMBER: "ci.pipeline.number"
TAG_PIPELINE_NUMBER: String

TAG_PIPELINE_URL: "ci.pipeline.url"
TAG_PIPELINE_URL: String

TAG_PROVIDER_NAME: "ci.provider.name"
TAG_PROVIDER_NAME: String

TAG_STAGE_NAME: "ci.stage.name"
TAG_STAGE_NAME: String

TAG_WORKSPACE_PATH: "ci.workspace_path"
TAG_WORKSPACE_PATH: String

TAG_NODE_LABELS: "ci.node.labels"
TAG_NODE_LABELS: String

TAG_NODE_NAME: "ci.node.name"
TAG_NODE_NAME: String

TAG_CI_ENV_VARS: "_dd.ci.env_vars"
TAG_CI_ENV_VARS: String

# PROVIDERS: ::Array[::Array["APPVEYOR" | :extract_appveyor] | ::Array["TF_BUILD" | :extract_azure_pipelines] | ::Array["BITBUCKET_COMMIT" | :extract_bitbucket] | ::Array["BUDDY" | :extract_buddy] | ::Array["BUILDKITE" | :extract_buildkite] | ::Array["CIRCLECI" | :extract_circle_ci] | ::Array["GITHUB_SHA" | :extract_github_actions] | ::Array["GITLAB_CI" | :extract_gitlab] | ::Array["JENKINS_URL" | :extract_jenkins] | ::Array["TEAMCITY_VERSION" | :extract_teamcity] | ::Array["TRAVIS" | :extract_travis] | ::Array["BITRISE_BUILD_SLUG" | :extract_bitrise] | ::Array["CF_BUILD_ID" | :extract_codefresh]]

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/ci/ext/settings.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Datadog
module CI
module Ext
module Settings
ENV_MODE_ENABLED: "DD_TRACE_CI_ENABLED"
ENV_MODE_ENABLED: String
end
end
end
Expand Down
36 changes: 18 additions & 18 deletions sig/datadog/ci/ext/test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@ module Datadog
module CI
module Ext
module Test
CONTEXT_ORIGIN: "ciapp-test"
CONTEXT_ORIGIN: String

TAG_ARGUMENTS: "test.arguments"
TAG_ARGUMENTS: String

TAG_FRAMEWORK: "test.framework"
TAG_FRAMEWORK: String

TAG_FRAMEWORK_VERSION: "test.framework_version"
TAG_FRAMEWORK_VERSION: String

TAG_NAME: "test.name"
TAG_NAME: String

TAG_SKIP_REASON: "test.skip_reason"
TAG_SKIP_REASON: String

TAG_STATUS: "test.status"
TAG_STATUS: String

TAG_SUITE: "test.suite"
TAG_SUITE: String

TAG_TRAITS: "test.traits"
TAG_TRAITS: String

TAG_TYPE: "test.type"
TAG_OS_ARCHITECTURE: "os.architecture"
TAG_TYPE: String
TAG_OS_ARCHITECTURE: String

TAG_OS_PLATFORM: "os.platform"
TAG_OS_PLATFORM: String

TAG_RUNTIME_NAME: "runtime.name"
TAG_RUNTIME_NAME: String

TAG_RUNTIME_VERSION: "runtime.version"
TAG_SPAN_KIND: "span.kind"
TAG_RUNTIME_VERSION: String
TAG_SPAN_KIND: String

module Status
PASS: "pass"
PASS: String

FAIL: "fail"
FAIL: String

SKIP: "skip"
SKIP: String
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions vendor/rbs/ddtrace/0/datadog/core.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Datadog
module Core
end

extend Core::Configuration
end
11 changes: 11 additions & 0 deletions vendor/rbs/ddtrace/0/datadog/core/configuration.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Datadog
module Core
module Configuration
def tracer: () -> Datadog::Tracing::Tracer

def logger: () -> Datadog::Core::Logger

def configuration: () -> untyped # The DSL methods have to be explicitly declared for this to be typed
end
end
end
47 changes: 47 additions & 0 deletions vendor/rbs/ddtrace/0/datadog/core/configuration/components.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module Datadog
module Core
module Configuration
class Components
def self.build_health_metrics: (untyped settings) -> untyped

def self.build_logger: (untyped settings) -> untyped

def self.build_runtime_metrics: (untyped settings) -> untyped

def self.build_runtime_metrics_worker: (untyped settings) -> untyped

def self.build_tracer: (untyped settings, untyped agent_settings) -> untyped

def self.build_telemetry: (untyped settings) -> untyped

private

def self.build_tracer_tags: (untyped settings) -> untyped

def self.build_tracer_options: (untyped settings, untyped agent_settings) -> untyped

def self.build_tracer_test_mode_options: (untyped tracer_options, untyped settings, untyped agent_settings) -> untyped

public

attr_reader health_metrics: untyped

attr_reader logger: untyped

attr_reader profiler: untyped

attr_reader runtime_metrics: untyped

attr_reader tracer: untyped

attr_reader remote: Datadog::Core::Remote::Component

def initialize: (untyped settings) -> untyped

def startup!: (untyped settings) -> untyped

def shutdown!: (?untyped? replacement) -> untyped
end
end
end
end
67 changes: 67 additions & 0 deletions vendor/rbs/ddtrace/0/datadog/core/configuration/settings.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
module Datadog
module Core
module Configuration
class Settings
include Base

interface _Remote
def enabled: () -> bool

def enabled=: (bool) -> void

def poll_interval_seconds: () -> ::Float

def poll_interval_seconds=: (::Float) -> void

def service: () -> ::String?

def service=: (::String) -> void
end

interface _AppSec
def enabled: () -> bool

def enabled=: (bool) -> void

def trace_rate_limit: () -> Integer

def trace_rate_limit=: (Integer) -> void

def obfuscator_key_regex: () -> String

def obfuscator_key_regex=: (String) -> void

def obfuscator_value_regex: () -> String

def obfuscator_value_regex=: (String) -> void

def waf_debug: () -> bool

def waf_debug=: (bool) -> void

def ruleset: () -> (String | Symbol | File | StringIO | ::Hash[untyped, untyped])

def ruleset=: (String | Symbol | File | StringIO | ::Hash[untyped, untyped]) -> void

def using_default?: (Symbol option) -> bool
end

def initialize: (*untyped _) -> untyped

def env: -> String

def service: -> String

def version: -> String?

def logger=: (untyped logger) -> untyped

def runtime_metrics: (?untyped? options) -> untyped

def appsec: (?untyped? options) -> Datadog::Core::Configuration::Settings::_AppSec

def remote: (?untyped? options) -> Datadog::Core::Configuration::Settings::_Remote
end
end
end
end
13 changes: 13 additions & 0 deletions vendor/rbs/ddtrace/0/datadog/core/logger.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Datadog
module Core
class Logger < ::Logger
PREFIX: ::String

def initialize: (*untyped args) ?{ () -> untyped } -> void

def add: (untyped severity, ?untyped? message, ?untyped? progname) { () -> untyped } -> untyped

alias log add
end
end
end
42 changes: 42 additions & 0 deletions vendor/rbs/ddtrace/0/datadog/core/remote/component.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module Datadog
module Core
module Remote
class Component
BARRIER_TIMEOUT: Barrier::timeout_s

attr_reader client: Datadog::Core::Remote::Client
attr_reader worker: Datadog::Core::Remote::Worker

@barrier: Barrier

def initialize: (untyped settings, Datadog::Core::Remote::Client::Capabilities capabilities, Datadog::Core::Configuration::AgentSettingsResolver::AgentSettings agent_settings) -> void

def start: -> void

def started?: -> bool

def sync: () -> void

def shutdown!: () -> void

def self.build: (untyped settings, Datadog::Core::Configuration::AgentSettingsResolver::AgentSettings agent_settings) -> Datadog::Core::Remote::Component?

class Barrier
type timeout_s = ::Integer | ::Float

@once: bool
@timeout: timeout_s?

@mutex: ::Thread::Mutex
@condition: ::Thread::ConditionVariable

def initialize: (?timeout_s? timeout) -> void

def wait_once: (?timeout_s? timeout) -> void
def wait_next: (?timeout_s? timeout) -> void
def lift: () -> void
end
end
end
end
end
Loading

0 comments on commit ae22958

Please sign in to comment.