forked from keephq/keep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related to keephq#1885 Update workflow parsing to use `id` as id and `name` as name, generate different UUID if `id` is not provided, and add validation for configuration errors. * **keep/parser/parser.py** - Update `_get_workflow_id` to use `workflow.get("id")` for id and `workflow.get("name")` for name. - Add logic to generate a different UUID if `workflow.get("id")` is not provided. - Update `_parse_workflow` to use `workflow.get("name")` for name. * **keep/api/models/db/workflow.py** - Add a new field `invalid` to mark workflows with configuration errors. - Update the `Workflow` class to include the `invalid` field. * **keep/api/routes/workflows.py** - Update `create_workflow` and `create_workflow_from_body` to generate a different UUID if `workflow.get("id")` is not provided. - Add validation logic to mark workflows with configuration errors as `invalid`. * **tests/test_parser.py** - Add test cases to verify that a different UUID is generated if `workflow.get("id")` is not provided. - Add test cases to verify that workflows with configuration errors are marked as `invalid`.
- Loading branch information
1 parent
9e860e8
commit d30310c
Showing
4 changed files
with
52 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters