Re add coverage to main repo - #50486
Conversation
|
⚪
🟢 |
|
⚪
🟢 |
There was a problem hiding this comment.
Pull request overview
This PR reintroduces Codecov coverage reporting for C++ areas (SDK / CLI / workload) in the main ydb-platform/ydb repository by adding a dedicated GitHub Actions workflow, suite detection helpers, Codecov configuration, and validation tests for the CI helper scripts.
Changes:
- Added
pull_request_target+pushworkflows to run suite-scoped clang coverage, upload LCOV to Codecov, and optionally publish filtered HTML coverage to Object Storage. - Added Python helpers to (a) map changed paths to coverage suites, (b) export suite-filtered LCOV, and (c) generate an HTML landing page.
- Added helper checks workflow plus unit tests to validate the coverage helper contract and guard against regressions.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/cpp_codecov.yml | Main Codecov workflow: auth gate, suite matrix detection, coverage execution on self-hosted runners, and landing-page publishing. |
| .github/workflows/cpp_codecov_checks.yml | CI checks for the Codecov helper scripts (tests, shell syntax, YAML parsing). |
| .github/scripts/codecov/tests/test_helpers.py | Unit/contract tests covering suite selection, LCOV filtering, HTML generation behavior, and workflow/action invariants. |
| .github/scripts/codecov/overlay_trusted_codecov_ci.sh | Overlays trusted (base SHA) CI helpers into the PR workspace for pull_request_target safety. |
| .github/scripts/codecov/generate_coverage_landing.py | Generates a simple landing HTML linking per-suite reports (with optional embedded metadata). |
| .github/scripts/codecov/export_coverage_lcov.py | Parses ya’s llvm-cov invocation, exports LCOV, filters to suite-owned sources, and can generate matching HTML from filtered sources. |
| .github/scripts/codecov/detect_codecov_matrix.py | Emits the suite matrix and a should-run flag based on changed paths for CI orchestration. |
| .github/scripts/codecov/codecov_suites.py | Central suite registry (targets/paths/flags) and path-to-suite selection logic shared by workflows and actions. |
| .github/codecov.yml | Codecov configuration (flag + component management and status thresholds) for the C++ suites in this repo. |
| .github/actions/run_clang_codecov/action.yaml | Composite action to build/test with clang coverage, export filtered LCOV/HTML, upload to Codecov, and optionally publish HTML to Object Storage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
⚪
🟢 |
|
⚪
🟢 |
Changelog entry
Description for reviewers
Adds Clang coverage CI for three independently reported suites / Codecov flags:
cpp_sdk—ydb/public/sdk/cpp/**;cli—ydb/apps/ydb/**andydb/public/lib/ydb_cli/**;cli_workload—ydb/library/workload/**.Workflow behavior
ydb-platform/ydb:mainand touch relevant paths.ok-to-test.mainpublishes an updated baseline for the affected suites. Codecov carryforward preserves unaffected flags.Trust model for PRs
pull_request_target, so its definition comes from the default branch.GH_PERSONAL_ACCESS_TOKENonly to check repositorywrite/adminaccess for the PR author/event sender or the writer applyingok-to-test.Reports
.ya/build/build_rootsources do not affect component totals.ydb/pr-<number>/coveragefor PRs andydb/coverageformain.Validation
Codecov C++ helper checksruns 29 unit/contract tests for routing, LCOV filtering, trusted overlay, metadata, and workflow contracts.The existing
.github/workflows/cpp_sdk_coverage.ymlremains unchanged and can be removed separately after the new workflow has been validated post-merge. Sincepull_request_targetloads its workflow from the default branch, this PR itself can run the unprivileged helper checks but the exact production PR path becomes available only after merge.