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

Validate administrator configuration for GitHub

    XMLWordPrintable

    Details

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

      Description

      We want to improve the GitHub integration by checking the validity of the configuration as early as possible.

      HOW

      Create and use a new API endpoint common for all 4 ALMs POST api/alm_settings/validate?key=xxx

      This endpoint will return an empty 200 code if everything is alright, or a 400 code with a message as plaintext detailing what issue is detected.

      To validate that GitHub is properly configured, on the endpoint implementation, we want to verify the connectivity, the authentication, and the permissions. Here are the GitHub endpoints to call to achieve that:

      • Validate authentication
      • Url validation endpoint: /meta
      • Auth validation endpoint: /user
      • validate permissions
        • Read permission: /user/repos lists repos of authenticated user
        • Write Permission: None

       

       

      UI

      When saving a configuration (be it new or edited), the modal hosting the form will be closed, and validation automatically triggered.

      A call is made to api/alm_settings/validate?key=[configuration_key].

      The configuration will be shown as "being validated", and then the status will be updated when we get a response.

      • In case of success, we show a message and check mark with the status for each feature (PR decoration & import)
      • In case of error, the reason ( best effort regarding its precision ) is clearly stated for the user, in order to help them fix whatever the issue is.

      This validation can be manually triggered by pressing a button.


      When loading the page, all existing configurations are re-validated following the above pattern, with the following exception:

      • in case of success, no success message is displayed, only the valid status.

       

      See design for details

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mark.rekveld Mark Rekveld (Inactive)
              Reporter:
              pierre.guillot Pierre Guillot
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: