Reputation: 4817
We have a Sonarcloud quality gate in the Pull request policy in Azure Devops. Mostly it works but sometimes it get's stuck. We added an update to the PR but is it still at status Waiting in Azure Devops. When I check Sonarcloud for this branch it says Passed.
How can I restart the gate or can I debug Sonarcloud if that e.g. has taken longer that what Azure Devops is waiting?
Upvotes: 1
Views: 5130
Reputation: 13590
I assume that project's settings for SonarCloud Provider points to Azure DevOps Services
in Administration > General Settings > Pull requests > Provider
.
Saying that, there might be other reason than expired token for a Pull Request with SonarCloud gate to hang in waiting state in Azure DevOps. And that reason is insufficient permissions for Azure DevOps repositories.
Namely, if an Azure DevOps PAT token was generated for a user who has no read access to the repository (e.g. a service user) then SonarCloud gate will hang in wait state. So make sure that a user who's PAT token is used has read access to the repository.
Upvotes: 0
Reputation: 4817
The reason for this was that the Personal Access Token used had expired, or at least creating a new one fixed this.
So go to https://sonarcloud.io/project/settings?category=pull_request&id=*projectkey* and change the Personal access token and queue the build.
Upvotes: 4