#973 ForEach over an empty list runs the loop-body task once outside the loop with an empty {{item}}
Description
EditEARS: If a ForEach operator resolves zero items, then the Highway engine shall execute zero loop-body tasks and continue with the foreach's dependents.
EVIDENCE (#961, API, tenant test): items='[]' literal -> run efc46a9e completed with steps start, foreach_empty, process_item, after; process_item stdout 'ITEM' (item empty). Same with items from a variable ([] from tools.code.exec): run f7bdbabe / 186a5767. foreach_empty result [] (zero iterations), then process_item (is_internal_loop_task=true, dependencies [foreach_empty]) is scheduled by the inline executor as a top-level task. While with a false condition does NOT have the defect (while_zero_iterations 3cdf8e19 passes). Demo matrix test empty_foreach (scripts/demo/demo_matrix) is the reproduction; the old matrix only checked status and hid it.
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...