Skip to content

fix(coverage): resolve report paths against tracked files and reject non-Cobertura XML - #82

Merged
Andreas-Garcia merged 2 commits into
mainfrom
fix-coverage-tracked-paths
Nov 25, 2026
Merged

Andreas-Garcia merged 2 commits into
mainfrom
fix-coverage-tracked-paths

Conversation

@Andreas-Garcia

@Andreas-Garcia Andreas-Garcia commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

coverage.yml now maps every report path onto the repository's tracked files when it reads the reports, and rejects .xml files in coverage-* artifacts that are not Cobertura. Refs #80.

Changes

  • Report paths (Cobertura class@filename with <source> roots, lcov SF:) are canonicalized against git ls-files: exact path, <source> join, unique suffix of a tracked file, or the longest tracked suffix of a longer (container-prefixed) path. A suffix matching several tracked files is an error, even when the other file is not in the diff.
  • Patch lookup is an exact match on the canonical path. The same file reported under several prefixes merges into one key, so it no longer counts twice in the global figures.
  • Invalid XML, or an XML root other than <coverage>, fails the job with an explicit message.
  • README (Coverage) and CHANGELOG (Fixed) updated.

Test plan

  • bash .github/tests/coverage.sh: all cases pass, including the new ones (ambiguous suffix against tracked files, unique suffix with an uncovered patch, non-Cobertura XML, invalid XML) and the rewritten "longer report paths collapse onto the tracked file" case.
  • actionlint -config-file .github/actionlint.yaml: clean.

Screenshots

N/A

Risk

Intent change, depth standard: localized behavior change in a shared reusable workflow. No caller of coverage.yml exists yet, so no SemVer impact. Stricter behavior: non-Cobertura XML and ambiguous suffixes now fail instead of being ignored or silently misattributed.

How to revert

Revert the squash commit.

Deployment notes

None. Target branch main; released with the next v6 minor.

🤖 Generated with Claude Code

Andreas-Garcia and others added 2 commits November 25, 2026 16:08
…non-Cobertura XML

Refs #80

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Andreas-Garcia
Andreas-Garcia enabled auto-merge (squash) November 25, 2026 15:11
@Andreas-Garcia
Andreas-Garcia merged commit 2ab8239 into main Nov 25, 2026
10 checks passed
@Andreas-Garcia
Andreas-Garcia deleted the fix-coverage-tracked-paths branch November 25, 2026 17:27
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.

1 participant