Skip to content

Add Datadog code coverage upload#2773

Merged
khewonc merged 4 commits into
mainfrom
add-datadog-coverage
Mar 18, 2026
Merged

Add Datadog code coverage upload#2773
khewonc merged 4 commits into
mainfrom
add-datadog-coverage

Conversation

@khewonc

@khewonc khewonc commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

Copying from #2750

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 step to the build job in main.yml, running after the existing Codecov upload
  • Uploads both cover.out and cover_integration.out with the unittests flag (mirroring Codecov)
  • The existing Codecov uploads are unchanged — nothing is removed or modified
  • The upload uses if: always() and continue-on-error: true so it cannot block 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

Pending — the Datadog upload requires DD_API_KEY which is not available to fork PRs. Coverage comparison will be possible after merge or when CI runs from the base repo.

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. 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 step runs independently of the existing CI pipeline and cannot cause test failures.

Side-by-side coverage reporting: adds Datadog coverage upload alongside
existing Codecov upload using DataDog/coverage-upload-github-action.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@khewonc
khewonc requested a review from a team March 18, 2026 10:47

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4d91dbbb6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +42 to +46
continue-on-error: true
uses: DataDog/coverage-upload-github-action@v1
with:
api_key: ${{ secrets.DD_API_KEY }}
files: .

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid uploading partial coverage from failed test runs

With if: always() and files: ., this step still runs after a failed make test and recursively uploads any report it can find. In this repo, gotest writes cover.out before integration-tests writes cover_integration.out (Makefile:201-209), so an integration-test failure will leave only the unit-test profile on disk. The existing Codecov step above stays on the default success() path, so Datadog will record partial coverage for red builds while Codecov records nothing, which undermines the parity comparison this change is trying to establish.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed if: always() so that upload only happens when both gotest and integration-tests pass, which matches more with the codecov behavior: 3345e25

ManuelPalenzuelaDD and others added 3 commits March 18, 2026 12:05
Pin DataDog/coverage-upload-github-action@v1 to commit SHA
d2cf302a39c05e0ad22063360a2bf6ce0cc4906c for supply chain security.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@codecov-commenter

codecov-commenter commented Mar 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.81%. Comparing base (1b39bf6) to head (68f4859).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2773   +/-   ##
=======================================
  Coverage   38.81%   38.81%           
=======================================
  Files         309      309           
  Lines       26803    26803           
=======================================
  Hits        10404    10404           
  Misses      15620    15620           
  Partials      779      779           
Flag Coverage Δ
unittests 38.81% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b39bf6...68f4859. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@khewonc
khewonc merged commit 8931a7b into main Mar 18, 2026
28 of 36 checks passed
@khewonc
khewonc deleted the add-datadog-coverage branch March 18, 2026 12:13
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