Skip to content

v0.7: Feature/prefect workflow (#29)

Choose a tag to compare

@michaelsss1 michaelsss1 released this 02 Jul 14:43
· 54 commits to main since this release
f96436b
This pull request introduces several enhancements and refactoring to the
workflow engine and related modules, most notably centralizing condition
evaluation logic, extending ticket and email action capabilities, and
updating configuration for workflow execution and email delivery. The
changes improve maintainability, add new features, and prepare the
system for a Prefect-based execution model.

**Refactoring and Centralization:**

* Introduced a new shared module `condition_evaluator.py` that
centralizes all condition evaluation logic for workflow triggers and
steps, replacing duplicated logic in the local workflow engine. The
deprecated local engine now delegates condition evaluation to this
shared module to ensure consistency with the Prefect execution path.
[[1]](diffhunk://#diff-0116172ffdadb066991c9d94d2e8c049854e5e88765b6df859df088105670e8eR1-R176)
[[2]](diffhunk://#diff-99b4d788754f6ab5ce8c08e27222ab72d76f8b8e5229d53eb666e2f89d8cf806L19-R32)
[[3]](diffhunk://#diff-99b4d788754f6ab5ce8c08e27222ab72d76f8b8e5229d53eb666e2f89d8cf806L213-R230)

**Workflow Actions Enhancements:**

* Extended the `CreateTicketAction` to support additional fields such as
`event_category`, `current_assign_group`, `current_assign_owner`, and
`alert_message`, and improved variable resolution for ticket creation.
[[1]](diffhunk://#diff-1b10aa6b1dc18080e4f3083d7d0c73df8fc4af8d7ed17a612c1490487261674cR401-R406)
[[2]](diffhunk://#diff-1b10aa6b1dc18080e4f3083d7d0c73df8fc4af8d7ed17a612c1490487261674cL398-R438)
* Improved the email action to include more detailed logging and result
data, such as backend, host, port, and sender information, making
debugging and auditing easier.

**Configuration and Settings Updates:**

* Added Prefect workflow engine configuration to `settings.py`,
including API URL, deployment ID, and API key, supporting a transition
to Prefect for workflow execution.
* Updated email delivery defaults to use Feishu SMTP and a default
sender, and added a new rate limit for ticket playbook invocations.
[[1]](diffhunk://#diff-1682b7ad3d30d574d00f997ed7d8527b1bd8192ce8d0a70ba69be7a6f50cc478R179-L193)
[[2]](diffhunk://#diff-1682b7ad3d30d574d00f997ed7d8527b1bd8192ce8d0a70ba69be7a6f50cc478L222-R231)

**App Initialization Improvements:**

* Updated the `workflows` app configuration to use the explicit
`WorkflowsConfig` class in `INSTALLED_APPS` and improved signal import
handling for clarity and reliability.
[[1]](diffhunk://#diff-1682b7ad3d30d574d00f997ed7d8527b1bd8192ce8d0a70ba69be7a6f50cc478L56-R56)
[[2]](diffhunk://#diff-3108e351a5163700a6f7e10318cd3853f9e260c4b383cbd367659766afd5cef8L16-R17)

**Deprecation and Documentation:**

* Marked the local workflow engine as deprecated, with clear
documentation indicating that Prefect is now the preferred execution
path, and retained the file only for backward compatibility.
[[1]](diffhunk://#diff-99b4d788754f6ab5ce8c08e27222ab72d76f8b8e5229d53eb666e2f89d8cf806R4-R7)
[[2]](diffhunk://#diff-99b4d788754f6ab5ce8c08e27222ab72d76f8b8e5229d53eb666e2f89d8cf806L33-R42)