From 79ef28b3c57e16ae0ef161bf6d0990dd86d8ea2d Mon Sep 17 00:00:00 2001 From: DonHaul Date: Thu, 19 Dec 2024 15:23:14 +0100 Subject: [PATCH] workflows: fail properly for author wfs * ref: cern-sis/issues-inspire/issues/643 --- workflows/dags/author/author_create/author_create_approved.py | 3 ++- workflows/dags/author/author_create/author_create_rejected.py | 2 +- workflows/dags/author/author_update/author_update.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/workflows/dags/author/author_create/author_create_approved.py b/workflows/dags/author/author_create/author_create_approved.py index f7c785dbe..940ee2ca3 100644 --- a/workflows/dags/author/author_create/author_create_approved.py +++ b/workflows/dags/author/author_create/author_create_approved.py @@ -29,12 +29,13 @@ "workflow_id": Param(type="string", default=""), "data": Param(type="object", default={}), "create_ticket": Param(type="boolean", default=False), + "collection": Param(type="string", default=AUTHORS), }, start_date=datetime.datetime(2024, 5, 5), schedule=None, catchup=False, on_failure_callback=set_workflow_status_to_error, # TODO: what if callback fails? Data in backoffice not up to date! - tags=["authors"], + tags=[AUTHORS], ) def author_create_approved_dag(): """Defines the DAG for the author creation workflow after curator's approval. diff --git a/workflows/dags/author/author_create/author_create_rejected.py b/workflows/dags/author/author_create/author_create_rejected.py index 230de5881..1938e1c9c 100644 --- a/workflows/dags/author/author_create/author_create_rejected.py +++ b/workflows/dags/author/author_create/author_create_rejected.py @@ -21,7 +21,7 @@ catchup=False, # TODO: what if callback fails? Data in backoffice not up to date! on_failure_callback=set_workflow_status_to_error, - tags=["authors"], + tags=[AUTHORS], ) def author_create_rejected_dag() -> None: """ diff --git a/workflows/dags/author/author_update/author_update.py b/workflows/dags/author/author_update/author_update.py index 533db494f..e2b6dcc22 100644 --- a/workflows/dags/author/author_update/author_update.py +++ b/workflows/dags/author/author_update/author_update.py @@ -25,10 +25,11 @@ params={ "workflow_id": Param(type="string", default=""), "data": Param(type="object", default={}), + "collection": Param(type="string", default=AUTHORS), }, catchup=False, on_failure_callback=set_workflow_status_to_error, # TODO: what if callback fails? Data in backoffice not up to date! - tags=["authors"], + tags=[AUTHORS], ) def author_update_dag(): """