Hello,
I’m using SonarQube version 7.7.0.23042 Developer Edition connected to AzureDevops 2019 Update 1 RC.
Actually, in each PR I have well-configured integration between build, status policy and quality gate.
I have an issue on another project when I configure to execute 2 builds policies at PR level, then I want to have 2 status policies reported but I see only one into the dropdown list. During the execution of the build the last that publish the result on SonarQube it’s the one the will report the Quality status check (then if one fails first will be not visible at PR level).
I am in touch with Microsoft support and they replied that there is an issue on PR decorator on SonarQube.
I did further research and lab setup on this ask using sonar cloud also. Pull Request decoration is the one which is responsible to push the status to Azure DevOps. This setting is done at the Sonar side and there is no option at the Azure DevOps side to control the name Status policy name.
The Publish Quality Gate Result task waits for the analysis report to be consumed by the SonarQube in order to flag the build job with the Quality Gate status.
For the moment, only one status per Pull Request can be posted. This is mainly due to the fact that multiple analyses for a single SC / SQ project is not yet supported (this is in our roadmap, but no ETA yet). So then the last analysis done wins over the previous one and overwrites it.
The Publish Quality Gate Result task is intended to post a report of the Quality Gate in the build summary only, it has nothing related to Pull Request decoration nor any Quality Gate status that is displayed in the right pane of them.