SonarCloud: improve workflow resilience#23080
Draft
lauraneto wants to merge 7 commits into
Draft
Conversation
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.
… before merge" This reverts commit 828a751.
This reverts commit 1911b65.
|
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.



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 collectwraps the test run and writes the coverage XML regardless of whether tests pass or fail. Addingcontinue-on-error: trueto 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 passessonar.scanner.skipJreProvisioning=trueto thebegincommand. Java 21 is now installed reliably via the action, and the scanner usesJAVA_HOMEdirectly without an extra network call to provision a JRE.