- ALM used : Azure DevOps
- CI system used : Azure DevOps
- Scanner command used : gradlew sonar
- Languages of the repository : java, gradle
- Error observed : Build does not stop (Build successful), but sonar task failed!
- Steps to reproduce : do gradlew sonar with new gradle plugin 6.0.0 version
- Potential workaround : dont know, fix it? *
Hi,
Welcome to the community!
Could you be more specific about this:
Do you mean that analysis completed successfully, but the project failed its Quality Gate? Or that analysis errored-out?
Ann
Use of preview features have been detected during analysis. Enable DEBUG mode to see them.
QUALITY GATE STATUS: FAILED - View details on SonarQube Cloud
[Incubating] Problems report is available at: file:///home/vsts/work/1/s/build/reports/problems/problems-report.html
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use ââwarning-mode allâ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to Command-Line Interface Reference in the Gradle documentation.
BUILD SUCCESSFUL in 1m 22s
Hi,
I donât find your list of analysis log warnings terribly helpful. Am I correct in thinking that you want your pipeline to fail when your Quality Gate fails?
The example in the docs includes this.
HTH,
Ann
Hi Ann,
that is principally correct, of course. But it has nothing to do with the pipeline itself, because it is a gradle task (which is platform independent). So my point is as mentioned before the command line gradle task is now not failing anymore if sonar is failing (which you can simply test with gradlew sonar on a project which failed and then you check the return code of the console)
I think this has something to do with that there is no error code correctly given back from sonar because of some structural change?
Best regards,
OBGIT Backend
Hi OBGIT Backend,
Uhm⌠Yes it does.
Analysis collects an analysis report bundle and submits that to the server. Then CI-side analysis ends. (Any error code at this point would indicate that no report had been submitted to the server.)
Server side, the analysis report is received, queued, and eventually popped from the queue and processed.
At the end of analysis report processing, the Quality Gate status is calculated. If you have paused your pipeline to wait for this event, then at that time, you may retrieve the Quality Gate status from the server, and act on it as needed.
HTH,
Ann
Ah I understand what you mean. Yeah that is correct but therefore we set the setting
property âsonar.qualitygate.waitâ, true
which is as I undestand waiting for the retrieval.
Hi,
yes thank you for the link, but we also have shell scripts and jenkins which is doing the same
like
if ! ./gradlew clean build sonar; then
echo echo âGradle task failedâ >&2
read -n 1 -s -r -p âPress any key to continueâ
fi
So am I correct that they have to also been adapted?
Thx,
â So we conclude there is no native gradle possibility to check at the console anymore
I see the documentation âSonarScanner for Gradle | SonarQube Cloud Documentationâ says now âOpen the website to checkâ.
So I think the automatic checking is not possible anymore without CI things around it.
It was really simple via
âif ! ./gradlew clean build sonar; thenâ
Hi. Iâm getting the same issue: after upgrading to version 6.0.0 of gradle plugin, when the quality gate is not reached, Gradle job doesnât fail (with 5.1.0.4882 version fails)
Configuration:
- JDK 21
- Gradle 8.11.1
- Sonar Gradle Plugin version â6.0.0.5145â
- Launched with
-Dsonar.qualitygate.wait=true
- Sonar server: paid SonarQube Cloud
No SonarArchitecture IR data present in directory "/builds/product/....."
QUALITY GATE STATUS: FAILED - View details on https://sonarcloud.io/dashboard?id=***.*******%3A******&branch=***********&resolved=false
[Incubating] Problems report is available at: file:///builds/product/****/*****************/src/build/reports/problems/problems-report.html
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.11.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD SUCCESSFUL in 3m 22s
Hello @sa-obgit-backend and @jerolba,
We are aware of the issue with the scanner incorrectly reporting analysis/quality gate failure, and we will be releasing a new version of the analyzer with the fix within the next 24 hours.
Cheers,
Dorian
Ah thank you, this is good to hear!
Hello again @sa-obgit-backend and @jerolba,
We released version 6.0.1.5171 of the scanner yesterday, which should address the issue. Please let us know if that version fixes the issues you encountered.
Cheers,
Dorian
Hi Dorian,
yes, many thanks, it works like a charm.
the pipeline works againâŚ
so from my side it is solved
Best regards,
OBG-IT Backend
Hi Dorina.
Updated, tested, and fixed.
Thanks!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.