SonarCloud Pull Request annotations with Azure Devops and Github not working

github
azure
github-checks

(Alex Denton) #1

I am using Azure Pipelines for CI and PR validation with the SonarCloud extensions. Preparing the analysis configuration and running the analysis works. I can see that analysis was run on the SonarCloud side. I can even see that something happened on the github side as seen here:

But it never gets any farther than that. It just says queued and it’s never actually annotates the PRs or pass/fails the checks. Documentation seems a bit spotty so maybe I’m missing something. Am I doing something wrong or is this a bug?

Thanks!


(Aurélie Boiteux-Cabourdin) #2

Hi Alex,

We recently deployed a new way to decorate PR on GitHub. Now results of analysis are displayed on Checks, as you show in your screenshot, but still it seems your PR is not annotated.

Could you check some things, so that we can help you:

  • On your page of the Pull Request in SonarCloud, do you see the link “See the PR” in the top right corner ?
  • On GitHub, at the bottom of the the Conversation page, do you see a Check SonarCloud, and what it’s status ?
  • When was the last analysis on your PR ?

Thanks


(Alex Denton) #3

I think I just realized what the problem was based on your questions. I think what’s happening the branch was being picked up as CI rather than a PR because of my inclusion rules. I just changed the rules and I’m re-running. Hopefully, that is the issue. Thanks for saying just the right words to give me an insight :stuck_out_tongue:. I’ll circle back if the does or doesn’t work.


(Alex Denton) #4

So, unfortunately that alone didn’t seem to fix it. This is what I see in SonarCloud:

I would expect to see a separate section for pull requests which makes me think it’s picking it up incorrectly somehow. I don’t see a “Check SonarCloud” section on the github side. I reanalyzed two hours ago. I see under the background tasks page that the analysis is showing up as a project analsys. Not sure if that’s right.

I’m still experimenting. I’ll probably try creating a new branch and see if that works. I’ll let you know what happens and let me know if you have other suggestions. I’m eager to get this working.

P.S. Based on what you linked you expect annotations not to work anymore right? This is all moving to checks from what I can tell.


(Alex Denton) #5

Creating a new branch didn’t seem to do the trick either. I’m not really sure what else to try.