New to Kestra?
Use blueprints to kickstart your first workflows.
Audits Codecov repository test coverage metrics to detect negative regressions and enforce engineering test suite coverage baselines.
Automated unit and integration test suites are the first line of defense against production regression bugs and system downtime. In fast-paced engineering organizations, features merged without accompanying tests gradually erode overall test coverage, increasing the likelihood of undetected edge-case bugs. This sentinel continuously interrogates the Codecov API v2, compares latest commit test coverage against previous baseline commits, flags negative coverage deltas or drops below absolute thresholds, and alerts Engineering Teams on Slack before untested code reaches production.
0 8 * * *) or triggers via CI/CD post-merge webhooks./api/v2/github/{owner}/repos/{repo}/commits) using a personal or organizational API token.io.kestra.plugin.core.flow.If task evaluates whether the coverage delta exceeds max_tolerated_coverage_drop_percentage or falls below min_absolute_coverage_percentage.SlackIncomingWebhook listing commit SHAs, current coverage, and delta drop percentages.flowchart TD
A[scheduled_coverage_audit Schedule Trigger] --> B[scan_codecov_metrics Python Script]
B --> C[check_coverage_regression Flowable If]
C -- Coverage Regressed --> D[notify_slack_qa_engineering Webhook]
C -- Coverage Preserved --> E[log_codecov_audit Log]
D --> E
E --> F[export_codecov_manifest Return]
| Name | Type | Default | Description |
|---|---|---|---|
repo_owner |
STRING |
enterprise-org |
GitHub organization or username owning the repository. |
repo_name |
STRING |
core-platform-service |
Target repository name in Codecov to audit for code coverage regressions. |
max_tolerated_coverage_drop_percentage |
FLOAT |
1.0 |
Maximum allowable negative percentage drop in test coverage between commit builds before alerting. |
min_absolute_coverage_percentage |
FLOAT |
80.0 |
Minimum required total test coverage percentage required for repository health. |
alert_on_coverage_regression |
BOOL |
true |
Whether to dispatch alerts when test coverage drops or falls below absolute baselines. |
{{ outputs.scan_codecov_metrics.vars.repository }}: Full repository path evaluated during the audit.{{ outputs.scan_codecov_metrics.vars.commit_sha }}: Short SHA of the most recent evaluated commit.{{ outputs.scan_codecov_metrics.vars.current_coverage_percentage }}: Current test coverage percentage on the audited commit.{{ outputs.scan_codecov_metrics.vars.coverage_delta_percentage }}: Percentage change in coverage relative to the parent commit.{{ outputs.export_codecov_manifest.value }}: Structured dictionary containing the complete test coverage audit report.api.codecov.io.CODECOV_API_TOKEN: API token authorized to read repository coverage metrics from Codecov.SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint URL used for sending operational alerts.CODECOV_API_TOKEN and SLACK_WEBHOOK_URL in your Kestra Secret storage.company.devops namespace.repo_owner and repo_name to target your production repository.?branch=main) rather than transient feature branches.