I have configured Sonar cloud Analysis in Azure Pull Requests, I have followed the steps as given in this Tutorial https://azuredevopslabs.com/labs/vstsextend/sonarcloud/ , As per step 2 of Test your setup section a comment should be added in the overview section of the pull requests, as given in the below screen shot from the Tutorial. Unfortunately, this comment is not being added in the overview section of our Pull Requests though Sonar Cloud Analysis is failing, am I missing an particular configuration to make this work? This comment is useful for the PR reviewer so that he need not log in to Sonar Cloud to know that the code analysis has failed.
The quality gate results shows as a failure and I can see the failures listed in the summary section of the Pull Request in Sonar Cloud as show below, but this information is not displayed in the overview section of Pull Request in Azure Devops (as mentioned in the tutorial a comment will be added in Azure Devops Pull Request), I am not sure if adding this comment back in the Azure overview section of Pull Request is a part of PR decoration.
Those warnings are related to the SCM data that was available in the environment for analysis to read. You definitely want to get those fixed in order to get an accurate detection of what was changed in the PR.
And… your earlier screenshot shows there was enough data to recognize the analysis as being of a PR.
I’m going to grasp at a straw here and ask you to show a screenshot of the PR in ADO - redacted as necessary. You said the comment you expected isn’t there. Is… anything there?
I am planning to write script find the status of Quality Gate via API call and the fail the pipeline too(if the quality gate fails), but we should have the details of sonar cloud issues somewhere availble in Azure so that PR reviewer can validate it .
Please let me know in case of any more information required.
I’ll be honest & say that when I poke around in SonarCloud to figure out where I should tell you to look, I’m a bit confused by what I find (which I will be raising internally). So I’ve flagged this for more expert eyes.