Koalrdocs
Integrations

Codecov Integration

Connect Codecov to pull test coverage data into Koalr's coverage dashboard and deploy risk scoring.

The Codecov integration pulls per-repository coverage percentages, 30-day coverage trends, and per-PR coverage deltas into Koalr. Coverage data is also used as one of the seven factors in Koalr's deploy risk score.

Connecting Codecov

Koalr connects to Codecov using a Codecov API token.

Step 1: Get your Codecov API token

  1. Log in to codecov.io.
  2. Click your profile avatar in the top-right corner.
  3. Go to Account Settings.
  4. Under API Tokens, click Generate Token.
  5. Copy the token — it is shown only once.

Koalr uses this token to read coverage reports from Codecov's REST API. The token provides read access scoped to the repositories already visible in Codecov for your account.

Step 2: Enter the token in Koalr

  1. Go to Settings → Integrations in Koalr.
  2. Click Connect Codecov.
  3. Paste your Codecov API token.
  4. Click Save.

Koalr validates the token immediately. If validation succeeds, an initial sync begins and Codecov appears as Connected in the integrations list.

What Koalr reads from Codecov

Coverage percentage per repository

Koalr reads the current overall coverage percentage for each repository. This is the headline metric shown in the coverage dashboard's per-repo table.

30-day trend

Koalr fetches daily coverage snapshots for the past 30 days per repository, used to draw the coverage trend sparkline in the dashboard. A declining trend triggers a visual warning indicator even if the current coverage is above your configured threshold.

PR coverage delta

For each pull request synced from GitHub, Koalr queries Codecov's PR endpoint to read the coverage delta — how much the PR added or removed from the repository's overall coverage. This appears in the PR Delta tab of the coverage dashboard and is used to surface PRs that significantly regress coverage before they are merged.

How coverage feeds into deploy risk scoring

Coverage is the seventh factor in Koalr's deploy risk model. The scoring works as follows:

  • If the files changed by a pull request have less than 40% test coverage, Koalr adds +15 points to the deploy risk score.
  • Coverage is measured per changed file using the file-level coverage data from Codecov.
  • If Codecov data is unavailable for a repository (not yet connected or no coverage reports uploaded), this factor is skipped and the deploy risk score is calculated from the remaining six factors.

See How deploy risk is scored for the complete scoring breakdown.

Threshold alert configuration

You can configure a minimum acceptable coverage percentage per repository. When coverage drops below this threshold, Koalr sends a Slack notification to the configured alert channel.

To configure thresholds:

  1. Go to Settings → Integrations → Coverage.
  2. Select a repository from the list.
  3. Set the Minimum coverage % field (e.g., 80).
  4. Optionally select a Slack channel for alerts.
  5. Click Save.

See Coverage threshold alerts for details on alert formatting and Slack channel configuration.

Supported Codecov plans

Koalr's integration uses Codecov's REST API v2, which is available on all Codecov plans including the free tier for public repositories and paid plans for private repositories.

Troubleshooting

Coverage not appearing for a repository: Ensure that your CI pipeline is uploading coverage reports to Codecov for that repository. Koalr reads from Codecov — if no reports have been uploaded, there is no data to sync.

Token validation failing: Check that the token was copied completely and has not expired. Codecov tokens do not expire by default, but they can be revoked from the same account settings page where they are generated.