mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
integrations: Add screenshot configs for deployment integrations.
that do not have fixtures.
This commit is contained in:
@@ -65,11 +65,14 @@ CATEGORIES: dict[str, StrPromise] = {
|
|||||||
# WEBHOOK_INTEGRATIONS and NO_SCREENSHOT_CONFIG, but defined explicitly to
|
# WEBHOOK_INTEGRATIONS and NO_SCREENSHOT_CONFIG, but defined explicitly to
|
||||||
# avoid circular dependency
|
# avoid circular dependency
|
||||||
FIXTURELESS_INTEGRATIONS_WITH_SCREENSHOTS: list[str] = [
|
FIXTURELESS_INTEGRATIONS_WITH_SCREENSHOTS: list[str] = [
|
||||||
|
"capistrano",
|
||||||
"codebase",
|
"codebase",
|
||||||
"github-actions",
|
"github-actions",
|
||||||
"jenkins",
|
"jenkins",
|
||||||
"mercurial",
|
"mercurial",
|
||||||
|
"openshift",
|
||||||
"perforce",
|
"perforce",
|
||||||
|
"puppet",
|
||||||
"svn",
|
"svn",
|
||||||
]
|
]
|
||||||
FIXTURELESS_SCREENSHOT_CONTENT: dict[str, list[fixtureless_integrations.ScreenshotContent]] = {
|
FIXTURELESS_SCREENSHOT_CONTENT: dict[str, list[fixtureless_integrations.ScreenshotContent]] = {
|
||||||
|
@@ -19,7 +19,9 @@ BO_GIT_NAME = "bo-williams"
|
|||||||
# Example project content
|
# Example project content
|
||||||
PROJECT_NAME = "Example Project"
|
PROJECT_NAME = "Example Project"
|
||||||
PROJECT_PATH_PERFORCE = "//depot/zerver/example-project/*"
|
PROJECT_PATH_PERFORCE = "//depot/zerver/example-project/*"
|
||||||
|
PROJECT_STAGE = "production"
|
||||||
|
|
||||||
|
VERSION_NUMBER = "v9.2.3"
|
||||||
REVISION_NUMBER = THREE_DIGIT_NUMBER
|
REVISION_NUMBER = THREE_DIGIT_NUMBER
|
||||||
|
|
||||||
# Example branch content
|
# Example branch content
|
||||||
@@ -38,6 +40,8 @@ DEPLOYMENT_HASH = "e494a5be3393"
|
|||||||
# Example datetime content
|
# Example datetime content
|
||||||
_DT = datetime(2025, 5, 30, 2, 0, 0, tzinfo=timezone.utc)
|
_DT = datetime(2025, 5, 30, 2, 0, 0, tzinfo=timezone.utc)
|
||||||
DATETIME_STAMP = _DT.strftime("%Y-%m-%d %H:%M:%S")
|
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):
|
class ScreenshotContent(TypedDict):
|
||||||
@@ -45,6 +49,11 @@ class ScreenshotContent(TypedDict):
|
|||||||
content: str
|
content: str
|
||||||
|
|
||||||
|
|
||||||
|
CAPISTRANO = ScreenshotContent(
|
||||||
|
topic=PROJECT_NAME,
|
||||||
|
content=f"The [deployment]() to **{PROJECT_STAGE}** (version {VERSION_NUMBER}) has been completed successfully! :rocket:",
|
||||||
|
)
|
||||||
|
|
||||||
CODEBASE = ScreenshotContent(
|
CODEBASE = ScreenshotContent(
|
||||||
topic=f"Push to {BRANCH_GIT} on {PROJECT_NAME}",
|
topic=f"Push to {BRANCH_GIT} on {PROJECT_NAME}",
|
||||||
content=f"""{BO_NAME} pushed 2 commit(s) to `{BRANCH_GIT}` in project {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(
|
PERFORCE = ScreenshotContent(
|
||||||
topic=PROJECT_PATH_PERFORCE,
|
topic=PROJECT_PATH_PERFORCE,
|
||||||
content=f"""
|
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(
|
SVN = ScreenshotContent(
|
||||||
topic=PROJECT_NAME,
|
topic=PROJECT_NAME,
|
||||||
content=f"""**{BO_GIT_NAME}** committed revision r{REVISION_NUMBER} to `{BRANCH_SVN}`.
|
content=f"""**{BO_GIT_NAME}** committed revision r{REVISION_NUMBER} to `{BRANCH_SVN}`.
|
||||||
|
Reference in New Issue
Block a user