Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
integrations: Add screenshot configs for fixtureless CI integrations.
Niloth P7f2161bffae6
diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.pyindex ca3cacdba45..4c306e036c3 100644--- a/zerver/lib/integrations.py+++ b/zerver/lib/integrations.py@@ -66,6 +66,8 @@ CATEGORIES: dict[str, StrPromise] = {# avoid circular dependencyFIXTURELESS_INTEGRATIONS_WITH_SCREENSHOTS: list[str] = ["codebase",+ "github-actions",+ "jenkins","mercurial","perforce","svn",@@ -609,7 +611,10 @@ INTEGRATIONS: dict[str, Integration] = {"errbot": Integration("errbot", ["meta-integration", "bots"]),"giphy": Integration("giphy", ["misc"], display_name="GIPHY"),"github-actions": Integration(- "github-actions", ["continuous-integration"], display_name="GitHub Actions"+ "github-actions",+ ["continuous-integration"],+ display_name="GitHub Actions",+ stream_name="github-actions updates",),"hubot": Integration("hubot", ["meta-integration", "bots"]),"jenkins": Integration("jenkins", ["continuous-integration"]),@@ -869,6 +874,7 @@ for integration, screenshots_contents in FIXTURELESS_SCREENSHOT_CONTENT.items():FIXTURELESS_SCREENSHOT_CONFIG_OPTIONAL_FIELDS = {"mercurial": {"image_dir": "hg"},+ "jenkins": {"image_name": "004.png"},}for integration, fields in FIXTURELESS_SCREENSHOT_CONFIG_OPTIONAL_FIELDS.items():diff --git a/zerver/webhooks/fixtureless_integrations.py b/zerver/webhooks/fixtureless_integrations.pyindex 3c69900dd86..49ce6697af7 100644--- a/zerver/webhooks/fixtureless_integrations.py+++ b/zerver/webhooks/fixtureless_integrations.py@@ -1,3 +1,4 @@+from datetime import datetime, timezonefrom typing import TypedDict# For integrations that don't have example webhook fixtures/payloads,@@ -34,6 +35,10 @@ COMMIT_HASH_A = "a2e84e86ddf7e7f8a9b0c1d2e3f4a5b6c7d8e9f0"COMMIT_HASH_B = "9fceb02c0c4b8e4c1e7b43hd4e5f6a7b8c9d0e1f"DEPLOYMENT_HASH = "e494a5be3393"+# Example datetime content+_DT = datetime(2025, 5, 30, 2, 0, 0, tzinfo=timezone.utc)+DATETIME_STAMP = _DT.strftime("%Y-%m-%d %H:%M:%S")+class ScreenshotContent(TypedDict):topic: str@@ -49,6 +54,17 @@ CODEBASE = ScreenshotContent(""",)+GITHUB_ACTIONS = ScreenshotContent(+ topic="scheduled backups",+ content=f"""Backup [failed]() at {DATETIME_STAMP}.+> Unable to connect.""",+)++JENKINS = ScreenshotContent(+ topic=PROJECT_NAME,+ content=f"**Build:** [#{REVISION_NUMBER}](): FAILURE :cross_mark:",+)+MERCURIAL = ScreenshotContent(topic=BRANCH_MERCURIAL,content=f"""**{BO_NAME}** pushed [2 commits]() to **{BRANCH_MERCURIAL}** (`{REVISION_NUMBER}:{DEPLOYMENT_HASH[:12]}`):