coverage: emit a markdown job summary from the report generator - #440
Merged
Conversation
Every consumer that wants a human-readable coverage summary on its workflow run page has been re-parsing the LCOV itself; the report generator now emits it directly. - New py_binary coverage_summary (stdlib only): parses the pipeline's LCOV (which includes the exact-0% baseline records), aggregates line/branch/file totals, and renders markdown — overall table with text progress bars, raw-vs-effective when a justification report exists, a per-directory rollup (first one/two path segments, worst first), and collapsible least-covered / exact-0% file lists, closing with a pointer to the HTML artifact. - generate_coverage_html: new optional --summary-md <path>; when the flag is absent and GITHUB_STEP_SUMMARY is set (GitHub Actions), the summary is appended there automatically; with neither, behavior is unchanged. Emitted BEFORE the threshold gate decides the exit code, so a failing gate still leaves the summary on the run page. - Edge cases covered by unit tests: missing/empty LCOV (note instead of crash), records with LF but no BRF (branch cells render as an em dash), BRDA fallback counting, zero denominators, non-UTF8 bytes in paths, markdown cell escaping. - Integration workspace: asserts summary content markers, append semantics for GITHUB_STEP_SUMMARY (existing content preserved), and that the summary survives a failing gate. The test script unsets GITHUB_STEP_SUMMARY first so CI runs don't spam the real run page. - Docs: adoption guide (README) and COVERAGE_GUIDE updated.
Coverage ReportCoverage report was generated. Full report can be downloaded from the CI artifacts (expand Artifacts at the bottom of the run). Overall coverage rate: |
MaximilianSoerenPollak
left a comment
Contributor
There was a problem hiding this comment.
3 questions, overall as far as I can tell this looks alright.
I can see it being quiet usefull, thanks for this.
…string Review follow-up for #440: comment why each summary test section deletes summary.md before its own run (stale-file false passes; the failing-gate section must prove re-creation), note that imports=[".."] is confined to the *_lib unit-test import helpers, and state in the docstring that the progress bar visualizes the coverage percentage.
nicu1989
approved these changes
Aug 24, 2026
Coverage ReportCoverage report was generated. Full report can be downloaded from the CI artifacts (expand Artifacts at the bottom of the run). Overall coverage rate: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every consumer that wants a human-readable coverage summary on its workflow run page has been re-parsing the LCOV itself; the report generator now emits it directly.