Repository navigation
Fix LLVM Coverage job failure when PR has no source code changes - #99032
alexey-milovidov wants to merge 2 commits into
Conversation
The job failed when a PR only changed non-source files (e.g. `.sh` test scripts): `lcov --extract` produced empty output, `genhtml` failed on the empty input, and then `llvm_coverage_job.py` crashed trying to compress the non-existent `llvm_coverage_diff_html_report` directory. Two fixes: - In `generate_diff_coverage_report.sh`: after `lcov --extract`, check if the output contains any `SF:` records; exit 0 early if not. - In `llvm_coverage_job.py`: guard compress and archive operations on the diff report directory actually existing. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=99018&sha=df6f0da97c5b87721cde0190e310431d826349d5&name_0=PR&name_1=LLVM%20Coverage Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Workflow [PR], commit [12048a5] Summary: ❌
|
When changed files have no coverage data, the diff HTML report is never created. Guard the diff URL in `coverage_comment.json` and in `report_links` on the diff report actually existing, to avoid broken S3 links in the GitHub PR comment and job results. Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| f"{_s3_base}/llvm_coverage/generate_llvm_coverage_diff_report/index_diff.html" | ||
| if _has_diff_report | ||
| else "" | ||
| ) |
There was a problem hiding this comment.
Empty diff URL produces broken GitHub comment link
Medium Severity
When _has_diff_report is False, _diff_url is set to "" and written into coverage_comment.json. The downstream hook in llvm_coverage_hook.py unconditionally renders f"\n[Diff coverage report]({diff_url})" (line 52), producing a broken empty markdown link [Diff coverage report]() in the GitHub PR comment. Before this change, the job would crash in this scenario so the hook never ran; now the job succeeds but the comment is malformed. The empty _diff_url case needs to be handled so the link row is omitted or shows a meaningful message.
Additional Locations (1)
|
I would like to merge another version of the fix. In current PR we deal with results which are empty. In my version all not related to coverage files will be simply excluded |
|
@alexbakharew, Ok. Just don't forget to update all the affected PRs. |


Summary
.shtest scripts)lcov --extractproduces empty output for non-source files,genhtmlfails on empty input (exit code 2), and thenllvm_coverage_job.pycrashes trying to compress the non-existentllvm_coverage_diff_html_reportdirectorygenerate_diff_coverage_report.shwhen no coverage data exists for changed files, and guard compress/archive operations inllvm_coverage_job.pyFailing CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=99018&sha=df6f0da97c5b87721cde0190e310431d826349d5&name_0=PR&name_1=LLVM%20Coverage
#99018
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Note
Low Risk
Low risk CI-only change that adds guards/early-exits around diff coverage report generation to avoid failures when no source files are covered. Main risk is reduced visibility if the presence checks mis-detect and skip a diff report unexpectedly.
Overview
Prevents the LLVM Coverage CI job from failing when changed files produce no
lcovcoverage data (e.g. PRs that only modify scripts/tests).generate_diff_coverage_report.shnow exits early before runninggenhtmliflcov --extractyields an empty.info(noSF:entries).llvm_coverage_job.pynow conditionally compresses/uploads the diff HTML report and only emits diff report links/diff_urlwhen the diff report directory/archive actually exists.Written by Cursor Bugbot for commit 12048a5. This will update automatically on new commits. Configure here.