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/gocd: Use global time.

Niloth Pad1258852431
diff --git a/static/images/integrations/gocd/001.png b/static/images/integrations/gocd/001.png
index 7bdbd010584..e5e508a7496 100644
Binary files a/static/images/integrations/gocd/001.png and b/static/images/integrations/gocd/001.png differ
diff --git a/zerver/webhooks/gocd/tests.py b/zerver/webhooks/gocd/tests.py
index 07f24af0d42..8accd3913c8 100644
--- a/zerver/webhooks/gocd/tests.py
+++ b/zerver/webhooks/gocd/tests.py
@@ -10,7 +10,7 @@ class GocdHookTests(WebhookTestCase):
expected_topic = "Pipeline / Stage"
expected_message = """**Pipeline building**: Pipeline / Stage
- **Commit**: [`59f3c6e4540`](https://github.com/swayam0322/Test/commit/59f3c6e4540) on branch `main`
-- **Started**: Feb 1, 2024, 1:58:13 AM"""
+- **Started**: <time:Feb 1, 2024, 1:58:13 AM>"""
self.check_webhook(
"pipeline_building",
@@ -22,8 +22,8 @@ class GocdHookTests(WebhookTestCase):
expected_topic = "Pipeline / Stage"
expected_message = """:green_circle: **Build passed**: Pipeline / Stage
- **Commit**: [`59f3c6e4540`](https://github.com/swayam0322/Test/commit/59f3c6e4540) on branch `main`
-- **Started**: Feb 1, 2024, 1:58:13 AM
-- **Finished**: Feb 1, 2024, 1:58:40 AM
+- **Started**: <time:Feb 1, 2024, 1:58:13 AM>
+- **Finished**: <time:Feb 1, 2024, 1:58:40 AM>
- **Passed**: `Job`"""
self.check_webhook("pipeline_passed", expected_topic, expected_message)
@@ -32,8 +32,8 @@ class GocdHookTests(WebhookTestCase):
expected_topic = "pipeline-one / stage-two"
expected_message = """:red_circle: **Build failed**: pipeline-one / stage-two
- **Commit**: [`963eb239c7b`](https://github.com/PieterCK/getting-started-repo.git/commit/963eb239c7b) on branch `master`
-- **Started**: Aug 28, 2024, 9:30:19 PM
-- **Finished**: Aug 28, 2024, 9:31:00 PM
+- **Started**: <time:Aug 28, 2024, 9:30:19 PM>
+- **Finished**: <time:Aug 28, 2024, 9:31:00 PM>
- **Failed**: `task-two`"""
self.check_webhook("pipeline_failed", expected_topic, expected_message)
@@ -41,8 +41,8 @@ class GocdHookTests(WebhookTestCase):
expected_topic = "test-pipeline / backend-tests"
expected_message = """:red_circle: **Build failed**: test-pipeline / backend-tests
- **Commit**: [`963eb239c7b`](https://github.com/PieterCK/getting-started-repo.git/commit/963eb239c7b) on branch `master`
-- **Started**: Aug 29, 2024, 3:59:18 PM
-- **Finished**: Aug 29, 2024, 4:00:15 PM
+- **Started**: <time:Aug 29, 2024, 3:59:18 PM>
+- **Finished**: <time:Aug 29, 2024, 4:00:15 PM>
- **Failed**: `check-backend-lints`, `test-frontend-js`
- **Passed**: `check-backend-tests`, `zulip-ci-debian-12`"""
self.check_webhook("pipeline_with_mixed_job_result", expected_topic, expected_message)
diff --git a/zerver/webhooks/gocd/view.py b/zerver/webhooks/gocd/view.py
index 9364af01338..f3f0a558665 100644
--- a/zerver/webhooks/gocd/view.py
+++ b/zerver/webhooks/gocd/view.py
@@ -18,14 +18,14 @@ TOPIC_TEMPLATE = "{pipeline} / {stage}"
SCHEDULED_BODY_TEMPLATE = """
**Pipeline {status}**: {pipeline} / {stage}
- **Commit**: {commit_details}
-- **Started**: {start_time}
+- **Started**: <time:{start_time}>
"""
COMPLETED_BODY_TEMPLATE = """
{emoji} **Build {status}**: {pipeline} / {stage}
- **Commit**: {commit_details}
-- **Started**: {start_time}
-- **Finished**: {end_time}
+- **Started**: <time:{start_time}>
+- **Finished**: <time:{end_time}>
"""