From cb2295529236355927c0bcdc4890ec3c969d217c Mon Sep 17 00:00:00 2001 From: David Crossley Date: Wed, 4 Nov 2026 16:44:32 +1100 Subject: [PATCH] Ensure no duplicates matchers-summary DEVOPS-8235 --- .../workflows/scripts/schedule_deployments.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/schedule_deployments.py b/.github/workflows/scripts/schedule_deployments.py index d85dfad..f3a008c 100755 --- a/.github/workflows/scripts/schedule_deployments.py +++ b/.github/workflows/scripts/schedule_deployments.py @@ -28,7 +28,7 @@ from jinja2 import Environment, FileSystemLoader -SCRIPT_VERSION = "1.9.0" +SCRIPT_VERSION = "1.9.1" LOGLEVELS = { "debug": logging.DEBUG, @@ -116,6 +116,20 @@ def load_matchers_summary(): msg = f"Trouble loading '{input_fn}' JSON file: {err.lineno} {err.msg}" LOGGER.critical(msg) sys.exit(1) + matcher_names = {} + duplicates = [] + for matcher in summary: + matcher_name = matcher["name"] + try: + matcher_names[matcher_name] + except KeyError: + matcher_names[matcher_name] = True + else: + duplicates.append(matcher_name) + if duplicates: + msg = f"Duplicate entries in {input_fn} file: {', '.join(duplicates)}" + LOGGER.critical(msg) + sys.exit(1) return summary