Propagate run:once errors to all dependents #2614
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Let's say we have this Gremlins-inspired Taskfile.yml
Just for context, Gremlins cannot be fed or bathed after midnight or they will become evil.
If it is after midnight and we run
task feed-gremlinsthe task fails. Same thing fortask bathe-gremlins. However, if we runtask bathe-gremlins feed-gremlins --parallelthen one of the tasks will run and the other will be skipped, and we end up with an evil Gremlin.Which one depends entirely on timing issues.
Change
This PR propagates not only the completion status of dependent tasks, but also the exit status of the tasks. That means that if task A has task B as a dependency, it will never run if task B failed (this is currently not the case).
I have taken the conservative route and added the new behavior behind a CLI flag, although I would personally define this as a bug given the fact that which task gets run and which doesn't is non-deterministic.