Pull request decoration failed because the token specified in the settings does not have sufficient rights. Please check the permissions of this token

vsts
pull-request

(Shiva Kumar K J) #1

I have generated a token in VSTS/AzureDevops and applied the same in sonarcloud pullrequests and, while sonarcloud analyses my pull request branch and finds (expected) issues, these issues are not decorated in my PR as in the original post.

I’ve already tried creating a new token, but this doesn’t resolve the issue for me. What can I do to troubleshoot this connection?

Sharing the task ID of one of the PR’s AWhfgKz9VNr3bdSnvNRl

Thanks,
Siva


(Fabrice Bellingard) #2

Did you give the token the required permissions, as explained on https://docs.microsoft.com/en-us/labs/devops/sonarcloudlab/index?tutorial-step=4?


(Shiva Kumar K J) #3

Thanks for your response.

Initially we tried with giving access to Code(Read&write) as per documentation ,when it didn’t work we tried giving full access but still it didn’t work.Please advice.


(Shiva Kumar K J) #4

@Fabrice_Bellingard Any updates ?


(Shiva Kumar K J) #5

Hi,

Do you need any more details on this issue , Please let me know.

Thanks,
Siva


(Shiva Kumar K J) #6

@Fabrice_Bellingard Do you have any updates ?


(Fabrice Bellingard) #7

Hi Shiva,

I can see on your projects in SonarCloud that PRs have good names (i.e. not branch names). So it looks like you managed to get this solved, right?


(Sebastian Zolg) #8

I have the same issue.
Token has Read&Write permission on Code scope as per the documentation.
However, sonarCloud reports:

“Pull request decoration failed because the token specified in the settings does not have sufficient rights. Please check the permissions of this token.”

Did something change on Azure DevOps or is something wrong with sonarCloud?


(Sebastian Zolg) #9

Any update here? Bug?


(Fabrice Bellingard) #10

I don’t think anything has changed on our side. Are you sure that the validity of your token is not expired?


(Shiva Kumar K J) #11

Hi,

Its working fine now. I can able to see CodeSmell in all my PR’s.

@Fabrice_Bellingard Thanks for advice.