integrations: Add screenshot configs for fixtureless CI integrations.

This commit is contained in:
Niloth P
2025-07-30 12:30:14 +05:30
committed by Tim Abbott
parent 65d01b553b
commit 7f2161bffa
2 changed files with 23 additions and 1 deletions

View File

@@ -66,6 +66,8 @@ CATEGORIES: dict[str, StrPromise] = {
# avoid circular dependency # avoid circular dependency
FIXTURELESS_INTEGRATIONS_WITH_SCREENSHOTS: list[str] = [ FIXTURELESS_INTEGRATIONS_WITH_SCREENSHOTS: list[str] = [
"codebase", "codebase",
"github-actions",
"jenkins",
"mercurial", "mercurial",
"perforce", "perforce",
"svn", "svn",
@@ -609,7 +611,10 @@ INTEGRATIONS: dict[str, Integration] = {
"errbot": Integration("errbot", ["meta-integration", "bots"]), "errbot": Integration("errbot", ["meta-integration", "bots"]),
"giphy": Integration("giphy", ["misc"], display_name="GIPHY"), "giphy": Integration("giphy", ["misc"], display_name="GIPHY"),
"github-actions": Integration( "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"]), "hubot": Integration("hubot", ["meta-integration", "bots"]),
"jenkins": Integration("jenkins", ["continuous-integration"]), "jenkins": Integration("jenkins", ["continuous-integration"]),
@@ -869,6 +874,7 @@ for integration, screenshots_contents in FIXTURELESS_SCREENSHOT_CONTENT.items():
FIXTURELESS_SCREENSHOT_CONFIG_OPTIONAL_FIELDS = { FIXTURELESS_SCREENSHOT_CONFIG_OPTIONAL_FIELDS = {
"mercurial": {"image_dir": "hg"}, "mercurial": {"image_dir": "hg"},
"jenkins": {"image_name": "004.png"},
} }
for integration, fields in FIXTURELESS_SCREENSHOT_CONFIG_OPTIONAL_FIELDS.items(): for integration, fields in FIXTURELESS_SCREENSHOT_CONFIG_OPTIONAL_FIELDS.items():

View File

@@ -1,3 +1,4 @@
from datetime import datetime, timezone
from typing import TypedDict from typing import TypedDict
# For integrations that don't have example webhook fixtures/payloads, # For integrations that don't have example webhook fixtures/payloads,
@@ -34,6 +35,10 @@ COMMIT_HASH_A = "a2e84e86ddf7e7f8a9b0c1d2e3f4a5b6c7d8e9f0"
COMMIT_HASH_B = "9fceb02c0c4b8e4c1e7b43hd4e5f6a7b8c9d0e1f" COMMIT_HASH_B = "9fceb02c0c4b8e4c1e7b43hd4e5f6a7b8c9d0e1f"
DEPLOYMENT_HASH = "e494a5be3393" 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): class ScreenshotContent(TypedDict):
topic: str 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( MERCURIAL = ScreenshotContent(
topic=BRANCH_MERCURIAL, topic=BRANCH_MERCURIAL,
content=f"""**{BO_NAME}** pushed [2 commits]() to **{BRANCH_MERCURIAL}** (`{REVISION_NUMBER}:{DEPLOYMENT_HASH[:12]}`): content=f"""**{BO_NAME}** pushed [2 commits]() to **{BRANCH_MERCURIAL}** (`{REVISION_NUMBER}:{DEPLOYMENT_HASH[:12]}`):