Hello everybody,
I am new here,
I have a problem with the SonarQube plugin on Azure.
Microsoft support referred me to this community.
Recently the Extension tab, where the SonarQube Analysis report of my Pipeline is located, was empty, without any information. Could it be a plugin bug?
I’m sending 2 gifs, the first one when it worked correctly, and the second one with the bug.
This report relies on the Publish Quality Gate Result step (SonarQubePublish) being included in the pipeline, and that step being successful. Is that the case for the project where the SonarQube analysis report is empty? If so, can you provide the logs from that step in that specific pipeline?
Exactly,
I didn’t pay attention to the message that started appearing on SonarQubePublish “##[warning]No analyzes found in this build! Please check your build configuration.”
I just can’t figure it out, why it started showing up now, and for all pipelines in my organization. We haven’t made any changes.
I set scannerMode = ‘Other’ and in the gradle build task I set sonarQubeRunAnalysis = true.
Nowhere did I set the path to store the analysis result.
About the log, the only information that appears is the warning as shown in the image below.
Thanks. I know we’ve had some issues around locating the report file lately (which should always be generated if the sonarqube task of Gradle was successful) so I’ve flagged this for some experts.
Hi @willyanhp , thank you for reaching out, could you please check that the major versions you are using for the SonarQube tasks (Prepare, Analyze and Publish) are all three equal to 5 (the latest)?
We had a few people having failing pipelines due to mixed major versions in their task definitions, this may also be what is going wrong with yours.
Hi, Thanks for replying.
Please confirm if the version in question would be the number after the @ in the task. Example. SonarQubePublish@5
If it is this number, I am using SonarQubePrepare@5, SonarQubePublish@5 and Analyze is running in Gradle@2 task, using argument “sonarQubeRunAnalysis: true”
Would that be the problem?
Thank you for your response @willyanhp . Yes indeed that’s the major version of the task. Gradle latest task version is 3, have you tried if it solves the issue in your case? Your Prepare and Publish task versions are OK.
Are you using Microsoft-hosted build agents or custom agents?
If you can not upgrade your gradle task, or if it does not solve the issue, I will need more information to reproduce the behavior, could you please share:
The yaml configuration for the failing pipeline
Running in debug mode (With “Enable system diagnostics” ticked), the logs for the prepare, gradle and publish tasks
With that, we should be able to track down where the issue is
Hey,
Thanks for the answer,
I did a test with Gradle in version 3 and it didn’t work either.
I’m using custom agents.
When I ran my pipeline in debug mode I stopped to analyze the logs and after evaluating for a while I identified the problem.
I was using a powershell to change the value of the “sonar.scanner.metadataFilePath” variable because I needed to read this file later from where it was stored in order to validate the Sonar Quality Gate.
This worked in the past, but I found at https://github.com/simondel/sonar-buildbreaker-vsts/issues/32 that the SonarQube extension changed the location of the report-task.txt file. This caused the problem I was having. So I removed the powershell that changed it and now I’m using the SONARQUBE_SCANNER_REPORTTASKFILE variable to fetch the report-task.txt. Now the publish task is working again.
Many thanks to everyone for all the help. I hope this forum can help more people.