Skip to content

Webhook log backend tweaks

Administrator requested to merge aharvey/webhook-log-backend-tweaks into main

Created by: LawnGnome

Here are a few odds and ends that became more obvious needs as I worked on #27179:

  • The design Rob and I came up with needs the ability to retrieve all webhook logs, as well as unmatched logs, so that ability has been added to the top level query resolver webhookLogs() method. (This was already supported in the store anyway.)
  • The middleware would fail to write the correct status code if the handler didn't explicitly set one and didn't send any response bytes. It now defaults to 200.
  • I hadn't added tracking for the request URL, which might be useful, so I added that. I also added the method and version, which means we can render the request like it really looked on the wire. (Spoiler: highlight.js has some really nifty formatting for this.)
  • Fixed a bug with requesting the externalService on webhook logs that don't have an external service.
  • Changed the pagination to use graphqlutil.ConnectionArgs because our GraphQL library couldn't unmarshal a JSON number into an int. Cool. I feel really good about it.

Rather than splitting these up, I've put them in this PR for easier reviewing, but if anyone wants them in separate PRs I am happy to oblige.

Merge request reports

Loading