[Bug] Compiling a flow from parallel tasks to a single child fails
pipoe2h opened this issue · comments
Describe the bug
There is a workflow with a task that depends on two previous tasks running in parallel to complete. This is possible to model in the UI and when using decompile this is the output
@action
def __install__():
with parallel() as p0:
with branch(p0):
CalmTask.Delay(name="Task 1", delay_seconds=1, target=ref(Service1))
CalmTask.Delay(name="Task 3", delay_seconds=1, target=ref(Service1))
with branch(p0):
CalmTask.Delay(name="Task 2", delay_seconds=1, target=ref(Service1))
CalmTask.Delay(name="Task 3", delay_seconds=1, target=ref(Service1))
If you try to build a BP from scratch with DSL using this structure, or if you use the decompiled one and push it back AS-IS with create, it fails:
calm create bp -f delete/blueprint.py -n decompiled_dsl_create_parallel_to_single -fc
/usr/local/lib/python3.11/site-packages/requests/__init__.py:102: RequestsDependencyWarning: urllib3 (1.26.18) or chardet (5.2.0)/charset_normalizer (2.0.12) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported "
[2024-02-14 10:57:02] [ERROR] [calm.dsl.api.connection:324] Oops! Something went wrong.
{
"error": {
"api_version": "3.1",
"code": 422,
"kind": "blueprint",
"message_list": [
{
"details": {},
"message": "Duplicate task name Task 3",
"reason": "INVALID_REQUEST"
}
],
"state": "ERROR"
},
"code": 422
}
[2024-02-14 10:57:02] [ERROR] [calm.dsl.cli.bp_commands:218] {'api_version': '3.1', 'code': 422, 'kind': 'blueprint', 'message_list': [{'details': {}, 'message': 'Duplicate task name Task 3', 'reason': 'INVALID_REQUEST'}], 'state': 'ERROR'}
Branch/Container
master
To Reproduce
Steps to reproduce the behavior:
- Upload attached BP
- Set credential password (dummy)
- DSL decompile
- DSL create the decompiled BP without modifying
Expected behavior
Be able to replicate the same workflows in the UI but with DSL
System Configuration:
- OS: Linux
- Python: 3.11
Additional context
Blueprint attached
dsl_create_parallel_to_single.json
Tracking under : https://jira.nutanix.com/browse/CALM-39413