diff --git a/docker-compose.yaml b/docker-compose.yaml index d257efc5..078082ae 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -61,7 +61,7 @@ x-airflow-common: &airflow-common AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: "true" AIRFLOW__CORE__LOAD_EXAMPLES: "false" AIRFLOW__API__AUTH_BACKENDS: "airflow.api.auth.backend.basic_auth,airflow.api.auth.backend.session" - # AIRFLOW__WEBSERVER__RELOAD_ON_PLUGIN_CHANGE: "true" # used when modifying plugins + AIRFLOW__WEBSERVER__RELOAD_ON_PLUGIN_CHANGE: "true" # used when modifying plugins # yamllint disable rule:line-length # Use simple http server on scheduler for health checks # See https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/check-health.html#scheduler-health-check-server diff --git a/workflows/dags/author/author_create/author_create_approved.py b/workflows/dags/author/author_create/author_create_approved.py index cbb54f33..90dfc32c 100644 --- a/workflows/dags/author/author_create/author_create_approved.py +++ b/workflows/dags/author/author_create/author_create_approved.py @@ -57,7 +57,7 @@ def set_workflow_status_to_running(**context): workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) @task.branch() @@ -134,7 +134,7 @@ def set_author_create_workflow_status_to_completed(**context: dict) -> None: workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) @task @@ -150,7 +150,7 @@ def set_author_create_workflow_status_to_error(**context: dict) -> None: workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) # task definitions diff --git a/workflows/dags/author/author_create/author_create_init.py b/workflows/dags/author/author_create/author_create_init.py index 33ef4a39..9fbfb207 100644 --- a/workflows/dags/author/author_create/author_create_init.py +++ b/workflows/dags/author/author_create/author_create_init.py @@ -45,7 +45,7 @@ def set_workflow_status_to_running(**context): workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) @task() @@ -54,7 +54,7 @@ def set_schema(**context): workflow_management_hook.partial_update_workflow( workflow_id=context["params"]["workflow_id"], workflow_partial_update_data={"data": {"$schema": schema}}, - typ=AUTHORS, + collection=AUTHORS, ) @task() @@ -85,7 +85,7 @@ def set_author_create_workflow_status_to_approval(**context: dict) -> None: workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) # task dependencies diff --git a/workflows/dags/author/author_create/author_create_rejected.py b/workflows/dags/author/author_create/author_create_rejected.py index 322ed551..9751856e 100644 --- a/workflows/dags/author/author_create/author_create_rejected.py +++ b/workflows/dags/author/author_create/author_create_rejected.py @@ -51,7 +51,7 @@ def set_author_create_workflow_status_to_completed(**context: dict) -> None: workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) @task() @@ -60,7 +60,7 @@ def set_workflow_status_to_running(**context): workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) # task definitions diff --git a/workflows/dags/author/author_update/author_update.py b/workflows/dags/author/author_update/author_update.py index 2b3275e9..9776ce31 100644 --- a/workflows/dags/author/author_update/author_update.py +++ b/workflows/dags/author/author_update/author_update.py @@ -48,7 +48,7 @@ def set_author_update_workflow_status_to_running(**context): workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) @task() @@ -96,7 +96,7 @@ def set_author_update_workflow_status_to_completed(**context): workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) @task.branch(provide_context=True) @@ -116,7 +116,7 @@ def set_author_update_workflow_status_to_error(**context): workflow_management_hook.set_workflow_status( status_name=status_name, workflow_id=context["params"]["workflow_id"], - typ=AUTHORS, + collection=AUTHORS, ) # task definitions diff --git a/workflows/plugins/hooks/backoffice/workflow_management_hook.py b/workflows/plugins/hooks/backoffice/workflow_management_hook.py index a0fcdfa0..7df0c720 100644 --- a/workflows/plugins/hooks/backoffice/workflow_management_hook.py +++ b/workflows/plugins/hooks/backoffice/workflow_management_hook.py @@ -17,7 +17,7 @@ class WorkflowManagementHook(BackofficeHook): """ def set_workflow_status( - self, status_name: str, workflow_id: str, typ: str + self, status_name: str, workflow_id: str, collection: str ) -> Response: """ Updates the status of a workflow in the backoffice system. @@ -32,7 +32,9 @@ def set_workflow_status( "status": status_name, } return self.partial_update_workflow( - workflow_partial_update_data=request_data, workflow_id=workflow_id, typ=typ + workflow_partial_update_data=request_data, + workflow_id=workflow_id, + collection=collection, ) def get_workflow(self, workflow_id: str) -> dict: @@ -53,9 +55,9 @@ def update_workflow(self, workflow_id: str, workflow_data: dict) -> Response: ) def partial_update_workflow( - self, workflow_id: str, workflow_partial_update_data: dict, typ: str + self, workflow_id: str, workflow_partial_update_data: dict, collection: str ) -> Response: - endpoint = f"api/workflows/{typ}/{workflow_id}/" + endpoint = f"api/workflows/{collection}/{workflow_id}/" return self.run_with_advanced_retry( _retry_args=self.tenacity_retry_kwargs, method="PATCH", diff --git a/workflows/plugins/include/utils/set_workflow_status.py b/workflows/plugins/include/utils/set_workflow_status.py index ae7f4e57..31a7c73b 100644 --- a/workflows/plugins/include/utils/set_workflow_status.py +++ b/workflows/plugins/include/utils/set_workflow_status.py @@ -37,7 +37,9 @@ def set_workflow_status_to_error(context: dict) -> None: """ logger.info("Setting workflow status to error") response = WorkflowManagementHook().set_workflow_status( - status_name="error", workflow_id=context["params"]["workflow_id"], typ=AUTHORS + status_name="error", + workflow_id=context["params"]["workflow_id"], + collection=AUTHORS, ) try: response.raise_for_status()