Skip to content

Task is running when there is no checksum stored, but status command returns 0 #2251

@maciej-lech

Description

@maciej-lech

Description

According to the docs for status schema reference:

A list of commands to check if this task should run. The task is skipped otherwise. This overrides method, sources and generates.

"This overrides method, sources and generates." indicates that source has more power over checksum/timestamp local state which make sense as it would handle the situation that you would like to check the state on a remote machine. (see example Taskfile)

Now, if the .task/checksum/buid is missing it executes the task always, despite the return code which doesn't make any sense and it is not what the documentation says.

Version

3.43.2

Operating system

Linux

Experiments Enabled

Env Precedence

Example Taskfile

---
version: "3"

tasks:
  build:
    vars:
      TAG_PREFIX: myimage:1.0.0
    sources:
      - ./docker/**/*
    cmds:
      - docker build -t {{.TAG_PREFIX}}-{{substr 0 9 .CHECKSUM}} ./docker
      - docker push {{.TAG_PREFIX}}-{{substr 0 9 .CHECKSUM}}
    status:
      - docker manifest inspect {{.TAG_PREFIX}}-{{substr 0 9 .CHECKSUM}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions