Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task should fail if the status checks don't pass #1956

Open
alexec opened this issue Dec 13, 2024 · 2 comments
Open

Task should fail if the status checks don't pass #1956

alexec opened this issue Dec 13, 2024 · 2 comments

Comments

@alexec
Copy link

alexec commented Dec 13, 2024

Consider this synthetic task:

  download-ui-dependencies:
    cmds:
      - yarn
    status:
      - test -d node_modules

This task should only be successful if the status checks pass. I end up doing this:

  download-ui-dependencies:
    cmds:
      - yarn
      - test -d node_modules
    status:
      - test -d node_modules

Would it be good to run the status checks after the task runs so we fail fast?

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Dec 13, 2024
@trulede
Copy link

trulede commented Dec 15, 2024

@alexec don't you want preconditions?

Status is something slightly different, in-so-much that status means run or skip (so that a task only runs if status conditions are (not) satisfied.

@vmaerten vmaerten added type: question Further information is requested. and removed state: needs triage Waiting to be triaged by a maintainer. labels Dec 15, 2024
@vmaerten
Copy link
Member

@alexec , @trulede is right

status won't run the task if status conditions are not satified and it won't exit in error.

  download-ui-dependencies:
    cmds:
      - yarn
    status:
      - test -d node_modules

It'll run yarn if node_modules folder does not exist. If the folder exists, the task won't be ran

If you want to fail (IE: exit in error), you need to use preconditions :

  download-ui-dependencies:
    cmds:
      - yarn
    preconditions:
      - test -d node_modules

@pd93 pd93 removed the type: question Further information is requested. label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants