ci: onboard Codecov for unit test coverage tracking#510
Open
ptomanRH wants to merge 1 commit into
Open
Conversation
Contributor
Reviewer's GuideAdds Codecov integration to the PR CI workflow to upload JaCoCo coverage via OIDC and configures Codecov behavior through a new codecov.yml file with informational checks and path/ignore settings. Sequence diagram for CI PR workflow uploading coverage to CodecovsequenceDiagram
actor Developer
participant GitHub_Actions_PR_Workflow as GitHub_Actions_PR_Workflow
participant Maven_Build as Maven_Build
participant Codecov_Action as Codecov_Action
participant Codecov_Service as Codecov_Service
Developer->>GitHub_Actions_PR_Workflow: pr.yml
GitHub_Actions_PR_Workflow->>Maven_Build: -Pcov
Maven_Build-->>GitHub_Actions_PR_Workflow: ./target/site/jacoco/jacoco.xml
GitHub_Actions_PR_Workflow->>Codecov_Action: Upload_coverage_to_Codecov_step
Codecov_Action->>Codecov_Service: codecov/codecov-action@v5 use_oidc_true
Codecov_Service-->>Codecov_Action: informational_status_checks
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/pr.yml" line_range="77" />
<code_context>
+ use_oidc: true
+ flags: unit-tests
+ files: ./target/site/jacoco/jacoco.xml
+ slug: guacsec/trustify-da-java-client
+ fail_ci_if_error: false
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Hard-coding the Codecov `slug` can cause issues on forks or repo renames; consider relying on Codecov’s auto-detection.
With OIDC enabled, Codecov can derive the repo from `GITHUB_REPOSITORY`. Keeping `slug: guacsec/trustify-da-java-client` hard-coded risks mis-attribution or failures for forks or after org/repo renames. Unless you intentionally need cross-repo uploads, it’s safer to omit `slug` and rely on auto-detection.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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. Thanks for integrating Codecov - We've got you covered ☂️ |
- Add Codecov upload step with OIDC auth and unit-tests flag - Add permissions: id-token: write for OIDC token - Add codecov.yml with informational status checks and carryforward - Scope coverage to hand-written source via existing JaCoCo config Ref: COVERPORT-253 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b82f5ac to
dd7335f
Compare
ruromero
reviewed
Jun 3, 2026
Collaborator
ruromero
left a comment
There was a problem hiding this comment.
same changes as for the other PRs
| informational: true | ||
|
|
||
| flags: | ||
| unit-tests: |
Collaborator
There was a problem hiding this comment.
Suggested change
| unit-tests: | |
| integration-tests: |
ruromero
requested changes
Jun 3, 2026
Collaborator
ruromero
left a comment
There was a problem hiding this comment.
I only added comments it was supposed to be a "Request changes"
- Remove the slug
- rename to
integration-tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codecov/codecov-action@v5to the PR workflow with OIDC authentication (use_oidc: true) to upload JaCoCo coverage reports to app.codecov.ioactions/upload-artifactstep with the Codecov upload step, keeping the same matrix guard (matrix.java == env.MAIN_JAVA_VER)id-token: writepermission at job level for OIDC token exchangecodecov.ymlwith informational status checks,unit-testsflag with carryforward enabled, and ignore patterns for test/resource/build directoriesDetails
The existing JaCoCo setup is already complete:
pluginManagementprepare-agentandcheckgoals in the main build pluginsreportgoal in thecovprofile (activated by-Pcov)No changes to
pom.xmlwere needed.Test plan
Ref: COVERPORT-253
Summary by Sourcery
Integrate Codecov into the PR workflow to upload JaCoCo coverage for the main Java version and configure repository-wide coverage reporting behavior.
New Features:
Enhancements:
CI: