Uploaded image for project: 'Product Roadmaps'
  1. Product Roadmaps
  2. MMF-647

Administration console for webhooks

    XMLWordPrintable

    Details

      Description

      Context - Why

      Webhooks have been implemented in SonarQube 6.2. A basic administration console has been implemented through the regular settings page. It suffers from some limitations:

      • no verification on inputs (format of URL, max number of webhooks) - too easy to make mistakes
      • no reporting of deliveries - painful to know what happened on a given webhook
      • not available at organization level (for SonarCloud) - which is painful for a company which wants to define a webhook for all the projects

      Having a dedicated administration console would be convenient to:

      • help writing correct configuration
      • list all deliveries, including time and status
      • get the detail of each delivery (JSON payload, time, execution time, ...). Note that these information are already stored in version 6.2.

      Use Cases - What

      As an org admin on SonarCloud or global admin on SonarQube, I expect to find a "Webhooks" page in "Administration" in which I can:

      • create a webhook
        • Name and URL are still the 2 only fields that are required
        • I expect to get some validation of my input (for instance to check the format of the URL with or without credentials)
      • see the list of webhooks
        • No pagination required, the max number of webhooks being restricted to 10 max
        • Sorted alphabetically by name
        • Each entry should show the status of the last execution and the name (plus the Edit and Delete buttons)
      • update or delete an existing webhook
      • click on a webhook to see its details:
        • Name and URL
        • Listing of recent deliveries, on which I can click to see the details of each execution (including the payload)

      As a project admin, I should also get a "Webhooks" admin page:

      • In which I can define up to 10 webhooks
      • In which I don't see the webhooks defined globally or at org level

      Design solution

      The Webhooks page is accessible from the Administration dropdown in:
      General Administration:

      Organization space:

      Project space:

      The Webhooks page shows the list of Webhooks, limited to 10.

      Clicking on the Create button on the top right corner opens a modal

      The Create button inside the popup is disabled until proper values are entered in the input fields.
      Error messages are displayed when the user doesn't correctly fill the fields

      Validation states are shown when fields are correctly filled. The Create button is then enabled.

      As the maximum number of Webhooks is 10, over this limit the Create button on the top right corner of the page will be disabled. A tooltip message will explain why.

      Clicking on the button next to each Webhook shows different possible actions in a dropdown. The user can edit or delete a webhook (using our usual modal patterns for edition and deletion).

      Clicking on Show recent deliveries opens a simple modal with an accordion list of recent deliveries.

      Note: this list is paginated to 10. Over this number, a "Show more" link appears to expand the list.

      Expanding one of the accordion item shows more information on the selected delivery:

      Quick prototype:
      https://invis.io/9EFJ7E4VXFY#/275705961_Webhooks_01

      Implementation - How

      Implementation note :

      • The web services api/webhooks/deliveries and api/webhooks/delivery already exist to list and get the details of deliveries.
      • Today webhooks are created and stored as settings, they should have their own services and table ; migration required.
      • Global webhooks should me moved to organization level (default orga for SonarQube)
      • We need to be able to update webhooks in order to not lose history of deliveries
      • To better fit the presentation layer, service returning list of webhooks should contains last execution status

      Out of scope of current MMF

      • Helpers to create Webhook (wizard ?)
      • Specific handling for credentials (today passed as part of url)
      • Capability to validate webhook (test button @ creation)
      • Different types of Webhook

        Attachments

        1. Webhook_-_https___github_hipch_at_incoming.png
          Webhook_-_https___github_hipch_at_incoming.png
          149 kB
        2. Webhooks___Services.png
          Webhooks___Services.png
          79 kB
        3. Webhooks_01.png
          Webhooks_01.png
          267 kB
        4. Webhooks_02.png
          Webhooks_02.png
          234 kB
        5. Webhooks_03.png
          Webhooks_03.png
          266 kB
        6. Webhooks_04.png
          Webhooks_04.png
          139 kB
        7. Webhooks_05.png
          Webhooks_05.png
          142 kB
        8. Webhooks_06.png
          Webhooks_06.png
          148 kB
        9. Webhooks_07.png
          Webhooks_07.png
          151 kB
        10. Webhooks_08.png
          Webhooks_08.png
          144 kB
        11. Webhooks_09.png
          Webhooks_09.png
          119 kB
        12. Webhooks_10.png
          Webhooks_10.png
          146 kB
        13. Webhooks_11.png
          Webhooks_11.png
          182 kB

          Issue Links

            Activity

              People

              Assignee:
              fabrice.bellingard Fabrice Bellingard
              Reporter:
              simon.brandhof Simon Brandhof (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: