diff --git a/orchestrator/workflows/alerts.py b/orchestrator/workflows/alerts.py index 436ebfa..9bd4784 100644 --- a/orchestrator/workflows/alerts.py +++ b/orchestrator/workflows/alerts.py @@ -67,7 +67,9 @@ class Alerts: # Call subworkflow "load_notification_package" passing the static filters # (level = "ERROR" and timestamp > last timestamp) - package = await workflow.execute_child_workflow('load_notification_package', input_data) + package = await workflow.execute_child_workflow( + 'subworkflow.load_notification_package', input_data + ) if not package['notification_package'] or not package['sending_configs']: return @@ -92,7 +94,7 @@ class Alerts: # Call subworkflow "process_notifications" passing the notification package log_report = await workflow.execute_child_workflow( - 'process_notifications', + 'subworkflow.process_notifications', { 'metadata': metadata, 'mail_type': mail_type, diff --git a/orchestrator/workflows/reports.py b/orchestrator/workflows/reports.py index 20be848..c4890d6 100644 --- a/orchestrator/workflows/reports.py +++ b/orchestrator/workflows/reports.py @@ -59,7 +59,9 @@ class Reports: # Call subworkflow "load_notification_package" passing the static filters # (timestamp > last timestamp) - package = await workflow.execute_child_workflow('load_notification_package', input_data) + package = await workflow.execute_child_workflow( + 'subworkflow.load_notification_package', input_data + ) if not package['notification_package'] or not package['sending_configs']: return @@ -83,7 +85,7 @@ class Reports: # Call subworkflow "process_notifications" passing the notification package await workflow.execute_child_workflow( - 'process_notifications', + 'subworkflow.process_notifications', { 'metadata': metadata, 'mail_type': mail_type, diff --git a/orchestrator/workflows/subworkflows/load_notification_package.py b/orchestrator/workflows/subworkflows/load_notification_package.py index f16592e..8b603f2 100644 --- a/orchestrator/workflows/subworkflows/load_notification_package.py +++ b/orchestrator/workflows/subworkflows/load_notification_package.py @@ -9,7 +9,7 @@ with workflow.unsafe.imports_passed_through(): from orchestrator.activities.activities import Activities -@workflow.defn(name='load_notification_package') +@workflow.defn(name='subworkflow.load_notification_package') class LoadNotificationPackage: """ Subworkflow for loading notification data and configuration. diff --git a/orchestrator/workflows/subworkflows/process_notifications.py b/orchestrator/workflows/subworkflows/process_notifications.py index 7e25641..c1fb6c4 100644 --- a/orchestrator/workflows/subworkflows/process_notifications.py +++ b/orchestrator/workflows/subworkflows/process_notifications.py @@ -10,7 +10,7 @@ with workflow.unsafe.imports_passed_through(): from orchestrator.activities.activities import Activities -@workflow.defn(name='process_notifications') +@workflow.defn(name='subworkflow.process_notifications') class ProcessNotifications: """ Subworkflow for processing and sending notification emails. diff --git a/tests/orchestrator/workflows/test_alerts.py b/tests/orchestrator/workflows/test_alerts.py index 766b80c..3ee8e91 100644 --- a/tests/orchestrator/workflows/test_alerts.py +++ b/tests/orchestrator/workflows/test_alerts.py @@ -31,7 +31,7 @@ async def test_run_full_flow(workflow_mock, alerts): workflow_mock.execute_child_workflow.assert_has_calls( [ call( - 'load_notification_package', + 'subworkflow.load_notification_package', {**input_data, 'metadata': metadata, 'base_data_filter': {'level': 'ERROR'}}, ) ] @@ -40,7 +40,7 @@ async def test_run_full_flow(workflow_mock, alerts): workflow_mock.execute_child_workflow.assert_has_calls( [ call( - 'process_notifications', + 'subworkflow.process_notifications', { 'metadata': metadata, 'mail_type': 'Alerts', @@ -104,7 +104,7 @@ async def test_run_no_data(workflow_mock, alerts): workflow_mock.execute_child_workflow.assert_has_calls( [ call( - 'load_notification_package', + 'subworkflow.load_notification_package', {**input_data, 'metadata': metadata, 'base_data_filter': {'level': 'ERROR'}}, ) ] diff --git a/tests/orchestrator/workflows/test_reports.py b/tests/orchestrator/workflows/test_reports.py index 732d44d..2e59c33 100644 --- a/tests/orchestrator/workflows/test_reports.py +++ b/tests/orchestrator/workflows/test_reports.py @@ -31,7 +31,7 @@ async def test_run_full_flow(workflow_mock, reports): workflow_mock.execute_child_workflow.assert_has_calls( [ call( - 'load_notification_package', + 'subworkflow.load_notification_package', {**input_data, 'metadata': metadata, 'base_data_filter': {}}, ) ] @@ -40,7 +40,7 @@ async def test_run_full_flow(workflow_mock, reports): workflow_mock.execute_child_workflow.assert_has_calls( [ call( - 'process_notifications', + 'subworkflow.process_notifications', { 'metadata': metadata, 'mail_type': 'Reports', @@ -88,7 +88,7 @@ async def test_run_no_data(workflow_mock, reports): workflow_mock.execute_child_workflow.assert_has_calls( [ call( - 'load_notification_package', + 'subworkflow.load_notification_package', {**input_data, 'metadata': metadata, 'base_data_filter': {}}, ) ]