Skip to content

Proposal: defer: availability at task level #2040

@hugo-ricateau

Description

@hugo-ricateau

Description

I have similar use-cases as reported in this feature request (running post-processing tasks at the very end of the overall workflow), but I would like to propose a different approach for handling such case; as it may have a slightly different purpose / implementation, I created a distinct report, but close it if it seems like a duplicate.

The proposal would be to add support for the defer: keyword at task level, with the exact same behaviour as for commands; defining a symmetric to the deps: feature. For instance,

version: 3

tasks:
  pre:
    internal: true
    run: once
    defer:
      - post
    cmds:
      - pre-cmd

  a:
    deps:
      - pre
    cmds:
      - a-cmd

  b:
    deps:
      - pre
    cmds:
      - b-cmd

  post:
    internal: true
    run: once
    cmds:
      - post-cmd

when invoked via task a b, would result in running pre then a then b and finally post.

For now, the proposed syntax has no effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions