Pull request decoration with Azure devops is not working

Hello,

I’m trying to set Sonarcloud pull request decoration with Azure devops. I have set branch policies to the azure repos pull request target branch and integrated the ADO PAT(full access) in sonar cloud.
Pipeline is getting triggered whenever PR is created and sonar cloud analysis is running. The quality gate is failed. But i am not getting the failed result as comments in the Azure devops pull request. It keeps in the ‘waiting’ state.

From ADO side, everything is fine. Seems the issue is with sonarcloud sending result back to the ADO PR.

need some help team.

Thanks
Raj

Hi Raj,

Welcome to the community!

Can you try regenerating the PAT and resetting it in SonarCloud. PATs expire eventually, and unfortunately they do so silently.

 
Ann

Hi Ann,

i did that couple of times but the result is same. can you please suggest any other options?

Hi,

Are you comfortable sharing your organization & project ID publicly?

 
Thx,
Ann

No Ann, i can’t. pls suggest any other approach

I don’t know if this is same situation but we had to make sure we set the Provider and PAT on each project as well. Each project doesn’t use use the same as the organization apparently.

Select Project => Administration => General Settings then select “Pull Requests” and you have to set the provider and PAT there.

1 Like

Hi,

In fact, while you can set a PAT on a project, it’s recommended that you set it only at the organization level.

@Rajeev_G_P have you checked the docs I linked to above?

Regarding your org and project ID, you don’t have to share them publicly if you don’t want to. I’ve flagged this for more expert eyes.

 
Ann

Hey Ann,
i set the PAT at project level not at organization level. Let me just check that with org level and get back

Ann, i tried at organization level but the token is not getting verified though it has appropriate access.

Hi,

If you’ve set it both places, the project-level PAT will always override the org-level one.

 
Ann

Hi,

Okay Ann, let me check on that.

i did that as well

tried to remove project PAT and keep only organization PAT but it is not getting verified

Hi Ann,

i have set the ADO Organization PAT at both Organization and project in Sonarcloud and it is working now.

But the comments i am getting the result as only ‘Quality Gate is Failed or Passed’. Can’t i get the detailed comments like we get for Github?

Hi,

I’m glad you worked through this.

Sorry, but that’s all that’s available.

 
Ann

Thanks for the confirmation Ann. Thank you for your support…