-
-
Notifications
You must be signed in to change notification settings - Fork 763
feat: add --failfast and failfast: true to control dependencies
#2525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
b4e50e0 to
734fdba
Compare
--failfast and failtest: true to control dependencies--failfast and failfast: true to control dependencies
vmaerten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we're merging all our Taskfiles into a single one, we've run into unexpected behavior with the following setup:
Main Taskfile:
version: '3'
failfast: true
includes:
other: Taskfile2.yaml
tasks:
default:
deps:
- dep1
- dep2
- dep3
- dep4
dep1: sleep 1 && echo 'dep1'
dep2: sleep 2 && echo 'dep2'
dep3: sleep 3 && echo 'dep3'
dep4: exit 1
Included Taskfile:
version: '3'
failfast: false
tasks:
default:
deps:
- dep1
- dep2
- dep3
- dep4
dep1: sleep 1 && echo 'dep1'
dep2: sleep 2 && echo 'dep2'
dep3: sleep 3 && echo 'dep3'
dep4: exit 1
When running task, I expect failfast to be enabled, but when running task other:default, I expect failfast to be disabled. Currently, this doesn’t happen:
In my opinion, there are a few possible ways to address this:
- Enforce failfast only through
.taskrcfor the global one, but keep the failfast for a local task - Disallow failfast within included Taskfiles (similar to how dotenv works).
- Document the current behavior more clearly.
734fdba to
eeb6686
Compare
|
@vmaerten Thank you for your review! I ended up removing |
vmaerten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update the completion scripts to include this new flag?
Bash already supports it (because it parses the help), but Zsh and Fish don’t yet.
Otherwise it looks good ! Pretty exciting 🔥

This PR introduces a small behavior change on how dependencies work. Task will now wait for all dependencies to finish running by default, even when any of them fail.
To opt for the previous behavior, either:
failfast: trueto your.taskrc.yml.failfast: trueto a specific task.--failfastflag.--failfastflag will also be considering when using--parallel.