integrations: Add Gogs webhook for release event.

Extends Gogs integrations in order to support a published release.
Tested on my local Ubuntu development server running on WSL2.

Fixes #14746.
This commit is contained in:
cestrell
2020-05-11 02:58:53 -04:00
committed by Tim Abbott
parent f642a0fc89
commit e3f0b2f20f
4 changed files with 104 additions and 2 deletions

View File

@@ -137,6 +137,11 @@ class GogsHookTests(WebhookTestCase):
expected_message = """kostekIV edited a [comment](https://try.gogs.io/kostekIV/test/issues/3#issuecomment-3634) on [Issue #3](https://try.gogs.io/kostekIV/test/issues/3):\n\n~~~ quote\nedit comment\n~~~"""
self.send_and_test_stream_message('issue_comment__edited', expected_topic, expected_message)
def test_release_published(self) -> None:
expected_topic = "zulip_test / v1.4 Title"
expected_message = """cestrell published release [Title](https://try.gogs.io/cestrell/zulip_test) for tag v1.4."""
self.send_and_test_stream_message('release__published', expected_topic, expected_message)
@patch('zerver.webhooks.gogs.view.check_send_webhook_message')
def test_push_filtered_by_branches_ignore(self, check_send_webhook_message_mock: MagicMock) -> None:
self.url = self.build_webhook_url(branches='changes,development')