Extract shared JaCoCo parser and fix self-closing tag bug by andimarek · Pull Request #4300 · graphql-java/graphql-java · GitHub
Skip to content

Extract shared JaCoCo parser and fix self-closing tag bug#4300

Merged
andimarek merged 1 commit intomasterfrom
fix/extract-jacoco-parser
Mar 7, 2026
Merged

Extract shared JaCoCo parser and fix self-closing tag bug#4300
andimarek merged 1 commit intomasterfrom
fix/extract-jacoco-parser

Conversation

@andimarek
Copy link
Copy Markdown
Member

Summary

  • Extracts duplicated JaCoCo XML parsing logic from 3 workflow files into .github/scripts/parse-jacoco.js (net -40 lines)
  • Fixes a regex bug where self-closing <class .../> tags (141 interfaces/annotations) would match and steal the next class's coverage counters via ([\s\S]*?)</class>
    • This caused phantom entries like QueryDirectives$Builder (a pure interface) showing QueryDirectivesImpl's coverage numbers, leading to false coverage regressions on PRs that modified QueryDirectivesImpl
    • Fix: negative lookbehind (?<!\/) before > in the class regex to skip self-closing tags
  • After merge, the baseline will auto-regenerate on the next master build with corrected data

Test plan

  • Verified locally: QueryDirectives$Builder no longer appears in parsed classes (was phantom)
  • Verified: QueryDirectivesImpl still correctly tracked
  • Verified: 973 real classes parsed (previously 973 + up to 141 phantoms)
  • Verified: overall counters still correctly extracted
  • All 3 workflows (pull_request.yml, master.yml, pr-report.yml) updated to use shared module

🤖 Generated with Claude Code

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>
@andimarek andimarek enabled auto-merge March 7, 2026 13:59
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 7, 2026

@andimarek andimarek disabled auto-merge March 7, 2026 14:17
@andimarek andimarek merged commit f679e89 into master Mar 7, 2026
9 of 11 checks passed
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