Disabled web-hooks cannot be manually tested

Summary

Disabled webhooks cannot be manually tested, and trying to do so causes 500 Internal Server errors due to NPEs.

This blocks #329849 (closed) since we cannot disable webhooks that users are unable to remediate.

Steps to reproduce

  1. Turn on the appropriate feature flag: Feature.enable(:web_hooks_disable_failed)
  2. Set up a failing webhook (e.g. using https://webhook.site or a similar service)
  3. Cause the hook to be disabled (either permanently with 4xx errors, or temporarily with 5xx errors).
  4. View the webhook, see that it is disabled
  5. Follow the the instructions to 'test' the hook. See that testing does not work.

What is the current bug behavior?

Attempts to test failed webhooks result in errors.

What is the expected correct behavior?

Testing a failed hook should send a request, and then either disable or re-enable the hook based on the response.

Output of checks

This bug happens on GitLab.com