webhooks: Use 200 status code for unknown events.

Because the third party might not be expecting a 400 from our
webhooks, we now instead use 200 status code for unknown events,
while sending back the error to Sentry. Because it is no longer an error
response, the response type should now be "success".

Fixes #24721.

(cherry picked from commit 84723654c8)
This commit is contained in:
Zixuan James Li
2023-04-04 01:09:30 -04:00
committed by Alex Vandiver
parent 61b5577cf4
commit ec8a284ad5
9 changed files with 52 additions and 10 deletions

View File

@@ -525,7 +525,7 @@ A temporary team so that I can get some webhook fixtures!
stack_info = m.call_args[1]["stack_info"]
self.assertIn(
"The 'team/edited (changes: bogus_key1/bogus_key2)' event isn't currently supported by the GitHub webhook",
"The 'team/edited (changes: bogus_key1/bogus_key2)' event isn't currently supported by the GitHub webhook; ignoring",
msg,
)
self.assertTrue(stack_info)