Skip to content

Conversation

@andreynering
Copy link
Member

@andreynering andreynering commented Nov 22, 2025

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:

  • Add failfast: true to your .taskrc.yml.
  • Add failfast: true to a specific task.
  • Use the --failfast flag.
  • The --failfast flag will also be considering when using --parallel.

@andreynering andreynering self-assigned this Nov 22, 2025
@andreynering andreynering added the area: dependencies Changes related to dependency files. label Nov 22, 2025
@andreynering andreynering changed the title feat: add --failfast and failtest: true to control dependencies feat: add --failfast and failfast: true to control dependencies Nov 22, 2025
Copy link
Member

@vmaerten vmaerten left a 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:

image

In my opinion, there are a few possible ways to address this:

  • Enforce failfast only through .taskrc for 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.

@rabbitlair
Copy link

It's working for me as expected, thanks a lot!

My Taskfile.yml:

version: '3'

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
image

@andreynering
Copy link
Member Author

@vmaerten Thank you for your review!

I ended up removing fastfast as a global option in the Taskfile and added it to .taskrc.yml. Thank you for this suggestion, I think it indeed makes sense.

Copy link
Member

@vmaerten vmaerten left a 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 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: dependencies Changes related to dependency files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When a parallel task fails allow the other parallel tasks to finish before exiting with failure

4 participants