Azure Devops SonarQubeAnalyze@5 (SonarScanner for MSBuild 5.12)
Azure Devops SonarQubePublish@5 (5.0.2)
Problem
We recently upgraded from the LTS 9.8 build to 10.0, and then immediately started seeing problems in our azure devops pipeline where the Analyze step is fine:
INFO: ANALYSIS SUCCESSFUL, you can find the results at: http://xxx
But the publish step can’t find the analysis:
Starting: SonarQubePublish
==============================================================================
Task : Publish Quality Gate Result
Description : Publish SonarQube's Quality Gate result on the Azure DevOps build result, to be used after the actual analysis.
Version : 5.0.2
Author : sonarsource
Help : Version: 5.0.2. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
==============================================================================
##[warning]No analyses found in this build! Please check your build configuration.
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
We are seeing the same message with SonarQube 10.0.0.
I guess this is the cause:
##[debug][SQ] API GET: ‘/api/server/version’ with query “undefined”
##[debug]Response: 200 Body: “10.0.0.68432”
##[debug]SonarQube version < 7.2.0 detected, falling back to default location(s) for report-task.txt file.
We also notice SonarQube not returning the quality gate status check from Pull Requests when we don’t explicitly set the DevOps Platform Integration for each project separately (until now, we never needed to). Could this be the same reason, as the Azure DevOps tasks from SonarQube seem to think they are communicating with an older version of SonarQube?
@ganncamp unless there isn’t any movement on this issue, we’re going to have to revert back to the v9.8 - any updates here since our pipelines depend on this service.
We are experiencing the same issue, the SonarPrepare step is identifying a version above 7.2.0 (we are on 10), but the SonarPublish step is identifying a version below 7.2.0.
We had clean runs on 4/7 and then on 4/10 they started erroring out - summary from our logs is below (still looking into if that was the weekend we went to version 10 or not):
SonarQubePrepare
Version 5.13.0
Logs out: SonarCloud or SonarQube version >= 7.2.0 detected, setting report-task.txt file to its newest location.
SonarQubeAnalyze
Version 5.13.0
Logs out the file report-task.txt location as: "sonar.scanner.metadataFilePath":"/opt/agent/_work/_temp/sonar/20230424.3/b17ced24-17c2-85b3-6abe-6f141199df2b/report-task.txt"
SonarQubePublish
Version: 5.0.2
Logs out: SonarQube version < 7.2.0 detected, falling back to default location(s) for report-task.txt file.
Then further in the logs I can see the adjusted report path doesn’t match what Analyze used prior.
##[debug]applying include pattern
##[debug]adjustedPattern: '/opt/agent/_work/26/**/report-task.txt'
##[debug]0 matches
##[debug]0 final results
##[debug][SQ] Searching for **/report-task.txt - found 0 file(s)
##[warning]No analyses found in this build! Please check your build configuration.
The getServerVersion API call to the sonar server is logging out as such:
##[debug][SQ] API GET: '/api/server/version' with query "undefined"
##[debug]Response: 200 Body: "10.0.0.68432"
I know that we can probably do some manual file moves in the azure pipeline to copy the report file to the “old” directory, but I wouldn’t expect to have to do so.
Are you saying that we should expect a fix currently? The PR that was created is still Open and not merged, and our builds are still experiencing the error. Was this fixed in a different manner than the PR code change?