Skip to content

Add recent events to group hooks

Anton Smith requested to merge group-webhooks-recent-deliveries into master

What does this MR do and why?

Closes #325642 (closed)

While the group hook logs were being recorded in the database, they were not exposed in the UI.

This MR adds a Recent events table using the same layout that is shared by the project/integration/admin hooks.

Screenshots or screen recordings

Recent events table Request details
Screen_Shot_2022-08-04_at_12.07.46_PM Screen_Shot_2022-08-04_at_12.08.06_PM

325642

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Please note that the video above walks through these steps below.

  1. Switch to the master branch in GDK.
  2. Navigate to a group eg. http://gdk.test:3000/gitlab-org and then visit the group's Settings > Webhooks page.
  3. Add a new group hook using push events. For the URL, I suggest using a generated endpoint via https://webhook.site/.
  4. On the group hooks page, edit the group hook that you just created.
  5. On this page, observe that you only see one section currently (Edit Group Hook).
  6. Switch to the group-webhooks-recent-deliveries branch.
  7. Refresh the previous page and observe that you can see two sections now (Edit Group Hook and Recent events). The Recent events should be empty since we haven't made any events yet.
  8. Test the group webhook - this will generate an event in the Recent events table. You can also check https://webhook.site/ to confirm the call was made successfully.
  9. On the generated event, click View details to see the request details.
    • If you use https://webhook.site/ for the URL, please note that it doesn't send back a response so it is expected that the <pre> element under the Response is empty.
  10. Test the retry by clicking the Resend Request button. This should redirect you back to the edit group hook page.
  11. There should now be a new event in the Recent events table. You can also check https://webhook.site/ to confirm the call was made successfully.
    • If you don't see this request immediately, the job might be enqueued in Sidekiq. You can continuously refresh the page until it appears, or disable Sidekiq Cluster in GDK.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Anton Smith

Merge request reports