ovh/utask

foreach with auto-dependency

rclsilver opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
When I'm using foreach, all steps are created without dependency and not sequentially.

Describe the solution you'd like
I would like to be able to create my steps sequentially, with a dependency created on the previous step.

...
variables:
  - name: my-groups
    value: '["group1", "group2"]'

steps:
  deploy-groups:
    (new)foreach: '{{ eval `my-groups` }}'
    description: Dummy
    action:
      type: echo
      configuration:
        output: '{{ .iterator }}'

This will create deploy-groups-0 and deploy-groups-1. I want that deploy-groups-0 is executed before deploy-groups-1 and that deploy-groups-1 is dependent of deploy-groups-0 (if deploy-groups-0 fails, deploy-groups-1 is not executed).

Describe alternatives you've considered
No alternative found.

Additional context
N/A

Interesting. The engine works that way to maximize throughput, but we could enforce a sequence by making the children depend on the previous one, as you described. I guess this could be controlled by an opt-in flag?
@rbeuque74