{{ message }}
Extract shared JaCoCo parser and fix self-closing tag bug#4300
Merged
Extract shared JaCoCo parser and fix self-closing tag bug#4300
Conversation
The JaCoCo parsing logic was duplicated across 3 workflow files (pull_request.yml, master.yml, pr-report.yml). Extract it into .github/scripts/parse-jacoco.js. Also fixes a regex bug where self-closing <class .../> tags (interfaces, annotations — 141 of them) would match and steal the next class's coverage counters. This caused phantom coverage entries, e.g. QueryDirectives$Builder showing QueryDirectivesImpl's coverage. The fix uses a negative lookbehind (?<!\/) to skip self-closing tags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
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
.github/scripts/parse-jacoco.js(net -40 lines)<class .../>tags (141 interfaces/annotations) would match and steal the next class's coverage counters via([\s\S]*?)</class>QueryDirectives$Builder(a pure interface) showingQueryDirectivesImpl's coverage numbers, leading to false coverage regressions on PRs that modifiedQueryDirectivesImpl(?<!\/)before>in the class regex to skip self-closing tagsTest plan
QueryDirectives$Builderno longer appears in parsed classes (was phantom)QueryDirectivesImplstill correctly trackedpull_request.yml,master.yml,pr-report.yml) updated to use shared module🤖 Generated with Claude Code