Skip to content

Draft: Handle invalid integration web hook associations with validations

What does this MR do and why?

HasWebHook creates an associated ServiceHook record for an integration that mixes in the module.

Previously, when attempting to save an integration that would make an invalid associated web hook, the user did not get back any validation errors in the integration form.

This change leverages Rails validations to ensure a web hook is created correctly, and also that error messages will be returned to a user.

#385919 (comment 1211623132)

Screenshots or screen recordings

image

How to set up and validate locally

  1. Visit /<PROJECT>/-/settings/integrations/drone_ci
  2. For Drone Server URL enter https://test.com.
  3. For Token enter a 101-character string. This makes an invalid associated web hook at time of writing, but !107169 (merged) is changing this to 2049 characters to make it invalid. If !107169 (merged) merges first, then you could revert the change locally when QA'ing to make it easier.
  4. Click Save.
  5. You should see a validation error message.

MR acceptance checklist

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

Related to #385919 (closed)

Edited by Luke Duncalfe

Merge request reports