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.
Screenshots or screen recordings
How to set up and validate locally
- Visit
/<PROJECT>/-/settings/integrations/drone_ci
- For Drone Server URL enter
https://test.com
. - 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.
- Click Save.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #385919 (closed)
Edited by Luke Duncalfe