Skip to content

Commit

Permalink
extract build_agentless_transport method
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Oct 5, 2023
1 parent d69bfef commit db394f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 13 additions & 9 deletions lib/datadog/ci/configuration/components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,7 @@ def activate_ci!(settings)
settings.ci.enabled = false
return
else
dd_site = settings.site || "datadoghq.com"
agentless_url = settings.ci.agentless_url ||
"https://#{Ext::Transport::TEST_VISIBILITY_INTAKE_HOST_PREFIX}.#{dd_site}:443"

agentless_transport = Datadog::CI::TestVisibility::Transport.new(
api_key: settings.api_key,
url: agentless_url,
env: settings.env
)
agentless_transport = build_agentless_transport(settings)
end
end

Expand All @@ -68,6 +60,18 @@ def activate_ci!(settings)

settings.tracing.test_mode.writer_options = writer_options
end

def build_agentless_transport(settings)
dd_site = settings.site || "datadoghq.com"
agentless_url = settings.ci.agentless_url ||
"https://#{Ext::Transport::TEST_VISIBILITY_INTAKE_HOST_PREFIX}.#{dd_site}:443"

Datadog::CI::TestVisibility::Transport.new(
api_key: settings.api_key,
url: agentless_url,
env: settings.env
)
end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions sig/datadog/ci/configuration/components.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module Datadog
def initialize: (untyped settings) -> void

def activate_ci!: (untyped settings) -> untyped

def build_agentless_transport: (untyped settings) -> Datadog::CI::TestVisibility::Transport
end
end
end
Expand Down

0 comments on commit db394f0

Please sign in to comment.