Comments on Sonar Cloud Analysis failures not displayed for Pull Requests in Azure Devops

Dear Team,

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.

Hi,

Is analysis failing? Or is analysis succeeding, but PR decoration isn’t happening?

 
Ann

Dear Ann,

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.

Kind Regards,
Renjini.

Hi Renjini,

Thanks for the screenshot. It’s always helpful to see what you’re seeing.

In the top-right there’s a little yellow :warning: banner that says the last analysis had warnings.

Can you click on it to see what they were and share them here?

 
Thx,
Ann

Dear Ann,

Please find the screen shot as below:

Kind Reagrds,
Renjini.

Hi Renjini,

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?

 
Thx,
Ann

Dear Ann,

Please find the below screen shots from Sonar cloud and from Azure Devops.

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.

Thanks in Advance.
Kind Regards,
Renjini.

1 Like

Hi Renjini,

Thanks for the screenshots.

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.

 
Ann

Dear Ann,

Thank you in adavance.

Kind Regards,
Renjini

Dear Ann,

Can you please let me know if there was any update on this.

Kind Regards,
Renjini

Hi Renjini,

It’s in queue…

 
Ann

1 Like