Skip to content

fix(internal/civisibility): fix agent UDS requests#4852

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
feat/ci-visibility-uds-client
Jun 4, 2026
Merged

fix(internal/civisibility): fix agent UDS requests#4852
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
feat/ci-visibility-uds-client

Conversation

@tonyredondo

Copy link
Copy Markdown
Member

What does this PR do?

Fixes the CI Visibility helper client when DD_TRACE_AGENT_URL is configured with a Unix domain socket. The helper client now captures the raw socket path before rewriting the base URL to the synthetic UDS host and reuses the shared internal.UDSClient and internal.UnixDataSocketURL helpers.

Adds agent-mode UDS coverage for the CI Visibility helper endpoints: settings, known tests, search commits, skippable tests, test management, packfile upload, coverage upload, and logs upload.

Motivation

The previous UDS branch built a custom dialer that closed over agentURL.Path, then reassigned agentURL to the synthetic HTTP URL. By request time agentURL.Path was empty, causing agent-mode requests to fail with dial unix: missing address.

Testing

  • go test ./internal/civisibility/utils/net -run 'TestClientAgentModeUDS' -count=1
  • go test ./internal/civisibility/utils/net -count=1
  • go test -race ./internal/civisibility/utils/net -count=1
  • go test ./internal -run 'TestUnixDataSocketURL|TestUDSClientTransportConfig|TestUDSConcurrentConnectionReuse|TestUDSServerCloseRecovery' -count=1
  • go test ./ddtrace/tracer -run 'TestCiVisibilityTransport|TestCIVisibilityTransportSecureLogging' -count=1
  • go test ./internal/civisibility/... -count=1
  • go test -race ./internal/civisibility/... -count=1
  • git diff --check

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.63%. Comparing base (72b6fb0) to head (b964609).

Additional details and impacted files
Files with missing lines Coverage Δ
internal/civisibility/utils/net/client.go 93.18% <100.00%> (+11.11%) ⬆️

... and 287 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-official

datadog-official Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 62.99% (+0.03%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a279241 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jun 4, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-04 12:08:15

Comparing candidate commit a279241 in PR branch feat/ci-visibility-uds-client with baseline commit 72b6fb0 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 297 metrics, 2 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:BenchmarkOTLPTraceWriterFlush

@tonyredondo
tonyredondo force-pushed the feat/ci-visibility-uds-client branch from b964609 to d96103d Compare June 4, 2026 11:27
@tonyredondo
tonyredondo marked this pull request as ready for review June 4, 2026 11:30
@tonyredondo
tonyredondo requested a review from a team as a code owner June 4, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes CI Visibility’s internal helper client when DD_TRACE_AGENT_URL is configured as a Unix domain socket by ensuring the raw socket path is preserved and reused via shared internal.UDSClient / internal.UnixDataSocketURL helpers, and adds agent-mode UDS regression coverage for the CI Visibility helper endpoints.

Changes:

  • Replace the custom UDS transport/dialer logic with internal.UDSClient(...) and base URL rewriting via internal.UnixDataSocketURL(...).
  • Add comprehensive agent-mode UDS tests covering settings, known tests, search commits, skippable tests, test management, packfile upload, coverage upload, and logs upload endpoints.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/civisibility/utils/net/client.go Switch agent-mode UDS handling to shared internal helpers to avoid losing the socket path.
internal/civisibility/utils/net/uds_client_test.go Add end-to-end UDS agent-mode coverage for all CI Visibility helper endpoints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/civisibility/utils/net/uds_client_test.go
@tonyredondo

Copy link
Copy Markdown
Member Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 31d85a6 into main Jun 4, 2026
165 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the feat/ci-visibility-uds-client branch June 4, 2026 12:24
darccio pushed a commit that referenced this pull request Jun 25, 2026
### What does this PR do?

Fixes the CI Visibility helper client when DD_TRACE_AGENT_URL is configured with a Unix domain socket. The helper client now captures the raw socket path before rewriting the base URL to the synthetic UDS host and reuses the shared internal.UDSClient and internal.UnixDataSocketURL helpers.

Adds agent-mode UDS coverage for the CI Visibility helper endpoints: settings, known tests, search commits, skippable tests, test management, packfile upload, coverage upload, and logs upload.

### Motivation

The previous UDS branch built a custom dialer that closed over agentURL.Path, then reassigned agentURL to the synthetic HTTP URL. By request time agentURL.Path was empty, causing agent-mode requests to fail with dial unix: missing address.

### Testing

- go test ./internal/civisibility/utils/net -run 'TestClientAgentModeUDS' -count=1
- go test ./internal/civisibility/utils/net -count=1
- go test -race ./internal/civisibility/utils/net -count=1
- go test ./internal -run 'TestUnixDataSocketURL|TestUDSClientTransportConfig|TestUDSConcurrentConnectionReuse|TestUDSServerCloseRecovery' -count=1
- go test ./ddtrace/tracer -run 'TestCiVisibilityTransport|TestCIVisibilityTransportSecureLogging' -count=1
- go test ./internal/civisibility/... -count=1
- go test -race ./internal/civisibility/... -count=1
- git diff --check

Co-authored-by: tony.redondo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants