CoderanchCorral / Blackjack

Mozilla Public License 2.0
17 stars 2 forks source link

Let SonarCloud write to the Checks tab on pull requests #18

Closed nibsi closed 3 years ago

nibsi commented 3 years ago

Pull requests are automatically built by Travis CI and then analyzed by SonarQube. The results are published on SonarCloud: https://sonarcloud.io/dashboard?id=com.coderanch%3Ablackjack-parent

All of this works nicely, but SonarCloud is supposed to update the Checks tab in the pull request, preventing the PR from merging if the code doesn't pass the quality gate. Sadly, it doesn't seem to work and the Checks tab is always empty.

I added SonarQube analysis back in 2018 and since then SonarCloud has gone through a bunch of changes. Configuring a new project on SonarCloud might fix this issue, but I would really like to keep using the current one if possible.

aquino-a commented 3 years ago

Would this be fixed on the sonarcloud site or in the source?

nibsi commented 3 years ago

@aquino-a My guess is that it would get fixed in both the project configuration on SonarCloud and the GitHub repository settings. I don't think any sources are involved.

I think I'm the only one who has admin access to both SonarCloud and the GitHub repository, so I will have to make the changes myself, but any insights from people who have gotten this to work before are very much appreciated.

liutaurasvilda commented 3 years ago

At least in the past 6 months this feature wasn't supported for Java in particular, meaning PR decoration along with merge blocking if quality gates do not pass. So the PR gets decorated but it shows(-ed) 100% on all quality measures.

I'm not aware if that has been actually fixed.

nibsi commented 3 years ago

@liutaurasvilda Thanks. I suppose that means we'll have to wait until SonarCloud fixes this and be extra careful with our reviews in the mean time?

liutaurasvilda commented 3 years ago

@nibsi I'll double check if this hasn't been fixed in the recent times in order not to mislead you, but that was the problem I faced at work 6 or so months back.

thomas-olivier-sonarsource commented 3 years ago

Hi there. Thomas here, Product Marketing Manager @SonarCloud. Two things I can say:

  1. If you're using SonarCloud, PR decorations and merge blocking actually work for Java in the context of GitHub
  2. If you need help from us, could you please ask you questions to HTTP://community.sonarsource.com? Have a good day ;-)
nibsi commented 3 years ago

@thomas-olivier-sonarsource thank you very much. I will do that.

liutaurasvilda commented 3 years ago

@thomas-olivier-sonarsource great news. Thank you for clarifying it.

nibsi commented 3 years ago

Here's the question I asked at SonarSource:

https://community.sonarsource.com/t/checks-tab-remains-empty-in-github-pull-request/40319