Azure devops - Sonar quality gate not matching Status Check

Template for a good new topic, formatted with Markdown:

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Scanner command used when applicable (private details masked)
  • Languages of the repository: C#, React JS
  • Only if the SonarCloud project is public, the URL: ( Private )
  • Error observed : No errors other than the quality gate does not match the status check configured in azure devops
  • Steps to reproduce: Donot Know
  • Potential workaround: Donot Know

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
After SonarCloud task version 2 upgrade eventough quality gates are passed in the pipeline and results are published to sonarcloud on azure devops the quality gate check is stuck in Waiting state.

image
image

Thanks,
Kavya B

Hey there.

Can you check to see if you have a valid token set in the organization-level Administration > Organization settings > Azure DevOps connectivity management ?

Hi ,

Thanks for your response. Unfortunately we are not using Azure DevOps connectivity management. We have created SonarCloud service connections in Azure DevOps and Authentication Tokens are generated through SonarCloud (go to My Account > Security > Generate Tokens). We verified tokens are valid and we are able to see the sonar cloud published results in our Sonar cloud projects as well. It’s just that pipeline’s quality build status is stuck in waiting eventough results are PASSED. This issue started after the Azure DevOps sonar cloud task version upgrade from 1 to 2.

If you have a bound organization… than you must be. SonarCloud needs to have authentication details of your Azure DevOps in order to decorate pull requests.

Did you check the location I mentioned in SonarCloud?

Hi Colin,

We do not have any tokens set under Administration > Organization settings > Azure DevOps connectivity management in sonarcloud. We created projects manually and the analysis parameters (sonar.projectKey and sonar.organization) are configured in our CI-based analysis setup.

Then if PR decoration has ever worked, you must have a project-level token configured under Administration > General Settings > Pull Requests.

After confirming that, I’d suggest generating a new token in Azure DevOps and replacing the existing token.

I know you mention

However, it is most likely a token issue. If you want to confirm – you can always try switching back to v1 of the tasks!

Thanks Colin for helping to resolve this issue. The issue was with our PAT tokens. Issue is now resolved after updating the PAT tokens under Administration > General Settings > Pull Requests .

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.