mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
webhooks/github: Ignore repository_vulnerability_alert event.
This event isn't incredibly common/useful and errors for this event were cluttering up our webhook logs.
This commit is contained in:
@@ -362,3 +362,14 @@ class GithubWebhookTest(WebhookTestCase):
|
||||
result = self.client_post(self.url, payload, HTTP_X_GITHUB_EVENT='push', content_type="application/json")
|
||||
self.assertFalse(check_send_webhook_message_mock.called)
|
||||
self.assert_json_success(result)
|
||||
|
||||
@patch('zerver.webhooks.github.view.check_send_webhook_message')
|
||||
def test_repository_vulnerability_alert_ignore(
|
||||
self, check_send_webhook_message_mock: MagicMock) -> None:
|
||||
self.url = self.build_webhook_url()
|
||||
payload = self.get_body('repository_vulnerability_alert')
|
||||
result = self.client_post(self.url, payload,
|
||||
HTTP_X_GITHUB_EVENT='repository_vulnerability_alert',
|
||||
content_type="application/json")
|
||||
self.assertFalse(check_send_webhook_message_mock.called)
|
||||
self.assert_json_success(result)
|
||||
|
||||
Reference in New Issue
Block a user