ci: collapse coverage in PR comment with per-class diff - #2176
Merged
Conversation
The coverage section now follows the same details-tag pattern as the benchmarks and tests sections: the H4 line states whether coverage increased / decreased / stayed flat (with the delta), and the table, docs link, and per-class diff live inside <details>. To support the per-class diff, the coverage job now also emits ReportGenerator's JsonSummary, fetches the previous Summary.json from the badges branch, and bundles both into the coverage-summary artifact so pr-comment.js can compute the changed-classes table. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the CI PR-commenting pipeline to present coverage results in a collapsible block and to include a per-class line coverage diff by comparing ReportGenerator JsonSummary outputs against the badges branch baseline.
Changes:
- Collapse the coverage section in the PR comment into a
<details>block with a direction/delta summary header. - Extend the coverage workflow to generate
JsonSummaryand export current/previousSummary.jsonfor class-level comparison. - Add
buildCoverageBlock()helper to render the new coverage section, including a “Class coverage changes” table.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/pr-comment.yml | Switches from inline coverage markdown to buildCoverageBlock() with optional per-class inputs. |
| .github/workflows/livecharts.yml | Adds JsonSummary generation and publishes old/new Summary.json into the coverage-summary artifact. |
| .github/scripts/pr-comment.js | Implements buildCoverageBlock() to render a collapsible coverage section and compute per-class diffs. |
3 tasks
pull Bot
pushed a commit
to Mu-L/LiveCharts2
that referenced
this pull request
Apr 30, 2026
buildCoverageBlock iterated `a.classes` (a count, e.g. 191) instead of `a.classesinassembly` (the array), throwing `TypeError: number is not iterable` on every PR. The outer try/catch in pr-comment.yml swallowed the throw, so the entire #### Code Coverage block vanished from PR comments with no visible failure in the workflow logs. Per-class line coverage is also `c.coverage`, not `c.linecoverage`. Regression from 70350b8 (PR Live-Charts#2176, "ci: collapse coverage in PR comment with per-class diff"). Verified end-to-end against the real coverage-summary artifact from PR Live-Charts#2193's run. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
<details>pattern as benchmarks/tests: the H4 line states whether coverage increased / decreased / stayed flat (with the delta), and the before/after table lives behind a Show details toggle.<details>: the existing Before/After/Delta table, a link to the full coverage report at https://live-charts.github.io/LiveCharts2/, and a new Class coverage changes table that lists only the classes whose line coverage changed since the baseline.JsonSummaryand fetches the previousSummary.jsonfrom thebadgesbranch sopr-comment.jscan compute the per-class diff.The per-class diff needs a baseline
Summary.jsonon thebadgesbranch — that gets deployed on the first master push after this lands. Until then, the helper detects the missing baseline and shows a one-line note instead of swamping the table with "everything is new".Test plan
Summary.jsonto thebadgesbranch, verify the next PR shows the Class coverage changes table populatedJsonSummaryto-reporttypes)🤖 Generated with Claude Code