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.
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
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.
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
- 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