ci: restore code-coverage block in PR comments - #2195
Merged
Conversation
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 #2176, "ci: collapse coverage in PR comment with per-class diff"). Verified end-to-end against the real coverage-summary artifact from PR #2193's run. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a regression in the PR-comment coverage rendering by correcting the JSON summary fields used when building the per-class coverage diff, restoring the #### Code Coverage section in PR comments.
Changes:
- Iterate
assemblies[].classesinassembly(array) instead ofassemblies[].classes(count), preventingTypeError: number is not iterable. - Read per-class coverage from
c.coverageinstead of a nonexistentc.linecoverage.
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
buildCoverageBlockwas iteratinga.classes(a number — count of classes, e.g.191) instead ofa.classesinassembly(the actual array), throwingTypeError: number is not iterableon every PR.try/catchinpr-comment.ymlswallowed the throw, so the entire #### Code Coverage block silently disappeared from PR comments — no visible failure in the workflow logs, no PR-level signal.c.linecoverage(does not exist); should bec.coverage.Regression from 70350b8 (PR #2176, "ci: collapse coverage in PR comment with per-class diff" — April 26). Coverage was visible on PRs #2170/#2172/#2173 and silent on every PR thereafter.
Verified end-to-end by running the script locally against the real
coverage-summaryartifact from PR #2193's run — the #### Code Coverage header, the before/after table, and the per-class diff all render as designed.Test plan
#### Code Coverageblock (this is the live test — the script runs once this PR's LiveCharts run finishes).Summary.json, the per-class diff table appears too.🤖 Generated with Claude Code