Closed maheshsattala closed 2 months ago
This pull request introduces a new TASK_TYPE
enumeration and modifies various components across the codebase to incorporate this structured task categorization. Key changes include enhancements to the execute_task
methods in multiple executor classes, allowing them to accept a task_type
parameter. Additionally, logging mechanisms are improved to capture task execution details, and utility functions are updated to handle the new parameter. The changes aim to standardize how tasks are categorized and logged throughout the application.
Files | Change Summary |
---|---|
kairon/async_callback/processor.py |
Added import for TASK_TYPE and modified run_pyscript to include task_type in CloudUtility.trigger_lambda . |
kairon/events/executors/base.py , dramatiq.py , lamda.py , standalone.py |
Enhanced execute_task method to accept **kwargs , added log_task method in base.py for logging task execution details. |
kairon/events/scheduler/base.py , kscheduler.py |
Modified add_job and update_job methods to include task_type parameter. |
kairon/events/utility.py |
Updated add_job and update_job methods to pass task_type to KScheduler and ExecutorFactory . |
kairon/shared/actions/utils.py |
Added task_type parameter to CloudUtility.trigger_lambda calls in perform_web_search and run_pyscript . |
kairon/shared/cloud/utils.py |
Modified trigger_lambda to accept task_type and added log_task method for logging execution details. |
kairon/shared/data/constant.py |
Introduced new TASK_TYPE enumeration with constants for ACTION , EVENT , and CALLBACK . |
kairon/shared/events/data_objects.py |
Added ExecutorLogs class for logging task execution details, including task_type , event_class , and status . |
tests/unit_test/callback_test.py , cloud_utils_test.py , events/executors_test.py , events/scheduler_test.py |
Updated tests to reflect changes in method signatures and added new tests for logging functionality in CloudUtility . |
TASK_TYPE
enumeration.🐇 In the meadow where tasks play,
A new type hops in, hip-hip-hooray!
With logs that sing and types that cheer,
Each action clear, no room for fear.
So let us dance, both swift and spry,
For structured tasks now soar and fly! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Added code for executor logs and fixed respective test cases and added test cases for the same.
Summary by CodeRabbit
New Features
TASK_TYPE
enumeration for structured task categorization.Bug Fixes
Tests
task_type
parameter for better validation.