From daa3b3881195268a644bef6bc477c7e83c3aca88 Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Fri, 14 Mar 2025 09:30:58 +0100 Subject: [PATCH] Update signature of email notification steps --- gso/workflows/tasks/send_email_notifications.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gso/workflows/tasks/send_email_notifications.py b/gso/workflows/tasks/send_email_notifications.py index b2a9fe3c7..1d40e0201 100644 --- a/gso/workflows/tasks/send_email_notifications.py +++ b/gso/workflows/tasks/send_email_notifications.py @@ -34,11 +34,11 @@ def gather_failed_tasks() -> State: @step("Send notification email for failed tasks") -def send_email_notification(state: State) -> None: +def send_email_notification(failed_tasks: list[dict]) -> None: """Send out an email notification for all tasks that have failed.""" general_settings = load_oss_params().GENERAL all_alerts = "" - for failure in state["failed_tasks"]: + for failure in failed_tasks: failed_task_url = f"{general_settings.public_hostname}/workflows/{failure["process_id"]}" failed_subscription = get_subscription_by_process_id(failure["process_id"]) all_alerts = f"{all_alerts}------\n\n" @@ -63,11 +63,11 @@ def send_email_notification(state: State) -> None: @step("Send notification emails for failed prefix list tasks") -def send_prefix_list_email_notification(state: State) -> None: +def send_prefix_list_email_notification(failed_prefix_list_checks: list[dict]) -> None: """Send out an email notification for all prefix list validation tasks that have failed.""" general_settings = load_oss_params().GENERAL all_alerts = "" - for failure in state["failed_prefix_list_checks"]: + for failure in failed_prefix_list_checks: failed_task_url = f"{general_settings.public_hostname}/workflows/{failure["process_id"]}" failed_subscription = get_subscription_by_process_id(failure["process_id"]) all_alerts = f"{all_alerts}------\n\n" -- GitLab