Optional remote includes fail in offline mode when not cached · Issue #3076 · go-task/task · GitHub
Skip to content

Optional remote includes fail in offline mode when not cached #3076

Open

Description

@anttikivimaki-61n

Description

Task does not respect the optional: true property for remote Taskfile includes when running in --offline mode and the remote Taskfile is not available in the local cache.

Instead of skipping the optional include, Task fails while resolving it, even when the requested task is defined locally and does not depend on any remote tasks.

Steps to reproduce

Create the following Taskfile.yml:

version: "3"

includes:
  remote:
    taskfile: https://github.com/go-task/task.git//Taskfile.yml
    optional: true

tasks:
  local:
    cmd: echo "Hello from local"

Run the local task with offline mode enabled, using an empty cache:

task --offline --remote-cache-dir "$(mktemp -d)" local

Actual behavior

Task fails before executing the local task:

task: Taskfile "https://github.com/go-task/task.git//Taskfile.yml" was not found in the cache. Remove the --offline flag to use a remote copy or download it using the --download flag

Expected behavior

Task should skip the optional remote include when it is not available in the cache and continue executing the local task.

Expected output:

task: [local] echo "Hello from local"
Hello from local

Version

3.54.0

Operating system

MacOS 27

Experiments Enabled

No

Example Taskfile

version: "3"

includes:
  remote:
    taskfile: https://github.com/go-task/task.git//Taskfile.yml
    optional: true

tasks:
  local:
    cmd: echo "Hello from local"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions