"Checks" tab remains empty in GitHub pull request

Summary

When a PR is made or updated in our organization’s GitHub repository, it successfully triggers a Travis CI build which then kicks off code analysis reporting in SonarCloud.

SonarCloud correctly displays newly introduced bugs and code coverage for the lines that were added in the pull request.

The problem is that SonarCloud doesn’t decorate the pull request in GitHub and doesn’t fill the “Checks” tab in the associated pull request. The “Checks” tab just displays Waiting for checks information....

If the code changes don’t pass the quality gate, the pull request also isn’t prevented from merging into the target branch.

Technical details

  • Language and build tool: Java 11, Maven
  • Travis CI build: link
  • SonarCloud project: link
    • Example of pull request that doesn’t pass quality gate: (SonarCloud)
  • GitHub repository: link
    • Example of failing pull request that is not decorated by SonarCloud: (GitHub)

Additional information

We started this project in 2018 and created a ‘bot’ GitHub user account and configured tokens so that SonarCloud could comment on our pull requests. This worked well.

No changes were made to the project in over two years, until we came back to it recently. I found out that SonarCloud now uses a GitHub app to integrate with projects, so the app was installed and configured into our project.

When I click “Configure” on the SonarCloud app in the “Integrations” tab of our project on GitHub, it shows that both required permissions are checked. Under “Repository Access” I selected “Only selected repositories” and underneath I selected our project repository.

Hi @nibsi,

Welcome to the community!

Your PR checks are not appearing because of two reasons:

Your organization is not bound to GitHub, you can fix this by going to Administration → Organization Settings and binding it to GitHub. This is required for the GitHub checks to appear.

Your project is not bound to GitHub. This you can fixed in two ways:

  1. Starting from scratch. After binding your organization GitHub. Add the project from by clicking ‘+’ icon and selecting it from visible GitHub repositories.
    image
  2. Provide sonar.pullrequest.provider=GitHub and sonar.pullrequest.github.repository=CoderanchCorral/Blackjack properties when doing analysis.

Best,
Marcin

2 Likes

Hello Marcin,

Thank you very much for your welcome and your solution. It worked perfectly and our pull requests are now decorated very nicely!

1 Like

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