Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
integrations: Add screenshot configs for deployment integrations.
Niloth P24eab61ab015
diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.pyindex 4c306e036c3..67f0581fd44 100644--- a/zerver/lib/integrations.py+++ b/zerver/lib/integrations.py@@ -65,11 +65,14 @@ CATEGORIES: dict[str, StrPromise] = {# WEBHOOK_INTEGRATIONS and NO_SCREENSHOT_CONFIG, but defined explicitly to# avoid circular dependencyFIXTURELESS_INTEGRATIONS_WITH_SCREENSHOTS: list[str] = [+ "capistrano","codebase","github-actions","jenkins","mercurial",+ "openshift","perforce",+ "puppet","svn",]FIXTURELESS_SCREENSHOT_CONTENT: dict[str, list[fixtureless_integrations.ScreenshotContent]] = {diff --git a/zerver/webhooks/fixtureless_integrations.py b/zerver/webhooks/fixtureless_integrations.pyindex 49ce6697af7..abeb29282df 100644--- a/zerver/webhooks/fixtureless_integrations.py+++ b/zerver/webhooks/fixtureless_integrations.py@@ -19,7 +19,9 @@ BO_GIT_NAME = "bo-williams"# Example project contentPROJECT_NAME = "Example Project"PROJECT_PATH_PERFORCE = "//depot/zerver/example-project/*"+PROJECT_STAGE = "production"+VERSION_NUMBER = "v9.2.3"REVISION_NUMBER = THREE_DIGIT_NUMBER# Example branch content@@ -38,6 +40,8 @@ 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")+DATETIME_GLOBAL = f"<time:{_DT.strftime('%Y-%m-%dT%H:%M:%S%z')}>"+DATE_ISO_8601 = _DT.strftime("%Y-%m-%d")class ScreenshotContent(TypedDict):@@ -45,6 +49,11 @@ class ScreenshotContent(TypedDict):content: str+CAPISTRANO = ScreenshotContent(+ topic=PROJECT_NAME,+ content=f"The [deployment]() to **{PROJECT_STAGE}** (version {VERSION_NUMBER}) has been completed successfully! :rocket:",+)+CODEBASE = ScreenshotContent(topic=f"Push to {BRANCH_GIT} on {PROJECT_NAME}",content=f"""{BO_NAME} pushed 2 commit(s) to `{BRANCH_GIT}` in project {PROJECT_NAME}:@@ -73,6 +82,11 @@ MERCURIAL = ScreenshotContent(""",)+OPENSHIFT = ScreenshotContent(+ topic=PROJECT_NAME,+ content=f"""Deployment [{REVISION_NUMBER}]() triggered by a push to **{BRANCH_GIT}** by commit [{COMMIT_HASH_A[:7]}]() at {DATETIME_STAMP} has **failed**.""",+)+PERFORCE = ScreenshotContent(topic=PROJECT_PATH_PERFORCE,content=f"""@@ -84,6 +98,11 @@ PERFORCE = ScreenshotContent(""",)+PUPPET = ScreenshotContent(+ topic="Reports",+ content=f"""Puppet production run for web-server-01 completed at {DATETIME_GLOBAL}. [GitHub Gist]() | [Report URL]()""",+)+SVN = ScreenshotContent(topic=PROJECT_NAME,content=f"""**{BO_GIT_NAME}** committed revision r{REVISION_NUMBER} to `{BRANCH_SVN}`.