Skip to content

Refactor coverage reporting workflow and add JaCoCo plugin#48

Merged
bernardladenthin merged 2 commits into
mainfrom
claude/fix-coveralls-token-C8Oa2
May 11, 2026
Merged

Refactor coverage reporting workflow and add JaCoCo plugin#48
bernardladenthin merged 2 commits into
mainfrom
claude/fix-coveralls-token-C8Oa2

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

This PR refactors the CI/CD workflow to decouple coverage reporting from the publish jobs and adds JaCoCo code coverage instrumentation to the Maven build.

Key Changes

  • New report job: Created a dedicated workflow job that runs after tests to handle coverage report uploads to Coveralls and Codecov, making the workflow more modular and maintainable
  • Updated job dependencies: Changed publish-snapshot and publish-release jobs to depend on the new report job instead of directly on test
  • Removed post-publish job: Eliminated the post-publish job that previously handled coverage reporting after successful publishes, consolidating this logic into the earlier report stage
  • Added JaCoCo Maven plugin: Integrated JaCoCo 0.8.14 into the build to generate code coverage reports during the test phase
  • Improved error handling: Both Coveralls and Codecov uploads now use continue-on-error: true to prevent workflow failures if coverage services are unavailable

Implementation Details

  • JaCoCo is configured with two executions: prepare-agent (to instrument code during tests) and report (to generate coverage reports in the test phase)
  • Coverage reports are now generated as part of the standard test execution, making them available for the dedicated report job
  • The workflow now uploads coverage data earlier in the pipeline (after tests complete) rather than waiting for publish jobs to succeed

https://claude.ai/code/session_015QvayxAG8vHDVH1fcqUZ8w

…-token param

The github-token parameter in coverallsapp/github-action@v2 expects the
automatic GitHub Actions token (secrets.GITHUB_TOKEN) for OIDC-based repo
identification. Passing a Coveralls repo token there caused the error:
"Couldn't find a repository matching this job."
…re Maven Central

Add JaCoCo 0.8.14 plugin to pom.xml (prepare-agent + report in test phase).
Rename post-publish to report, run it after test and before publish-snapshot/
publish-release. Standardizes step order: dependency submission, Coveralls,
Codecov.
@claude

claude Bot commented May 11, 2026

Copy link
Copy Markdown

Review Summary

The changes look solid overall. The refactoring improves the CI pipeline structure by decoupling coverage reporting from publish jobs, and the JaCoCo configuration is correctly set up. A few items for consideration:

Strengths

Cleaner dependency chain — Moving coverage reporting to a dedicated report job that runs after test but before publish-* is architecturally cleaner
JaCoCo configuration — Both prepare-agent and report executions are correctly configured with proper phases
Graceful failure handling — Both Coveralls and Codecov uploads use continue-on-error: true to prevent workflow failures if external services are unavailable
Token fix — Switching from COVERALLS_TOKEN to GITHUB_TOKEN for the Coveralls action is correct per the commit message

Potential Concerns

  1. Maven dependency submission without explicit Maven install — The report job runs maven-dependency-submission-action@v5 after checkout and Java setup, but doesn't explicitly invoke Maven or install Maven. The action should be self-contained, but verify in your test runs that dependency submissions complete successfully.

  2. Artifact download assumes test job succeeded — The report job downloads the JaCoCo artifact with continue-on-error: true, so if the artifact doesn't exist, coverage upload will proceed with empty data. This is intentional but worth documenting if it becomes an issue.

Recommendation

Run a test workflow execution to verify that:

  • The JaCoCo artifact is successfully generated and downloaded in the report job
  • Coverage is successfully submitted to Coveralls and Codecov
  • The maven-dependency-submission-action completes without errors

No blocking issues found.

@bernardladenthin
bernardladenthin merged commit d84ab80 into main May 11, 2026
8 of 10 checks passed
@bernardladenthin
bernardladenthin deleted the claude/fix-coveralls-token-C8Oa2 branch May 11, 2026 15:48
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