Comments on Pull Request stopped working (Azure DevOps Services)

For two months now PR comments has stopped being added on PR’s. The warnings is still visible in SonarCloud on the page that corresponds to that PR (project/issues?issueStatuses=OPEN%2CCONFIRMED&pullRequest=123&id=org_project)

We use Azure DevOps and work in C#.

The Personal access token have read and write permissons and the PAT is added here: /project/settings?category=pull_request&id=org_project#sonar.pullrequest.vsts.token.secured)

Even though a PR has issues it is not visible in Azure DevOps as a comment.

I have tried setting this in pipeline yaml:

  •     sonar.pullrequest.vsts.instanceUrl=$(System.CollectionUri)
        sonar.pullrequest.vsts.project=$(System.TeamProject)
        sonar.pullrequest.vsts.repository=$(Build.Repository.Name)
    

Is it related that quality always is waiting?

image

Hi,

Both the missing PR annotations and the missing quality gate status point to the link between your project in SonarQube Cloud and ADO having been lost. Can you check your project’s Administration → General Settings → Repository binding?

 
Ann

Hi Ann

I think it looks correct already.
Any suggestions?

Thanks in advance
Best Regards Pontus

Hi Pontus,

Thanks for checking that. I’m going to flag this for more expert eyes.

 
Ann

It seems to work now.

We revoked the PAT in Azure DevOps and SonarCloud started to complain. We replaced the PAT under Organization binding and project / Administration / General Settings.

The check sonarqube/quality is however still waiting.

image

Hi Fredrik!

Sorry for the delay in getting back to you.

Looking closely at your screenshots, I noticed a naming discrepancy between the check that is ‘Waiting’ and the one SonarQube Cloud is actually reporting (sonarqube/quality vs SonarQube/quality gate).

Could it be that the Branch Policy was set up with the wrong name manually? I’d suggest double-checking this: head over to your Branch Policies for the target branch and check the ‘Status Checks’ section.

Try deleting the current required status and adding it again. When you do, make sure to select the name from the ‘Status to check’ dropdown list - this list is populated by the names Azure has actually received from SonarQube Cloud recently.

Let us know if that finally clears the ‘Waiting’ status!