argoproj-labs / hera

Hera makes Python code easy to orchestrate on Argo Workflows through native Python integrations. It lets you construct and submit your Workflows entirely in Python. ⭐️ Remember to star!
https://hera.rtfd.io
Apache License 2.0
564 stars 105 forks source link

Configurable rshift operator behaviour #726

Open elliotgunton opened 1 year ago

elliotgunton commented 1 year ago

Is your feature request related to a problem? Please describe. The depends shorthand using the rshift operator >> uses the "enhanced depends logic" from https://argoproj.github.io/argo-workflows/enhanced-depends-logic/#depends. i.e. task >> other_task is equivalent to task.Succeeded || task.Skipped || task.Daemoned. We've found skipping tasks to be a common pattern, but as the default depends behaviour includes skipped tasks, you then have to also specify when clauses, or only use the on_success function, forgoing the helpful >> syntactic sugar.

Describe the solution you'd like A configurable behaviour for the >> operator. Sensible options would be the current default or only on success. This option could be part of the global_config e.g. global_config.default_task_depends taking an enum value.

Describe alternatives you've considered Adding when clauses to all tasks after the skipped tasks or only using on_success. Not the cleanest solution.

Additional context None

dejamiko commented 1 year ago

What possible configurations can we have for this?

The naive option is I guess allowing 7 different configurations of task.Succeeded || task.Skipped || task.Daemoned but that seems excessive. Would we have one with skipped and one without?