From 44b105343ab01dbe0dd19bb37749dc6ba8885135 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 1 Jun 2023 15:37:37 +0300 Subject: [PATCH] Better english (#1959) Not sure if this breaks anything. it probably breaks backwards compat. Co-authored-by: Joey Orlando --- engine/apps/api/tests/test_channel_filter.py | 6 +++--- engine/config_integrations/alertmanager.py | 2 +- engine/config_integrations/elastalert.py | 2 +- engine/config_integrations/formatted_webhook.py | 2 +- engine/config_integrations/grafana.py | 2 +- engine/config_integrations/grafana_alerting.py | 2 +- engine/config_integrations/kapacitor.py | 2 +- engine/config_integrations/webhook.py | 2 +- engine/config_integrations/zabbix.py | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/engine/apps/api/tests/test_channel_filter.py b/engine/apps/api/tests/test_channel_filter.py index d22b7040..8e9fb39e 100644 --- a/engine/apps/api/tests/test_channel_filter.py +++ b/engine/apps/api/tests/test_channel_filter.py @@ -527,9 +527,9 @@ def test_channel_filter_convert_from_regex_to_jinja2( make_channel_filter(alert_receive_channel, is_default=True) # r"..." used to keep this string as raw string - regex_filtering_term = r"\".*\": \"This alert was sent by user for the demonstration purposes\"" - final_filtering_term = r'{{ payload | json_dumps | regex_search("\".*\": \"This alert was sent by user for the demonstration purposes\"") }}' - payload = {"description": "This alert was sent by user for the demonstration purposes"} + regex_filtering_term = r"\".*\": \"This alert was sent by user for demonstration purposes\"" + final_filtering_term = r'{{ payload | json_dumps | regex_search("\".*\": \"This alert was sent by user for demonstration purposes\"") }}' + payload = {"description": "This alert was sent by user for demonstration purposes"} regex_channel_filter = make_channel_filter( alert_receive_channel, diff --git a/engine/config_integrations/alertmanager.py b/engine/config_integrations/alertmanager.py index 579174de..a7b47527 100644 --- a/engine/config_integrations/alertmanager.py +++ b/engine/config_integrations/alertmanager.py @@ -276,7 +276,7 @@ example_payload = { "labels": {"alertname": "TestAlert", "region": "eu-1", "severity": "critical"}, "annotations": { "message": "This is test alert", - "description": "This alert was sent by user for the demonstration purposes", + "description": "This alert was sent by user for demonstration purposes", "runbook_url": "https://grafana.com/", }, "startsAt": "2018-12-25T15:47:47.377363608Z", diff --git a/engine/config_integrations/elastalert.py b/engine/config_integrations/elastalert.py index bb5dc8db..2cd00b1a 100644 --- a/engine/config_integrations/elastalert.py +++ b/engine/config_integrations/elastalert.py @@ -57,4 +57,4 @@ resolve_condition = """\ acknowledge_condition = None -example_payload = {"message": "This alert was sent by user for the demonstration purposes"} +example_payload = {"message": "This alert was sent by user for demonstration purposes"} diff --git a/engine/config_integrations/formatted_webhook.py b/engine/config_integrations/formatted_webhook.py index b653e837..ad42578b 100644 --- a/engine/config_integrations/formatted_webhook.py +++ b/engine/config_integrations/formatted_webhook.py @@ -52,5 +52,5 @@ example_payload = { "image_url": "https://upload.wikimedia.org/wikipedia/commons/e/ee/Grumpy_Cat_by_Gage_Skidmore.jpg", "state": "alerting", "link_to_upstream_details": "https://en.wikipedia.org/wiki/Downtime", - "message": "This alert was sent by user for the demonstration purposes\nSmth happened. Oh no!", + "message": "This alert was sent by user for demonstration purposes\nSmth happened. Oh no!", } diff --git a/engine/config_integrations/grafana.py b/engine/config_integrations/grafana.py index 1d90341d..5e6b6a81 100644 --- a/engine/config_integrations/grafana.py +++ b/engine/config_integrations/grafana.py @@ -224,7 +224,7 @@ example_payload = { "alertname": "TestAlert", "region": "eu-1", }, - "annotations": {"description": "This alert was sent by user for the demonstration purposes"}, + "annotations": {"description": "This alert was sent by user for demonstration purposes"}, "startsAt": "2018-12-25T15:47:47.377363608Z", "endsAt": "0001-01-01T00:00:00Z", "generatorURL": "", diff --git a/engine/config_integrations/grafana_alerting.py b/engine/config_integrations/grafana_alerting.py index 5b0deb0c..5427fc22 100644 --- a/engine/config_integrations/grafana_alerting.py +++ b/engine/config_integrations/grafana_alerting.py @@ -115,7 +115,7 @@ example_payload = { "alertname": "TestAlert", "region": "eu-1", }, - "annotations": {"description": "This alert was sent by user for the demonstration purposes"}, + "annotations": {"description": "This alert was sent by user for demonstration purposes"}, "startsAt": "2018-12-25T15:47:47.377363608Z", "endsAt": "0001-01-01T00:00:00Z", "generatorURL": "", diff --git a/engine/config_integrations/kapacitor.py b/engine/config_integrations/kapacitor.py index fd76c695..2e6f541b 100644 --- a/engine/config_integrations/kapacitor.py +++ b/engine/config_integrations/kapacitor.py @@ -54,6 +54,6 @@ acknowledge_condition = None example_payload = { "id": "TestAlert", - "message": "This alert was sent by user for the demonstration purposes", + "message": "This alert was sent by user for demonstration purposes", "data": "{foo: bar}", } diff --git a/engine/config_integrations/webhook.py b/engine/config_integrations/webhook.py index 0041c8c1..945cbb5f 100644 --- a/engine/config_integrations/webhook.py +++ b/engine/config_integrations/webhook.py @@ -57,4 +57,4 @@ resolve_condition = """\ {%- endif %}""" acknowledge_condition = None -example_payload = {"message": "This alert was sent by user for the demonstration purposes"} +example_payload = {"message": "This alert was sent by user for demonstration purposes"} diff --git a/engine/config_integrations/zabbix.py b/engine/config_integrations/zabbix.py index 9cce4030..87dbfae4 100644 --- a/engine/config_integrations/zabbix.py +++ b/engine/config_integrations/zabbix.py @@ -54,5 +54,5 @@ example_payload = { "image_url": "https://upload.wikimedia.org/wikipedia/commons/e/ee/Grumpy_Cat_by_Gage_Skidmore.jpg", "state": "alerting", "link_to_upstream_details": "https://en.wikipedia.org/wiki/Downtime", - "message": "This alert was sent by user for the demonstration purposes\nSmth happened. Oh no!", + "message": "This alert was sent by user for demonstration purposes\nSmth happened. Oh no!", }