Deduplicate sonar CI github workflow#13322
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13322 +/- ##
============================================
- Coverage 18.10% 18.10% -0.01%
+ Complexity 16752 16749 -3
============================================
Files 6037 6037
Lines 542796 542796
Branches 66456 66456
============================================
- Hits 98291 98270 -21
- Misses 433460 433488 +28
+ Partials 11045 11038 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…p-sonar-workflows
bf3ecf9 to
584203c
Compare
There was a problem hiding this comment.
Pull request overview
This PR consolidates the duplicated Sonar Quality Check GitHub Actions workflows into a single reusable workflow, intended to reduce maintenance overhead by keeping the PR and main-branch Sonar runs in sync.
Changes:
- Added a new reusable workflow (
sonar-reusable.yml) intended to perform checkout, environment setup, build/tests, and Sonar analysis. - Updated the PR-triggered workflow (
sonar-check.yml) to call the reusable workflow. - Updated the main-branch workflow (
main-sonar-check.yml) to call the reusable workflow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
.github/workflows/sonar-reusable.yml |
Introduces the shared Sonar build/test/scan workflow used by both PR and main runs. |
.github/workflows/sonar-check.yml |
Replaced inline Sonar job with a call to the reusable workflow for PRs. |
.github/workflows/main-sonar-check.yml |
Replaced inline Sonar job with a call to the reusable workflow for main pushes. |
Comments suppressed due to low confidence (1)
.github/workflows/sonar-reusable.yml:99
- The previous sonar workflows also uploaded the generated JaCoCo report to Codecov, but that step has been dropped in the reusable workflow. This changes CI behavior and removes coverage reporting for the backend (there are no other workflows uploading
client/target/site/jacoco-aggregate/jacoco.xml).
run: >
mvn -T$(nproc) -P quality -Dsimulator -Dnoredist clean install
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-Dsonar.projectKey=apache_cloudstack
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| secrets: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| secrets: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
|



Description
This PR de-duplicates the sonar quality check workflows into a shared reusable workflow to avoid having to keep 2 files in sync.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?