Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
webhooks: Correct OpsGenie to Opsgenie.
Anders Kaseorgd8f4e0ffb9f9
diff --git a/docs/overview/changelog.md b/docs/overview/changelog.mdindex ca1856a0766..89ba2285174 100644--- a/docs/overview/changelog.md+++ b/docs/overview/changelog.md@@ -1858,7 +1858,7 @@ running a version from before 1.7 should upgrade directly to 1.7.1.- Added new "getting started" guides to the user documentation.- Added support for installing a Zulip server from a Git checkout.- Added support for mentioning a user when editing a message.-- Added OpsGenie, Google Code-In, Google Search, and xkcd integrations.+- Added Opsgenie, Google Code-In, Google Search, and xkcd integrations.- Added support for organization administrators deleting private streams.- Added support for using any LDAP attribute for login username.- Added support for searching by group-pm-with.diff --git a/zerver/webhooks/opsgenie/tests.py b/zerver/webhooks/opsgenie/tests.pyindex 3ec72ab1109..ed54b9da948 100644--- a/zerver/webhooks/opsgenie/tests.py+++ b/zerver/webhooks/opsgenie/tests.py@@ -1,7 +1,7 @@from zerver.lib.test_classes import WebhookTestCase-class OpsGenieHookTests(WebhookTestCase):+class OpsgenieHookTests(WebhookTestCase):STREAM_NAME = "opsgenie"URL_TEMPLATE = "/api/v1/external/opsgenie?&api_key={api_key}&stream={stream}"WEBHOOK_DIR_NAME = "opsgenie"@@ -9,7 +9,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_acknowledge_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: Acknowledge* **Message**: test alert* **Tags**: `tag1`, `tag2`@@ -25,7 +25,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_addnote_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: AddNote* **Note**: note to test alert* **Message**: test alert@@ -42,7 +42,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_addrecipient_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: AddRecipient* **Recipient**: team2_escalation* **Message**: test alert@@ -59,7 +59,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_addtags_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: AddTags* **Tags added**: tag1,tag2,tag3* **Message**: test alert@@ -76,7 +76,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_addteam_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: AddTeam* **Team added**: team2* **Message**: test alert@@ -93,7 +93,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_assignownership_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: AssignOwnership* **Assigned owner**: [email protected]* **Message**: test alert@@ -110,7 +110,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_close_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: Close* **Message**: test alert""".strip()@@ -125,7 +125,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_create_alert(self) -> None:expected_topic = "Webhook"expected_message = """-[OpsGenie alert for Webhook](https://app.opsgenie.com/alert/V2#/show/ec03dad6-62c8-4c94-b38b-d88f398e900f):+[Opsgenie alert for Webhook](https://app.opsgenie.com/alert/V2#/show/ec03dad6-62c8-4c94-b38b-d88f398e900f):* **Type**: Create* **Message**: another alert* **Tags**: `vip`@@ -141,7 +141,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_customaction_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: TestAction* **Message**: test alert* **Tags**: `tag1`, `tag2`@@ -157,7 +157,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_delete_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: Delete* **Message**: test alert""".strip()@@ -172,7 +172,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_escalate_alert(self) -> None:expected_topic = "Webhook_Test"expected_message = """-[OpsGenie alert for Webhook_Test](https://app.opsgenie.com/alert/V2#/show/7ba97e3a-d328-4b5e-8f9a-39e945a3869a):+[Opsgenie alert for Webhook_Test](https://app.opsgenie.com/alert/V2#/show/7ba97e3a-d328-4b5e-8f9a-39e945a3869a):* **Type**: Escalate* **Escalation**: test_esc""".strip()@@ -187,7 +187,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_removetags_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: RemoveTags* **Tags removed**: tag3* **Message**: test alert@@ -204,7 +204,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_takeownership_alert(self) -> None:expected_topic = "Webhook"expected_message = """-[OpsGenie alert for Webhook](https://app.opsgenie.com/alert/V2#/show/8a745a79-3ed3-4044-8427-98e067c0623c):+[Opsgenie alert for Webhook](https://app.opsgenie.com/alert/V2#/show/8a745a79-3ed3-4044-8427-98e067c0623c):* **Type**: TakeOwnership* **Message**: message test* **Tags**: `tag1`, `tag2`@@ -220,7 +220,7 @@ class OpsGenieHookTests(WebhookTestCase):def test_unacknowledge_alert(self) -> None:expected_topic = "Integration1"expected_message = """-[OpsGenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):+[Opsgenie alert for Integration1](https://app.opsgenie.com/alert/V2#/show/052652ac-5d1c-464a-812a-7dd18bbfba8c):* **Type**: UnAcknowledge* **Message**: test alert* **Tags**: `tag1`, `tag2`diff --git a/zerver/webhooks/opsgenie/view.py b/zerver/webhooks/opsgenie/view.pyindex 436b672d47f..886a1f14398 100644--- a/zerver/webhooks/opsgenie/view.py+++ b/zerver/webhooks/opsgenie/view.py@@ -26,7 +26,7 @@ ALL_EVENT_TYPES = []-@webhook_view("OpsGenie", all_event_types=ALL_EVENT_TYPES)+@webhook_view("Opsgenie", all_event_types=ALL_EVENT_TYPES)@has_request_variablesdef api_opsgenie_webhook(request: HttpRequest,@@ -93,7 +93,7 @@ def api_opsgenie_webhook()body_template = """-[OpsGenie alert for {integration_name}](https://app.opsgenie.com/alert/V2#/show/{alert_id}):+[Opsgenie alert for {integration_name}](https://app.opsgenie.com/alert/V2#/show/{alert_id}):* **Type**: {alert_type}{additional_info}""".strip()