Skip to content

Imported task cannot call excluded task #2135

Open
@mkantzer

Description

@mkantzer

Description

For the given files:

Taskfile.yaml:

version: 3

includes:
  import:
    taskfile: import.yaml
    excludes:
      - excluded-task

tasks:
  test:
    cmds:
      - task: import:included-task

import.yaml

version: 3

tasks:
  imported-task:
    cmds:
      - echo "howdy"
      - task: excluded-task

  excluded-task:
    cmd: echo "bazz"

Running task test returns:

task: [import:imported-task] echo "howdy"
howdy
task: Failed to run task "test": task: Task "import:excluded-task" does not exist

but when the excludes block is commented out, it returns:

task: [import:imported-task] echo "howdy"
howdy
task: [import:excluded-task] echo "bazz"
bazz

I'd expect task test to return the second result in both cases. I'm using the exclude to prevent excluded-task from showing up in things like autocomplete and task --list-all, but the internal workings of an imported system shouldn't change based on that.

Version

3.41.0

Operating system

macOS

Experiments Enabled

No response

Example Taskfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: includesChanges related to included taskfiles.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions