Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

integrations/raygun: Use global time.

Niloth Pc2dd2c8527ad
diff --git a/static/images/integrations/raygun/001.png b/static/images/integrations/raygun/001.png
index bbbadb4c723..8a32ab505bf 100644
Binary files a/static/images/integrations/raygun/001.png and b/static/images/integrations/raygun/001.png differ
diff --git a/zerver/webhooks/raygun/tests.py b/zerver/webhooks/raygun/tests.py
index ba1f148084a..a74ea700db2 100644
--- a/zerver/webhooks/raygun/tests.py
+++ b/zerver/webhooks/raygun/tests.py
@@ -10,7 +10,7 @@ class RaygunHookTests(WebhookTestCase):
expected_topic_name = "test"
expected_message = """
[Error](https://app.raygun.com/error-url) status changed to **Ignored** by Emma Cat:
-* **Timestamp**: Wed Jan 28 01:49:36 1970
+* **Timestamp**: <time:Wed Jan 28 01:49:36 1970>
* **Application details**: [Best App](http://app.raygun.io/application-url)
""".strip()
@@ -29,7 +29,7 @@ Anita Peacock commented on [Error](https://app.raygun.com/error-url):
``` quote
Ignoring these errors
```
-* **Timestamp**: Wed Jan 28 01:49:36 1970
+* **Timestamp**: <time:Wed Jan 28 01:49:36 1970>
* **Application details**: [application name](http://app.raygun.io/application-url)
""".strip()
@@ -44,7 +44,7 @@ Ignoring these errors
expected_topic_name = "test"
expected_message = """
Amy Loondon assigned [Error](https://app.raygun.com/error-url) to Kyle Kenny:
-* **Timestamp**: Wed Jan 28 01:49:36 1970
+* **Timestamp**: <time:Wed Jan 28 01:49:36 1970>
* **Application details**: [application name](http://app.raygun.io/application-url)
""".strip()
@@ -59,8 +59,8 @@ Amy Loondon assigned [Error](https://app.raygun.com/error-url) to Kyle Kenny:
expected_topic_name = "test"
expected_message = """
One minute [follow-up error](http://app.raygun.io/error-url):
-* **First occurred**: Wed Jan 28 01:49:36 1970
-* **Last occurred**: Wed Jan 28 01:49:36 1970
+* **First occurred**: <time:Wed Jan 28 01:49:36 1970>
+* **Last occurred**: <time:Wed Jan 28 01:49:36 1970>
* 1 users affected with 1 total occurrences
* **Application details**: [application name](http://app.raygun.io/application-url)
""".strip()
@@ -76,8 +76,8 @@ One minute [follow-up error](http://app.raygun.io/error-url):
expected_topic_name = "test"
expected_message = """
Hourly [follow-up error](http://app.raygun.io/error-url):
-* **First occurred**: Wed Jan 28 01:49:36 1970
-* **Last occurred**: Wed Jan 28 01:49:36 1970
+* **First occurred**: <time:Wed Jan 28 01:49:36 1970>
+* **Last occurred**: <time:Wed Jan 28 01:49:36 1970>
* 1 users affected with 1 total occurrences
* **Application details**: [application name](http://app.raygun.io/application-url)
""".strip()
@@ -93,8 +93,8 @@ Hourly [follow-up error](http://app.raygun.io/error-url):
expected_topic_name = "test"
expected_message = """
New [Error](http://app.raygun.io/error-url) occurred:
-* **First occurred**: Wed Jan 28 01:49:36 1970
-* **Last occurred**: Wed Jan 28 01:49:36 1970
+* **First occurred**: <time:Wed Jan 28 01:49:36 1970>
+* **Last occurred**: <time:Wed Jan 28 01:49:36 1970>
* 1 users affected with 1 total occurrences
* **Tags**: test, error-page, v1.0.1, env:staging
* **Affected user**: a9b7d8...33846
@@ -114,8 +114,8 @@ New [Error](http://app.raygun.io/error-url) occurred:
expected_topic_name = "test"
expected_message = """
[Error](http://app.raygun.io/error-url) reoccurred:
-* **First occurred**: Wed Jan 28 01:49:36 1970
-* **Last occurred**: Wed Jan 28 01:49:36 1970
+* **First occurred**: <time:Wed Jan 28 01:49:36 1970>
+* **Last occurred**: <time:Wed Jan 28 01:49:36 1970>
* 1 users affected with 1 total occurrences
* **Tags**: test, error-page, v1.0.1, env:staging
* **Affected user**: a9b7d8...33846
diff --git a/zerver/webhooks/raygun/view.py b/zerver/webhooks/raygun/view.py
index 426fc37b675..2426e81af1a 100644
--- a/zerver/webhooks/raygun/view.py
+++ b/zerver/webhooks/raygun/view.py
@@ -81,7 +81,7 @@ def make_time_chunk(error_dict: WildValue) -> str:
time_last = parse_time(error_dict["lastOccurredOn"].tame(check_string))
# Provide time information about this error,
- return f"* **First occurred**: {time_first}\n* **Last occurred**: {time_last}\n"
+ return f"* **First occurred**: <time:{time_first}>\n* **Last occurred**: <time:{time_last}>\n"
def make_message_chunk(message: str) -> str:
@@ -252,7 +252,7 @@ def activity_message(payload: WildValue) -> str:
assigned_to = payload["error"]["assignedTo"].tame(check_string)
message += f"{user} assigned {error_link_md} to {assigned_to}:\n"
- message += "* **Timestamp**: {}\n".format(
+ message += "* **Timestamp**: <time:{}>\n".format(
parse_time(payload["error"]["activityDate"].tame(check_string))
)