Code Coverage

Get per-file code coverage data

Retrieve per-file code coverage data for a specific commit, branch, or pull request. Exactly one of commit_sha, branch, or pr_number must be provided. Optionally filter by service, codeowner, or flag (at most one).

post/api/v2/code-coverage/files

Request

Request body

Example request

{
  "data": {
    "attributes": {
      "branch": "main",
      "changed_only": true,
      "codeowner": "@my-team",
      "commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
      "flag": "unit-tests",
      "pr_number": 42,
      "repository_id": "github.com/datadog/shopist",
      "repository_url": "https://github.com/datadog/shopist",
      "service": "my-service"
    },
    "type": "ci_app_coverage_files_request"
  }
}

Response

OK

Example response

{
  "data": {
    "attributes": {
      "base_commit_sha": "abc1234567890abcdef1234567890abcdef12345",
      "event_timestamp": 1709564000000,
      "head_commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
      "report_count": 3
    },
    "id": "ZGQxMjM0NV9tYWluXzE3MDk1NjQwMDA=",
    "type": "ci_app_coverage_files"
  }
}

Changes

Changes to this operation have not been checked yet.