Skip to content

ci: restore code-coverage block in PR comments - #2195

Merged
beto-rodriguez merged 1 commit into
masterfrom
ci/fix-coverage-pr-comment
Apr 30, 2026
Merged

ci: restore code-coverage block in PR comments#2195
beto-rodriguez merged 1 commit into
masterfrom
ci/fix-coverage-pr-comment

Conversation

@beto-rodriguez

Copy link
Copy Markdown
Collaborator

Summary

  • buildCoverageBlock was iterating a.classes (a number — count of classes, e.g. 191) instead of a.classesinassembly (the actual 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 silently disappeared from PR comments — no visible failure in the workflow logs, no PR-level signal.
  • Per-class line coverage was also reading c.linecoverage (does not exist); should be c.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-summary artifact from PR #2193's run — the #### Code Coverage header, the before/after table, and the per-class diff all render as designed.

Test plan

  • PR comment on this PR shows a #### Code Coverage block (this is the live test — the script runs once this PR's LiveCharts run finishes).
  • Block contains the before/after table.
  • If the badges branch has a baseline Summary.json, the per-class diff table appears too.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings April 30, 2026 15:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 of assemblies[].classes (count), preventing TypeError: number is not iterable.
  • Read per-class coverage from c.coverage instead of a nonexistent c.linecoverage.

@beto-rodriguez
beto-rodriguez merged commit f00e911 into master Apr 30, 2026
9 checks passed
@beto-rodriguez
beto-rodriguez deleted the ci/fix-coverage-pr-comment branch April 30, 2026 16:48
@beto-rodriguez
beto-rodriguez restored the ci/fix-coverage-pr-comment branch May 2, 2026 19:47
@beto-rodriguez
beto-rodriguez deleted the ci/fix-coverage-pr-comment branch May 2, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants