Skip to content

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

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

Extract shared JaCoCo parser and fix self-closing tag bug#4300
andimarek merged 1 commit into
masterfrom
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

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 5671 (±0) 5614 (±0) 0 (±0) 0 (±0) 57 (±0)
Java 17 5671 (±0) 5613 (±0) 0 (±0) 0 (±0) 58 (±0)
Java 21 5671 (±0) 5613 (±0) 0 (±0) 0 (±0) 58 (±0)
Java 25 5671 (±0) 5613 (±0) 0 (±0) 0 (±0) 58 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 22716 (±0) 22485 (±0) 0 (±0) 0 (±0) 231 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 28698 3126 90.2% ±0.0%
Branches 8331 1511 84.6% ±0.0%
Methods 7681 1224 86.3% ±0.0%

Changed Class Coverage (2 classes)

Class Line Branch Method
g.e.i.d.ExhaustedDataLoaderDispatchStrategy -1.2% 🔴 -7.7% 🔴 ±0.0%
g.e.i.d.PerLevelDataLoaderDispatchStrategy +0.7% 🟢 +2.0% 🟢 ±0.0%

Full HTML report: build artifact jacoco-html-report

Updated: 2026-03-07 14:12:35 UTC

@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