hera icon indicating copy to clipboard operation
hera copied to clipboard

Configurable rshift operator behaviour

Open elliotgunton opened this issue 2 years ago • 1 comments

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

elliotgunton avatar Jul 26 '23 13:07 elliotgunton

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?

dejamiko avatar Jul 26 '23 14:07 dejamiko