From 23a8e2674138f0b4b0a9b18e59155b3388d95c94 Mon Sep 17 00:00:00 2001 From: Niloth P <20315308+Niloth-p@users.noreply.github.com> Date: Tue, 22 Jul 2025 04:43:20 +0530 Subject: [PATCH] integrations: Load optional fields for fixtureless screenshot configs. The hardcoded content (topic and message) for the screenshot configs are loaded from `fixtureless_integrations.py`. Add a new FIXTURELESS_SCREENSHOT_CONFIG_OPTIONAL_FIELDS dict to maintain the optional fields of fixtureless screenshot configs, and load both into FIXTURELESS_SCREENSHOT_CONFIG. This commit does not set any screenshot configs, but only adds the framework. --- zerver/lib/integrations.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.py index d52fb7248d..c323d407a6 100644 --- a/zerver/lib/integrations.py +++ b/zerver/lib/integrations.py @@ -862,6 +862,14 @@ for integration, screenshots_contents in FIXTURELESS_SCREENSHOT_CONTENT.items(): for screenshot_content in screenshots_contents ] +FIXTURELESS_SCREENSHOT_CONFIG_OPTIONAL_FIELDS = {} + +for integration, fields in FIXTURELESS_SCREENSHOT_CONFIG_OPTIONAL_FIELDS.items(): + assert integration in FIXTURELESS_SCREENSHOT_CONFIG + for field_name, value in fields.items(): + # Assume a single screenshot config for each integration + setattr(FIXTURELESS_SCREENSHOT_CONFIG[integration][0], field_name, value) + DOC_SCREENSHOT_CONFIG: dict[ str, list[WebhookScreenshotConfig] | list[FixturelessScreenshotConfig] ] = {