Code Coverage

Get code coverage summary for a commit

Retrieve aggregated code coverage statistics for a specific commit in a repository. This endpoint provides overall coverage metrics as well as breakdowns by service and code owner.

The commit SHA must be a 40-character hexadecimal string (SHA-1 hash).

post/api/v2/code-coverage/commit/summary

Request

  • Base URL
    https://api.datadoghq.com
  • URL
    https://api.datadoghq.com/api/v2/code-coverage/commit/summary
  • Auth
    • API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
    • or OAuth 2
      Authorization code: /oauth2/v1/authorize
      Token URL: /oauth2/v1/token scopes: code_coverage_read

Request body

Example request

{
  "data": {
    "attributes": {
      "commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
      "repository_id": "github.com/datadog/shopist",
      "repository_url": "https://github.com/datadog/shopist"
    },
    "type": "ci_app_coverage_commit_summary_request"
  }
}

Response

OK

Example response

{
  "data": {
    "attributes": {
      "evaluated_flags_count": 8,
      "evaluated_reports_count": 12,
      "patch_coverage": 70.1,
      "total_coverage": 82.4
    },
    "id": "ZGQxMjM0NV9tYWluXzE3MDk1NjQwMDA=",
    "type": "ci_app_coverage_summary"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.