Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-11769

Document setting up SonarQube with GitHub Enterprise and PR decoration

    XMLWordPrintable

    Details

    • Type: Documentation
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.7
    • Component/s: Branch & PR
    • Labels:
      None
    • Edition:
      Developer
    • Production Notes:
      None

      Description

      On GitHub Enterprise

      • Create a GitHub App: all settings are optional for SonarQube. GitHub requires some values, but they will not be used by SonarQube. (I suggest to create a dummy app in your personal accounts and see for yourself, to get an idea of what users will experience.)
        • permissions required:
          • Pull requests: Read & write
          • Commit statuses: Read & write
            • =>¬†needed only to clean existing open PR with a review decoration
          • Checks:¬† Read&wWite
            • => needed to decorate pull requests with the Checks API
        • Event: no need to subscribe to any event
        • Where can this GitHub App be installed?
          • => "Any account" to be able to install the app on multiple account/organization.
      • Generate a private key for the app (the page where you create the app asks you to do this immediately after you create the app)
      • For each organization on GitHub Enterprise, install the app (how? -> TODO @Aurelie / @Benoit)

      On SonarQube

      Add to sonar.properties:

      sonar.pullrequest.github.endpoint=https://your-github-enterprise
      
      # the App ID and name of the GitHub app
      sonar.alm.github.app.id=...
      sonar.alm.github.app.name=SonarCloudTest2
      
      # the base64-encoded string of the private key file,
      # generate the string with the command: # base64 -w0 /path/to/key.pem
      sonar.alm.github.app.privateKey=...
      

      On every analysis

      The usual parameters, as used always.

      Migration path

      Existing decoration with Reviews that are in red status will become green, and decoration with Checks will be added.

      Users of the Require status checks to pass before merging feature of GitHub repositories, the GitHub admin should replace "SonarQube" with "SonarQube Code Analysis". Note that GitHub will show this new entry after the new check has run once.

      When an organization / repository has not installed the GitHub app, the pull request analysis page will show a warning, with a link to (TODO @Mike / @Ann).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.birnstiehl Mike Birnstiehl
              Reporter:
              benoit.gianinetti Benoit Gianinetti (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: