Skip to content

Add Datadog code coverage upload#799

Draft
ManuelPalenzuelaDD wants to merge 1 commit intomainfrom
add-datadog-coverage
Draft

Add Datadog code coverage upload#799
ManuelPalenzuelaDD wants to merge 1 commit intomainfrom
add-datadog-coverage

Conversation

@ManuelPalenzuelaDD
Copy link
Contributor

@ManuelPalenzuelaDD ManuelPalenzuelaDD commented Mar 12, 2026

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

This comment has been minimized.

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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #799      +/-   ##
==========================================
+ Coverage   65.72%   69.62%   +3.90%     
==========================================
  Files         113      116       +3     
  Lines        7926     6900    -1026     
==========================================
- Hits         5209     4804     -405     
+ Misses       2192     1545     -647     
- Partials      525      551      +26     
Components Coverage Δ
Generators 83.23% <ø> (+2.98%) ⬆️
Instruments ∅ <ø> (∅)
Go Driver 75.58% <65.38%> (-0.23%) ⬇️
Toolexec Driver 74.78% <100.00%> (+7.25%) ⬆️
Aspects 76.97% <75.78%> (+5.06%) ⬆️
Injector 77.17% <77.14%> (+4.38%) ⬆️
Job Server 68.16% <55.55%> (+2.24%) ⬆️
Other 69.62% <65.33%> (+3.90%) ⬆️
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.

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.

2 participants