Azure Devops PR Build NOT reporting SonarCloud Quality Gate - Stuck in 'Waiting'

Seen a few posts on this topic - basically a PR build in Azure Devops has stopped reporting the quality gate results - it sits in a ‘waiting’ state and never completes, however the code coverage is reported. The build has not been changed, and the PAT code has been verified to be ok.

We’re using an Azure build pipeline, the UI version, with the 3 SonarCloud tasks. Timeout is set at 300s on the Publish Quality Gate Result task.

Hi @scr0che,

Can you provide me with the background task id of the analysis that did not provide the quality gate status? Do you see the inline comments in the PR?

Best,
Marcin

Hi,

Latest task ID is: AXc-lVZMYB3Qx4bo1wM0

No errors in the build tasks. Coverage status check comes back into the PR. No inline comments in the PR, but in the files view I do see red crosses on the line numbers where I expect SonarCloud to report an issue. Nothing on the overview pane however.

I’ve increased the timeout on the Quality Gate Result to 900s to see if it’s as simple as that.

Steve…

Also, I noted previously we received a comment on the PR for each SonarCloud issue, on the overview page. It was in the name of a colleague who is no longer with us, so perhaps there is some setting I need to adjust in Devlops/Sonarcloud?

Steve…

Hi @scr0che,

Increasing the timeout will not help as I see from the logs that all the calls to decorate the Azure DevOps Pull Request were unauthorized. Is it feasible for you to regenerate the PAT and make absolutely sure that all the permissions needed are there (important ones: Code (Read & Write) )?

Can it be that the colleague that is no longer with you, generated the PAT?

Best,
Marcin

Hi,

We have regenerated the PAT on the project and it has worked correctly, so that issue is solved. Suspect the old token was from a colleague no longer with us.

Can you advise if there is a way to set this PAT token organisation wide in one place? Or does it have to be set per project separately? We’d like an organisation wide setting ideally as we have many projects and don’t want to have to set this on each project.

Thanks,

Steve…

Hi,

If your organization is not bound to the Azure DevOps (was created manually and does not have Azure DevOps symbol next to the name in the UI as seen here: image ), than I am afraid using the token in every project is the only way. If the organization is bound, the field to enter the token is present in the organization settings.

Best,
Marcin

Hi,

We do have the devops symbol next to our organisation (when I hover over it, it states ‘this organisation is bound to azure devops’). Can you point me to where I should enter the single PAT token for the organisation, where the setting lives - and also should we remove the token from our individual projects, the PR setting under general?

Steve…

Hi,

You can find it in Administration -> Organization Settings. Then you can paste the token in Azure DevOps connectivity management. You have to remove the token from the project configuration (you can click "Reset), when it is there it will be taken first instead of the organization token. One important prerequisite apart from organization bound to the SonarCloud, the project itself also have to be bound (the same icon visible next to the project).

Best,
Marcin

Hi,

Thanks - can you advise how to make the project itself bound to the devops setting? We don’t see the devops icon next to the project.

Steve…

Hi,

I am afraid there is no way to make the unbound project bound. You would have to reimport the project, basically creating a new one (“Analyze new project” -> select the project from the list instead of creating the project manually).

Best,
Marcin

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