Skip to content

Commit

Permalink
update namespace for decoupling transport
Browse files Browse the repository at this point in the history
  • Loading branch information
ekump committed Sep 22, 2023
1 parent 4ca9b95 commit 01e2fac
Show file tree
Hide file tree
Showing 38 changed files with 673 additions and 575 deletions.
55 changes: 23 additions & 32 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ target :ddtrace do

check 'lib/'

ignore 'lib/datadog/appsec/contrib/'
ignore 'lib/datadog/ci/contrib/'
ignore 'lib/datadog/tracing/contrib/'

ignore 'lib/datadog/appsec.rb'
ignore 'lib/datadog/appsec/component.rb'
ignore 'lib/datadog/appsec/contrib/'
ignore 'lib/datadog/appsec/contrib/auto_instrument.rb'
ignore 'lib/datadog/appsec/contrib/integration.rb'
ignore 'lib/datadog/appsec/contrib/rack/gateway/request.rb'
Expand Down Expand Up @@ -38,6 +35,7 @@ target :ddtrace do
ignore 'lib/datadog/ci.rb'
ignore 'lib/datadog/ci/configuration/components.rb'
ignore 'lib/datadog/ci/configuration/settings.rb'
ignore 'lib/datadog/ci/contrib/'
ignore 'lib/datadog/ci/contrib/cucumber/configuration/settings.rb'
ignore 'lib/datadog/ci/contrib/cucumber/ext.rb'
ignore 'lib/datadog/ci/contrib/cucumber/formatter.rb'
Expand Down Expand Up @@ -115,6 +113,14 @@ target :ddtrace do
ignore 'lib/datadog/core/telemetry/v1/integration.rb'
ignore 'lib/datadog/core/telemetry/v1/product.rb'
ignore 'lib/datadog/core/telemetry/v1/telemetry_request.rb'
ignore 'lib/datadog/core/transport/ext.rb'
ignore 'lib/datadog/core/transport/http/adapters/net.rb'
ignore 'lib/datadog/core/transport/http/adapters/registry.rb'
ignore 'lib/datadog/core/transport/http/adapters/test.rb'
ignore 'lib/datadog/core/transport/http/adapters/unix_socket.rb'
ignore 'lib/datadog/core/transport/http/api/fallbacks.rb'
ignore 'lib/datadog/core/transport/http/env.rb'
ignore 'lib/datadog/core/transport/http/response.rb'
ignore 'lib/datadog/core/utils.rb'
ignore 'lib/datadog/core/utils/compression.rb'
ignore 'lib/datadog/core/utils/forking.rb'
Expand Down Expand Up @@ -201,6 +207,7 @@ target :ddtrace do
ignore 'lib/datadog/tracing/context.rb'
ignore 'lib/datadog/tracing/context_provider.rb'
ignore 'lib/datadog/tracing/contrib.rb'
ignore 'lib/datadog/tracing/contrib/'
ignore 'lib/datadog/tracing/contrib/action_cable/configuration/settings.rb'
ignore 'lib/datadog/tracing/contrib/action_cable/event.rb'
ignore 'lib/datadog/tracing/contrib/action_cable/events.rb'
Expand Down Expand Up @@ -601,41 +608,25 @@ target :ddtrace do
ignore 'lib/datadog/tracing/trace_operation.rb'
ignore 'lib/datadog/tracing/trace_segment.rb'
ignore 'lib/datadog/tracing/tracer.rb'
ignore 'lib/datadog/tracing/transport/http.rb'
ignore 'lib/datadog/tracing/transport/http/api.rb'
ignore 'lib/datadog/tracing/transport/http/builder.rb'
ignore 'lib/datadog/tracing/transport/http/client.rb'
ignore 'lib/datadog/tracing/transport/http/statistics.rb'
ignore 'lib/datadog/tracing/transport/http/traces.rb'
ignore 'lib/datadog/tracing/transport/io/client.rb'
ignore 'lib/datadog/tracing/transport/io/traces.rb'
ignore 'lib/datadog/tracing/transport/serializable_trace.rb'
ignore 'lib/datadog/tracing/transport/statistics.rb'
ignore 'lib/datadog/tracing/transport/trace_formatter.rb'
ignore 'lib/datadog/tracing/transport/traces.rb'
ignore 'lib/datadog/tracing/utils.rb'
ignore 'lib/datadog/tracing/workers.rb'
ignore 'lib/datadog/tracing/workers/trace_writer.rb'
ignore 'lib/datadog/tracing/writer.rb'
ignore 'lib/ddtrace/auto_instrument.rb'
ignore 'lib/ddtrace/auto_instrument_base.rb'
ignore 'lib/ddtrace/transport/ext.rb'
ignore 'lib/ddtrace/transport/http.rb'
ignore 'lib/ddtrace/transport/http/adapters/net.rb'
ignore 'lib/ddtrace/transport/http/adapters/registry.rb'
ignore 'lib/ddtrace/transport/http/adapters/test.rb'
ignore 'lib/ddtrace/transport/http/adapters/unix_socket.rb'
ignore 'lib/ddtrace/transport/http/api.rb'
ignore 'lib/ddtrace/transport/http/api/endpoint.rb'
ignore 'lib/ddtrace/transport/http/api/fallbacks.rb'
ignore 'lib/ddtrace/transport/http/api/instance.rb'
ignore 'lib/ddtrace/transport/http/api/map.rb'
ignore 'lib/ddtrace/transport/http/api/spec.rb'
ignore 'lib/ddtrace/transport/http/builder.rb'
ignore 'lib/ddtrace/transport/http/client.rb'
ignore 'lib/ddtrace/transport/http/env.rb'
ignore 'lib/ddtrace/transport/http/response.rb'
ignore 'lib/ddtrace/transport/http/statistics.rb'
ignore 'lib/ddtrace/transport/http/traces.rb'
ignore 'lib/ddtrace/transport/io.rb'
ignore 'lib/ddtrace/transport/io/client.rb'
ignore 'lib/ddtrace/transport/io/response.rb'
ignore 'lib/ddtrace/transport/io/traces.rb'
ignore 'lib/ddtrace/transport/parcel.rb'
ignore 'lib/ddtrace/transport/request.rb'
ignore 'lib/ddtrace/transport/response.rb'
ignore 'lib/ddtrace/transport/serializable_trace.rb'
ignore 'lib/ddtrace/transport/statistics.rb'
ignore 'lib/ddtrace/transport/trace_formatter.rb'
ignore 'lib/ddtrace/transport/traces.rb'
ignore 'lib/ddtrace/version.rb'

# References `RubyVM::YJIT`, which does not have type information.
Expand Down
4 changes: 2 additions & 2 deletions sig/datadog/core/remote/client.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Datadog
class SyncError < StandardError
end

attr_reader transport: Datadog::Core::Transport::Config::Transport
attr_reader transport: Datadog::Core::Remote::Transport::Config::Transport

attr_reader repository: Configuration::Repository

Expand All @@ -18,7 +18,7 @@ module Datadog

attr_reader capabilities: Capabilities

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

def sync: () -> void

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

def initialize: (Datadog::Core::Configuration::Settings _settings, Datadog::Core::Configuration::AgentSettingsResolver::AgentSettings agent_settings) -> void
Expand Down
60 changes: 31 additions & 29 deletions sig/datadog/core/remote/transport/config.rbs
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
module Datadog
module Core
module Transport
module Config
# Data transfer object for encoded traces
class EncodedParcel
include Datadog::Transport::Parcel
module Remote
module Transport
module Config
# Data transfer object for encoded traces
class EncodedParcel
include Datadog::Core::Transport::Parcel

def count: () -> untyped
end
def count: () -> untyped
end

# Config request
class Request < Datadog::Transport::Request
end
# Config request
class Request < Datadog::Core::Transport::Request
end

# Config response
module Response
attr_reader roots: untyped
# Config response
module Response
attr_reader roots: untyped

attr_reader targets: untyped
attr_reader targets: untyped

attr_reader target_files: untyped
attr_reader target_files: untyped

attr_reader client_configs: untyped
attr_reader client_configs: untyped

attr_reader empty: bool
attr_reader empty: bool

def empty?: () -> bool
end
def empty?: () -> bool
end

# Config transport
class Transport
attr_reader client: untyped
# Config transport
class Transport
attr_reader client: untyped

attr_reader apis: untyped
attr_reader apis: untyped

attr_reader default_api: untyped
attr_reader default_api: untyped

attr_reader current_api_id: untyped
attr_reader current_api_id: untyped

def initialize: (untyped apis, untyped default_api) -> void
def initialize: (untyped apis, untyped default_api) -> void

# ### there is only one transport! it's negotiation!
def send_config: (untyped payload) -> untyped
# ### there is only one transport! it's negotiation!
def send_config: (untyped payload) -> untyped

def current_api: () -> untyped
def current_api: () -> untyped
end
end
end
end
Expand Down
24 changes: 13 additions & 11 deletions sig/datadog/core/remote/transport/http.rbs
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
module Datadog
module Core
module Transport
module HTTP
DO_NOT_USE_ENVIRONMENT_AGENT_SETTINGS: untyped
module Remote
module Transport
module HTTP
DO_NOT_USE_ENVIRONMENT_AGENT_SETTINGS: untyped

def self?.new: (untyped klass) ?{ (untyped) -> untyped } -> untyped
def self?.new: (untyped klass) ?{ (untyped) -> untyped } -> untyped

def self?.root: (?agent_settings: untyped, **untyped options) ?{ (untyped) -> untyped } -> untyped
def self?.root: (?agent_settings: untyped, **untyped options) ?{ (untyped) -> untyped } -> untyped

def self?.v7: (?agent_settings: untyped, **untyped options) ?{ (untyped) -> untyped } -> untyped
def self?.v7: (?agent_settings: untyped, **untyped options) ?{ (untyped) -> untyped } -> untyped

def self?.default_headers: () -> untyped
def self?.default_headers: () -> untyped

def self?.default_adapter: () -> untyped
def self?.default_adapter: () -> untyped

def self?.default_hostname: (?logger: untyped) -> untyped
def self?.default_hostname: (?logger: untyped) -> untyped

def self?.default_port: (?logger: untyped) -> untyped
def self?.default_port: (?logger: untyped) -> untyped

def self?.default_url: (?logger: untyped) -> nil
def self?.default_url: (?logger: untyped) -> nil
end
end
end
end
Expand Down
14 changes: 8 additions & 6 deletions sig/datadog/core/remote/transport/http/api.rbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module Datadog
module Core
module Transport
module HTTP
module API
ROOT: "root"
V7: "v0.7"
module Remote
module Transport
module HTTP
module API
ROOT: "root"
V7: "v0.7"

def self?.defaults: () -> untyped
def self?.defaults: () -> untyped
end
end
end
end
Expand Down
22 changes: 12 additions & 10 deletions sig/datadog/core/remote/transport/http/api/instance.rbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
module Datadog
module Core
module Transport
module HTTP
module API
class Instance
attr_reader adapter: untyped
module Remote
module Transport
module HTTP
module API
class Instance
attr_reader adapter: untyped

attr_reader headers: untyped
attr_reader headers: untyped

attr_reader spec: untyped
attr_reader spec: untyped

def initialize: (untyped spec, untyped adapter, ?::Hash[untyped, untyped] options) -> void
def initialize: (untyped spec, untyped adapter, ?::Hash[untyped, untyped] options) -> void

def encoder: () -> untyped
def encoder: () -> untyped

def call: (untyped env) -> untyped
def call: (untyped env) -> untyped
end
end
end
end
Expand Down
12 changes: 7 additions & 5 deletions sig/datadog/core/remote/transport/http/api/spec.rbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module Datadog
module Core
module Transport
module HTTP
module API
class Spec
def initialize: () { (untyped) -> untyped } -> void
module Remote
module Transport
module HTTP
module API
class Spec
def initialize: () { (untyped) -> untyped } -> void
end
end
end
end
Expand Down
Loading

0 comments on commit 01e2fac

Please sign in to comment.