Skip to content

ci: add JaCoCo code coverage with Codecov integration#2623

Merged
mmodzelewski merged 17 commits intoapache:masterfrom
ex172000:qichao/add-java-cov
Feb 9, 2026
Merged

ci: add JaCoCo code coverage with Codecov integration#2623
mmodzelewski merged 17 commits intoapache:masterfrom
ex172000:qichao/add-java-cov

Conversation

@ex172000
Copy link
Contributor

@ex172000 ex172000 commented Jan 27, 2026

Add code coverage reporting for Java modules using JaCoCo and integrate with Codecov for PR coverage reports.

Changes:

  • Add JaCoCo plugin (v0.8.14) to common conventions for all modules
  • Create aggregated coverage report task combining all module coverage
  • Update GitHub Actions to generate coverage reports and upload to Codecov

@ex172000 ex172000 force-pushed the qichao/add-java-cov branch from 1509d55 to 8bbdf37 Compare January 27, 2026 07:41
@ex172000 ex172000 changed the title ci(coverage): add JaCoCo code coverage with Codecov integration ci: add JaCoCo code coverage with Codecov integration Jan 27, 2026
@hubcio
Copy link
Contributor

hubcio commented Jan 27, 2026

@ex172000 can you modify single file java file under this PR so we can see how does the codecov comment looks like?

@ex172000
Copy link
Contributor Author

@ex172000 can you modify single file java file under this PR so we can see how does the codecov comment looks like?

Yes definitely. Was trying to fix issues first. Will add it in the next commit(s).

@ex172000 ex172000 marked this pull request as draft January 27, 2026 23:57
@mmodzelewski
Copy link
Member

Hey @ex172000, we now have the codecov integration setup for the rust code (done by @hubcio), so adding the java part should be much easier now :) Let us know if you want to continue with this PR.

@ex172000
Copy link
Contributor Author

ex172000 commented Feb 5, 2026

Hey @ex172000, we now have the codecov integration setup for the rust code (done by @hubcio), so adding the java part should be much easier now :) Let us know if you want to continue with this PR.

Hi @mmodzelewski @hubcio , sorry it took a while. Something came up from work. I will return to fix the Java part tomorrow afternoon Pacific time. Will update to OPEN state as soon as it's ready for review.

ex172000 and others added 4 commits February 6, 2026 22:20
Add comprehensive code coverage reporting for Java modules using JaCoCo
and integrate with Codecov for PR coverage reports.

Changes:
- Add JaCoCo plugin (v0.8.14) to common conventions for all modules
- Create aggregated coverage report task combining all module coverage
- Update GitHub Actions to generate coverage reports and upload to Codecov
- Add .codecov.yml configuration with 70% threshold for new code
- Configure XML reports for Codecov and HTML for local viewing

Coverage reports will automatically appear as PR comments showing:
- Overall coverage percentage and trends
- Coverage diff for changed files
- File-by-file coverage breakdown

Coverage can be viewed locally with:
  ./gradlew test jacocoAggregatedReport
  open build/reports/jacoco/aggregate/html/index.html
Move codecov upload from composite action to _test.yml where secrets
are accessible, upgrade to codecov-action@v5, add Rust coverage flag,
and set require_changes to suppress comments on unrelated PRs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.87%. Comparing base (0b4cc90) to head (dcbe6c8).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2623      +/-   ##
============================================
- Coverage     68.85%   67.87%   -0.98%     
- Complexity        0      637     +637     
============================================
  Files           575      734     +159     
  Lines         55672    59374    +3702     
  Branches      55672    55787     +115     
============================================
+ Hits          38334    40303    +1969     
- Misses        15467    17113    +1646     
- Partials       1871     1958      +87     
Flag Coverage Δ
java 51.41% <100.00%> (?)
rust 69.02% <ø> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...in/java/org/apache/iggy/serde/BytesSerializer.java 97.03% <100.00%> (ø)

... and 172 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add comprehensive tests for HeaderValue (all 12 types, factory methods,
accessors, validation, toString, equals/hashCode) and HeaderKey
(fromString, validation, equals/hashCode, UTF-8 handling).
Also raise codecov patch target from 70% to 80%.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ex172000 ex172000 force-pushed the qichao/add-java-cov branch from 690574d to e0a1c91 Compare February 7, 2026 06:54
ex172000 and others added 2 commits February 6, 2026 23:35
The build.sh script was removed in an upstream refactor. Use
./gradlew jacocoAggregatedReport directly, matching the pattern
used by other steps in the composite action.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove HeaderKey/HeaderValue tests and increase the codecov project
threshold from 0.5% to 6% to accommodate the coverage drop from
adding Java reporting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ex172000 ex172000 marked this pull request as ready for review February 7, 2026 08:00
Copy link
Member

@mmodzelewski mmodzelewski left a comment

Choose a reason for hiding this comment

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

Hey @ex172000, please have a look at the few suggestions I've added.

@ex172000
Copy link
Contributor Author

ex172000 commented Feb 8, 2026

Hey @ex172000, please have a look at the few suggestions I've added.

Thanks for the review, please take another look?

@mmodzelewski
Copy link
Member

@hubcio, would you mind checking it as well?

@mmodzelewski mmodzelewski merged commit 2e74a3e into apache:master Feb 9, 2026
92 of 127 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.

4 participants