Repository navigation
Implement differential code coverage - #96738
Conversation
| # Baseline coverage percentages for the current branch (from the merged report) | ||
| b_line_cov, b_function_cov, b_branch_cov = get_lcov_summary_percentages( | ||
| f"{TEMP_DIR}/base_llvm_coverage.info" | ||
| ) |
There was a problem hiding this comment.
Missing file existence check crashes coverage job
High Severity
generate_diff_coverage_report.sh exits 0 early without creating base_llvm_coverage.info when no baseline coverage is found in S3 (line 28) or no changed files are detected (line 50). However, llvm_coverage_job.py unconditionally calls get_lcov_summary_percentages() on base_llvm_coverage.info right after, which uses strict=True and will raise an exception when the file doesn't exist. This crashes the entire LLVM coverage job for any PR where no ancestor commit has coverage data in S3.
Additional Locations (1)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| # Baseline coverage percentages for the current branch (from the merged report) | ||
| b_line_cov, b_function_cov, b_branch_cov = get_lcov_summary_percentages( | ||
| f"{TEMP_DIR}/base_llvm_coverage.info" | ||
| ) |
There was a problem hiding this comment.
Crash when base coverage file is unavailable
High Severity
generate_diff_coverage_report.sh exits with code 0 (success) when it can't find a base coverage file among the 30 ancestor commits (line 28) or when no changed files are reported (line 50). Despite these early exits, llvm_coverage_job.py unconditionally calls get_lcov_summary_percentages on base_llvm_coverage.info, which doesn't exist. Since Shell.get_output uses strict=True, this raises an unhandled exception that crashes the entire LLVM Coverage job. This will happen for every PR until sufficient master branch coverage data accumulates in S3.
Additional Locations (1)
| output = Shell.get_output(cmd_list, verbose=verbose) | ||
| if output: | ||
| try: | ||
| for comment in json.loads(output): |
There was a problem hiding this comment.
Paginated GitHub API response breaks JSON parsing
Low Severity
post_fresh_comment uses gh api --paginate with --jq, which applies the jq expression per page and concatenates the results. When there are multiple pages of PR comments, the output becomes multiple JSON arrays like [...][...], which is not valid JSON. json.loads will fail, and the exception handler silently swallows the error, meaning old coverage comments won't be deleted — leading to duplicate comments accumulating on the PR.
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 95.24% (20/21) |
|
@alexbakharew, it broken CI in PRs with no code changes. I'm fixing it in #99032. |


Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Extend LLVM Coverage job to be able to see difference in coverage between
masterand current branches. The job is designed to fail once the coverage value is degraded. The uncovered code blocks will shown in log.In Praktika report there will be links to 2 reports: one report for all repository coverage and one only for changed files in current PR.
Note
Medium Risk
CI workflow and coverage artifact plumbing changes can break coverage generation or job dependencies, and the small MergeTree key-condition fix could affect partition pruning edge cases for Date/DateTime conversions.
Overview
Implements differential LLVM coverage in CI. Replaces the old merge-only coverage job with a new
llvm_coverage_job.pythat generates full and diff HTML reports against amasterbaseline, computes coverage deltas, and surfaces uncovered changed-line blocks.Expands and rewires LLVM coverage inputs. PR and master workflows add a dedicated
build_llvm_coverage_buildjob, add LLVM-coverage variants of unit/integration/stateless tests (including special S3/AsyncInsert/old-analyzer runs), update artifact naming to be parameter-based, and drop the standalone HTML report artifact in favor of uploading report directories/files.Adds reporting hooks and dependencies. Introduces a post-hook that posts a fresh tagged PR comment and writes coverage results to CIDB, adds
gh/SSH/requests tooling to the test image, stores merge-base metadata, and fixesKeyCondition.cppto unwrap nullable results before Date/DateTime overflow checks.Written by Cursor Bugbot for commit beabaa1. This will update automatically on new commits. Configure here.
Version info
26.3.1.499