Skip to content

Add Datadog code coverage upload#799

Merged
nikita-tkachenko-datadog merged 1 commit into
mainfrom
add-datadog-coverage
Mar 20, 2026
Merged

Add Datadog code coverage upload#799
nikita-tkachenko-datadog merged 1 commit into
mainfrom
add-datadog-coverage

Conversation

@ManuelPalenzuelaDD

@ManuelPalenzuelaDD ManuelPalenzuelaDD commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

We're migrating Datadog repositories from Codecov to Datadog Code Coverage for tracking test coverage. This PR is the first step: it adds a Datadog coverage upload alongside the existing Codecov upload so we can run both systems in parallel and verify parity before switching over.

Changes

  • Added DataDog/coverage-upload-github-action@v1 upload steps to the validate.yml workflow, mirroring the per-flag matrix strategy used by Codecov
  • Added code-coverage.datadog.yml with ignore paths matching codecov.yml (samples/, _tools/, auto-generated proxy files)
  • Uses DD_CI_API_KEY secret (already available in this repo)
  • The existing Codecov uploads are unchanged — nothing is removed or modified
  • Both uploads run with continue-on-error: true so neither blocks CI

Why are we doing this?

As part of a company-wide effort, we're consolidating code coverage reporting into Datadog's own Code Coverage product. This gives us:

  • Coverage data integrated directly into Datadog CI Visibility
  • PR gates and coverage checks natively in Datadog
  • No dependency on a third-party service (Codecov) for coverage reporting

Validation

CI needs to run to produce coverage data. Previous comparison on commit e708754:

System Coverage
Codecov 70.81%
Datadog 68.70%

The 2.11% gap is likely due to Go coverprofile statement-block-to-line mapping differences between the two systems. Still under investigation.

Next steps (not in this PR)

Once this PR is merged and we've confirmed Datadog coverage is stable over several commits:

  1. Remove the Codecov upload steps and CODECOV_TOKEN secret
  2. Remove codecov.yml
  3. Optionally configure PR gates in code-coverage.datadog.yml

No action needed from reviewers beyond normal review

This is a low-risk, additive change. The new upload steps run independently of the existing CI pipeline and cannot cause test failures.

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Mar 12, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.39%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 22e0b39 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

github-merge-queue Bot pushed a commit that referenced this pull request Mar 13, 2026
## Summary

Adds `code-coverage.datadog.yml` to configure Datadog Code Coverage
ignore rules. This is a prerequisite for the coverage upload PR (#799) —
the Datadog coverage reducer discovers this config file from the default
branch via GitDB, so it must be merged to `main` before coverage uploads
will apply ignore rules correctly.

### Ignore rules

Excludes the following from coverage reporting (matching the existing
Codecov behavior):
- `samples/` and `_samples/` — test fixture directories
- `_tools/` — build tooling
- `dot_ast.proxies.go` — generated proxy file

Includes both repo-relative paths and glob patterns to handle the Go
module path resolver's suffix-matching limitation (where `_samples` Go
module maps to `samples/` directory on disk).

### Context

Part of the Codecov → Datadog Code Coverage migration. See #799 for the
full upload integration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Mirror Codecov upload exactly: same per-flag matrix, same files, same flags.
Simplify code-coverage.datadog.yml to match codecov.yml ignore paths directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@codecov

codecov Bot commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.60%. Comparing base (e061d12) to head (22e0b39).
⚠️ Report is 67 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #799      +/-   ##
==========================================
+ Coverage   65.72%   69.60%   +3.88%     
==========================================
  Files         113      116       +3     
  Lines        7926     6900    -1026     
==========================================
- Hits         5209     4803     -406     
+ Misses       2192     1547     -645     
- Partials      525      550      +25     
Components Coverage Δ
Generators 83.23% <ø> (+2.98%) ⬆️
Instruments ∅ <ø> (∅)
Go Driver 75.16% <65.38%> (-0.66%) ⬇️
Toolexec Driver 74.78% <100.00%> (+7.25%) ⬆️
Aspects 76.97% <75.78%> (+5.06%) ⬆️
Injector 77.24% <77.14%> (+4.44%) ⬆️
Job Server 68.38% <55.55%> (+2.46%) ⬆️
Other 69.60% <65.33%> (+3.88%) ⬆️
see 108 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nikita-tkachenko-datadog
nikita-tkachenko-datadog marked this pull request as ready for review March 20, 2026 14:36
@nikita-tkachenko-datadog
nikita-tkachenko-datadog requested a review from a team as a code owner March 20, 2026 14:36
@nikita-tkachenko-datadog
nikita-tkachenko-datadog added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit decc693 Mar 20, 2026
149 checks passed
@nikita-tkachenko-datadog
nikita-tkachenko-datadog deleted the add-datadog-coverage branch March 20, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants