Skip to content

ci: add Codecov integration for code coverage tracking#406

Merged
edeandrea merged 22 commits intodocling-project:mainfrom
rkmangal23:feature/codecov-integration-199
Mar 25, 2026
Merged

ci: add Codecov integration for code coverage tracking#406
edeandrea merged 22 commits intodocling-project:mainfrom
rkmangal23:feature/codecov-integration-199

Conversation

@rkmangal23
Copy link
Copy Markdown
Contributor

@rkmangal23 rkmangal23 commented Mar 19, 2026

This PR is for adding codeCov to the project. It works with jaCoCo reports. I tested it with push to my fork by changing the condition for prepare test report and used my token in the fork. For parent repo, separate token would need to be added as I see has been requested in the issue.
Have used Bob (IBM's code assistant)to help me in getting this done quickly. And it is listed in the commits with me (my product team has made changes to add a githook for this).

I could see a report like this in codecov.io
codeCov_doclingjava_Fork

Fixes #199

@rkmangal23 rkmangal23 changed the title Adding codecov support - Issue 199 feat(devops): add Codecov integration for code coverage tracking Mar 19, 2026
@rkmangal23 rkmangal23 force-pushed the feature/codecov-integration-199 branch from 6d2e680 to c679802 Compare March 19, 2026 08:22
@rkmangal23 rkmangal23 changed the title feat(devops): add Codecov integration for code coverage tracking devops: add Codecov integration for code coverage tracking Mar 19, 2026
@rkmangal23 rkmangal23 changed the title devops: add Codecov integration for code coverage tracking ci: add Codecov integration for code coverage tracking Mar 19, 2026
@rkmangal23 rkmangal23 closed this Mar 19, 2026
@rkmangal23 rkmangal23 reopened this Mar 19, 2026
@rkmangal23 rkmangal23 force-pushed the feature/codecov-integration-199 branch from c679802 to 80b1fc1 Compare March 19, 2026 08:47
@rkmangal23 rkmangal23 marked this pull request as ready for review March 19, 2026 08:48
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@github-actions
Copy link
Copy Markdown

:java_duke: JaCoCo coverage report

Overall Project 47.29% 🔴

There is no coverage information present for the Files changed

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 19, 2026

TestsPassed ✅SkippedFailed
Gradle Test Results (all modules & JDKs)1002 ran1002 passed0 skipped0 failed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

Copy link
Copy Markdown
Contributor

@edeandrea edeandrea left a comment

Choose a reason for hiding this comment

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

Thanks @rkmangal23 for this! I've added some comments.

Also, I'm just going to re-post from our conversation on slack so that its out in the open.

I know we collect coverage across the entire project as a whole - but do you think it would be better to break out the report per project? It would turn into separate checks and report coverage per project, for which we could then define separate thresholds. See https://docs.codecov.com/docs/commit-status#splitting-up-projects-example

For example:

Image

It would give a single check for the whole project, but also show each individual project's coverage, which could be helpful if we want a quick visualization of where coverage is lacking

@edeandrea
Copy link
Copy Markdown
Contributor

@all-contributors add @rkmangal23 for code doc ideas tool test infra

@allcontributors
Copy link
Copy Markdown
Contributor

@edeandrea

I've put up a pull request to add @rkmangal23! 🎉

@edeandrea edeandrea requested a review from Copilot March 19, 2026 13:14
@edeandrea edeandrea force-pushed the feature/codecov-integration-199 branch from 80b1fc1 to e83e26c Compare March 19, 2026 13:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Codecov-based coverage reporting to docling-java by uploading the existing aggregated JaCoCo XML report from CI and exposing coverage status via a README badge, aligning with the broader Docling ecosystem’s Codecov usage (Fixes #199).

Changes:

  • Add codecov.yml configuration (status checks, flags, ignore rules, comment layout).
  • Upload aggregated JaCoCo XML coverage reports to Codecov from the GitHub Actions build matrix.
  • Add a Codecov badge to the project README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
codecov.yml Introduces Codecov configuration for project/patch statuses, flags, and ignored paths.
README.md Adds Codecov badge pointing to coverage for the main branch.
.github/workflows/build.yml Uploads aggregated JaCoCo XML report to Codecov for each Java version in the matrix.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

@edeandrea edeandrea force-pushed the feature/codecov-integration-199 branch from e83e26c to 22c93d1 Compare March 19, 2026 13:51
Rohan added 5 commits March 19, 2026 09:59
- Add Codecov upload step to build workflow
- Create codecov.yml configuration with flags for Java 17, 21, 25
- Add Codecov badge to README
- Configure coverage thresholds and ignore patterns

Fixes docling-project#199

Co-authored-by: Bob <bob@ibm.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>

Signed-off-by: Bob <bob@ibm.com>
- Remove pull_request-only condition
- Allows Codecov upload on direct pushes to main
- Enables coverage tracking for all commits

Co-authored-by: Bob <bob@ibm.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>

Signed-off-by: Bob <bob@ibm.com>
- Remove matrix strategy for multiple Java versions
- Use only Java 17 for coverage reports
- Remove Java version flags from Codecov config
- Simplifies coverage tracking and reduces CI time

Co-authored-by: Bob <bob@ibm.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>

Signed-off-by: Bob <bob@ibm.com>
- Only run coverage reports on pull requests
- Reduces unnecessary CI runs on direct pushes to main

Co-authored-by: Bob <bob@ibm.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>

Signed-off-by: Bob <bob@ibm.com>
- Restore matrix strategy for Java 17, 21, 25
- Add flags to track coverage per Java version
- Enables per-version coverage insights in Codecov

Co-authored-by: Bob <bob@ibm.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>

Signed-off-by: Bob <bob@ibm.com>
@edeandrea edeandrea force-pushed the feature/codecov-integration-199 branch from 22c93d1 to 04f125d Compare March 19, 2026 14:00
@github-actions
Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

@github-actions
Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

Rohan and others added 2 commits March 21, 2026 11:37
Remove explicit carryforward: false flags since false is the default value.
Simplifies configuration by relying on Codecov defaults.

Co-authored-by: Bob <bob@codeium.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>
- Add condition to only run on main repo when token is available
- Move CODECOV_TOKEN from env to with.token parameter (preferred by codecov-action v5)
- Prevents issues with fork PRs where secrets are unavailable

Addresses Copilot feedback validated by @edeandrea in PR docling-project#406

Co-authored-by: Bob <bob@codeium.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>
rkmangal23 pushed a commit to rkmangal23/docling-java that referenced this pull request Mar 21, 2026
- Add condition to only run on main repo when token is available
- Move CODECOV_TOKEN from env to with.token parameter (preferred by codecov-action v5)
- Prevents issues with fork PRs where secrets are unavailable

Addresses Copilot feedback validated by @edeandrea in PR docling-project#406

Co-authored-by: Bob <bob@codeium.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>
Enable prepare-test-reports job to run on both pull_request and push events.
This ensures:
- Baseline coverage is maintained on main branch
- README badge stays current
- PR comparisons have accurate base coverage
- Historical coverage trends are tracked

Implements ChatGPT recommendation and addresses Copilot feedback in PR docling-project#406

Co-authored-by: Bob <bob@codeium.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>
rkmangal23 pushed a commit to rkmangal23/docling-java that referenced this pull request Mar 21, 2026
Enable prepare-test-reports job to run on both pull_request and push events.
This ensures:
- Baseline coverage is maintained on main branch
- README badge stays current
- PR comparisons have accurate base coverage
- Historical coverage trends are tracked

Implements ChatGPT recommendation and addresses Copilot feedback in PR docling-project#406

Co-authored-by: Bob <bob@codeium.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>
Configure separate coverage status checks for:
- docling-core
- docling-serve-api
- docling-serve-client

This provides granular visibility into coverage for each production module.
Excludes docling-testcontainers and docling-testing as they are test infrastructure.

Addresses @edeandrea feedback in PR docling-project#406

Co-authored-by: Bob <bob@codeium.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>
rkmangal23 pushed a commit to rkmangal23/docling-java that referenced this pull request Mar 21, 2026
Configure separate coverage status checks for:
- docling-core
- docling-serve-api
- docling-serve-client

This provides granular visibility into coverage for each production module.
Excludes docling-testcontainers and docling-testing as they are test infrastructure.

Addresses @edeandrea feedback in PR docling-project#406

Co-authored-by: Bob <bob@codeium.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>
Create individual README files for each production module:
- docling-core/README.md
- docling-serve/docling-serve-api/README.md
- docling-serve/docling-serve-client/README.md

Each README includes:
- Module-specific Codecov badge with flag parameter
- Link to detailed coverage reports on Codecov

This provides granular coverage visibility as requested by @edeandrea in PR docling-project#406

Co-authored-by: Bob <bob@codeium.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>
rkmangal23 pushed a commit to rkmangal23/docling-java that referenced this pull request Mar 21, 2026
Create individual README files for each production module:
- docling-core/README.md
- docling-serve/docling-serve-api/README.md
- docling-serve/docling-serve-client/README.md

Each README includes:
- Module-specific Codecov badge with flag parameter
- Link to detailed coverage reports on Codecov

This provides granular coverage visibility as requested by @edeandrea in PR docling-project#406

Co-authored-by: Bob <bob@codeium.com>
Signed-off-by: Rohan <rohan.kurian@ibm.com>
@rkmangal23 rkmangal23 force-pushed the feature/codecov-integration-199 branch from 32dd927 to 1af0c33 Compare March 21, 2026 06:49
@rkmangal23 rkmangal23 requested a review from edeandrea March 23, 2026 15:31
@edeandrea
Copy link
Copy Markdown
Contributor

Thanks @rkmangal23 for this! Once the checks pass I will merge it. We can tune it afterwards if we need to.

@edeandrea edeandrea enabled auto-merge (squash) March 24, 2026 19:26
edeandrea
edeandrea previously approved these changes Mar 24, 2026
@edeandrea edeandrea disabled auto-merge March 24, 2026 19:30
… Version Tests

Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
@edeandrea edeandrea enabled auto-merge (squash) March 24, 2026 19:34
edeandrea
edeandrea previously approved these changes Mar 24, 2026
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
@edeandrea edeandrea merged commit d31b544 into docling-project:main Mar 25, 2026
21 checks passed
@github-actions
Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

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.

Investigate using codecov for code coverage

3 participants