Skip to content

SonarCloud: improve workflow resilience#23080

Draft
lauraneto wants to merge 7 commits into
mainfrom
v18/task/sonarcloud-resilience
Draft

SonarCloud: improve workflow resilience#23080
lauraneto wants to merge 7 commits into
mainfrom
v18/task/sonarcloud-resilience

Conversation

@lauraneto
Copy link
Copy Markdown
Contributor

@lauraneto lauraneto commented Jun 5, 2026

What does this PR do?

Improves resilience of the SonarCloud GitHub Actions workflow so intermittent infrastructure issues do not cause CI failures.

Allow unit test failures without failing the analysis

dotnet-coverage collect wraps the test run and writes the coverage XML regardless of whether tests pass or fail. Adding continue-on-error: true to the step means a test failure (red step indicator) no longer fails the job - the analysis still completes and coverage data is still uploaded to SonarCloud.

Explicit Java 21 installation

The previous workflow relied on JRE auto-provisioning (the scanner downloads Java 21 from SonarCloud at runtime). This provisioning call has been observed to fail intermittently, causing the scanner to fall back to the runner's system JAVA_HOME (temurin-17). SonarQube Cloud ends Java 17 support in July 2026.

This PR adds actions/setup-java@v5 (temurin-21) before the analysis steps and passes sonar.scanner.skipJreProvisioning=true to the begin command. Java 21 is now installed reliably via the action, and the scanner uses JAVA_HOME directly without an extra network call to provision a JRE.

lauraneto added 7 commits June 5, 2026 15:20
Test failures should not block SonarCloud analysis - coverage data is
still collected by dotnet-coverage regardless of test outcome. The
regular CI pipeline is the correct gate for test pass/fail.
- Add actions/setup-java@v5 (temurin-21) so JAVA_HOME always points to Java 21
- Pass sonar.scanner.skipJreProvisioning=true in the begin command since Java 21 is installed explicitly, removing the need for the scanner to download a JRE at runtime
Prevents the End analysis step from re-applying sonar params that begin already wrote to the analysis config, eliminating the "Ignoring property from env variable" warning.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 5, 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.

1 participant