Skip to content

feat(ci): add coverage reports to sonar and github#65

Open
etiennej70 wants to merge 15 commits into
mainfrom
ci/tests_coverage
Open

feat(ci): add coverage reports to sonar and github#65
etiennej70 wants to merge 15 commits into
mainfrom
ci/tests_coverage

Conversation

@etiennej70
Copy link
Copy Markdown
Collaborator

@etiennej70 etiennej70 commented Jun 3, 2026

What this PR Provides

  • Code Coverage Integration: Adds comprehensive code coverage reporting to the CI/CD pipeline, enabling teams to track test coverage metrics over time
  • SonarQube Integration: Connects coverage reports to SonarQube for centralized quality and coverage analysis alongside code quality metrics
  • GitHub Coverage Visibility: Automatically publishes coverage reports in GitHub, making coverage data accessible to all developers
  • JaCoCo to Cobertura Conversion: Implements automatic conversion of JaCoCo coverage reports to Cobertura format for broader tool compatibility
  • Enhanced Security: Improves security permissions scope in the CI pipeline for safer automated deployments
  • Upgraded SonarQube Scanner: Updates to the latest SonarQube Maven plugin (v5.7.0) for improved stability and performance

Fixes

  • N/A

Review

The reviewer must double-check these points:

  • The reviewer has verified coverage reports appear correctly in SonarQube and GitHub
  • The CI/CD pipeline runs successfully with the new plugins
  • Security permissions in CI are correctly scoped
  • The JaCoCo to Cobertura conversion produces valid XML output

How to test

  1. Initial state: Working on a feature branch with unit tests
  2. What and how to test:
    • Create a pull request and observe the GitHub Actions workflow (so here)
    • Check that coverage reports appear in the SonarQube dashboard
  3. Expected results:
    • Build succeeds with new plugins
    • target/cobertura.xml file is generated in the build output
    • Coverage metrics are visible in SonarQube
    • GitHub Actions workflow completes without errors

Breaking changes (if any)

  • N/A

needs: license_compliance
permissions:
contents: write
code-quality: write
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚫 [actionlint] reported by reviewdog 🐶
unknown permission scope "code-quality". all available permission scopes are "actions", "artifact-metadata", "attestations", "checks", "contents", "deployments", "discussions", "id-token", "issues", "models", "packages", "pages", "pull-requests", "repository-projects", "security-events", "statuses" [permissions]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

False positive 😢

Comment thread .github/workflows/basic_code_checks.yml Fixed
Comment thread .github/workflows/basic_code_checks.yml Fixed
Comment thread .github/workflows/basic_code_checks.yml Fixed
@github-code-quality
Copy link
Copy Markdown

github-code-quality Bot commented Jun 4, 2026

Code Coverage Overview

Languages: Java

Java / code-coverage/jacoco

The overall coverage in the branch is 89%. Coverage data for the branch is not yet available.

Show a code coverage summary of the most covered files.
File d8369d8 +/-
com/decathlon/i...ionService.java 100%
com/decathlon/i...serService.java 99%
com/decathlon/i...ionService.java 99%
com/decathlon/i...ateService.java 94%
com/decathlon/i...ateAdapter.java 92%
com/decathlon/i...oOutMapper.java 89%
com/decathlon/i...ionHandler.java 88%
com/decathlon/i...MapperImpl.java 88%
com/decathlon/i...MapperImpl.java 78%
com/decathlon/i...ionService.java 77%

Updated June 04, 2026 16:50 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@etiennej70 etiennej70 marked this pull request as ready for review June 4, 2026 16:46
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 4, 2026

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.

2 participants