SonarCloud not reporting Quality Gate Status back to DevOps PR

  • ALM used (Azure DevOps)
  • CI system used (Azure DevOps)

We have branch policies that protect a branch with PR, and a Status Check policy on the Quality Gate results of an analysis.

Everything is working fine, I can see the quality gate result in SonarCloud, but it is not reporting back to the PR in DevOps, thus the PR is stuck with the quality gate status check in “Waiting”.

image

I have refreshed & updated the PAT from DevOps into the Administration tab, under Pull Requests, re-queued the build (which runs the analysis as a task), but this has had no effect.

Hey what version of Azure DevOps are you using? We are having the same issue. It started when we upgraded to AzDO 2020 from 2019. Could be a compatibility issue. Hoping they get to fix it quickly.

Hi Andrew - we’re using the hosted Azure DevOps, rather than Azure DevOps Server. Makes me think though if a change in the SonarCloud end has interfered how it works with the latest version of DevOps.

1 Like

We are experiencing same issue as well on hosed Azure DevOps.
can I ask if you are using SonarCloud build breaker task in your pipelines?
SonarCloud build breaker - Visual Studio Marketplace

We are trying to understand if this is an extension issue or Azure DevOps one

Nah we’re using the SonarSource extension:

SonarCloud - Visual Studio Marketplace

The build breaker plugin would have no impact on pull request decoration so it is not related.

please elaborate?

Pull request decoration is async from the pipeline. You push the report to sonarqube, sonarqube processes it and when done decorates the pull request. Meanwhile your build could still be going, or your build could fail due to the build breaker plugin, but sonarqube is still going to perform the pull request decoration.

Hi @JimLove and @audriusB ,

Apologies for the late reply. Can you share the background task id of the analysis that was not reported to the Azure DevOps PR? You can find it in Administration -> Background Tasks. Given that information, I can investigate further to see what may be the issue.

Best,
Marcin

Hi Marcin,
Here is an example Background Task Id for PR stuck in “Waiting” state
AXbdgTxaVXZ4b-ylW3qY

Hi @audriusB,

I checked the logs and it seems that the call to AzureDevOps is unauthorized. Are you sure that the token in the project configuration is valid?

Can you share the properties that you use to run the analysis in private message? I want to double-check few things.

Best,
Marcin

Hi @Marcin_Majewski ,

Here’s a task ID for my failure:

AXbMsP10nSBF5SJu_hCk

EDIT: I’ve noticed this is now updating the PRs as expected, it may have been a short, intermittent issue only appearing on Monday (Jan 4th).

1 Like

We are still experiencing the issue.
@JimLove, maybe there was something you did that got it resolved for you? Since Marcin says my issue is related to authorization (and I’m assuming we have same issue), maybe you tried something in that area?
@Marcin_Majewski
we tried it out on a new sonar project with new token and sonar gate is still “waiting” in devOps PR
DevOps Sonar service connection is working, sonar analysis is working and is showing in SonarCloud. Only quality gate is failing.
Also, how can I send a private message?

1 Like

Hi @audriusB,

You can send the private message by clicking “Message”

Best,
Marcin

@Marcin_Majewski, I dont see that option, am I missing some permissions, maybe?
can you try sending me a message first?

I sent a private message.

You may be right. I did generate a new PAT and added it to the Administration page in SonarCloud, but my initial test didn’t show any difference in results. Maybe it took some time to update, or cache was being used somewhere…

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