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

Add ability to skip tasks,if checksum for this traks was not changed #32

Open
danylkaaa opened this issue Mar 4, 2020 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@danylkaaa
Copy link

Sometimes I want to skip execution of some tasks, if command's checksum from last run is not changed.
Example: before each npm run smth I want to run npm i. But if package.json and package.lock is not changed, I do not need to run npm i

So, in lets.yaml I want to past smth like this and as a result, omit running task

New lets.yaml

install_deps:
  checksum:
    deps: &deps
      - package.json    
      - package-lock.json
  only:
    checksum:
      <<: *deps
  cmd: npm i

run-smth:
  depends: [install_deps]
  cmd: npm run smth

As you can see, in lets.yaml I added in cmd install_deps property only. It will allow to execute install_deps.cmd only if checksum for this cmd changed.

So, what we need to implement:

  • Persistant saving of checksums into file
  • Reading saved checksum for command
  • Updating of after cmd successful execution
  • Skip command invocation, if new and saved checksum are equal
@danylkaaa
Copy link
Author

Later we can add some other rules for only property in cmd, like Git branch name and etc ( analogy to gitlab-ci only)

@kindermax
Copy link
Collaborator

I think we have to implement checksum persistent first (probably in a separate issue) and then implement only functionality

@danylkaaa
Copy link
Author

Makes sense

@kindermax
Copy link
Collaborator

Another use case. When using depends, sometimes we want to skip some of the commands in it.

There are a couple of ways to do that.

  1. Persistent - store settings in .lets (not implenented)
  2. Dynamic - for example lets -E PULL=false run
    If commands have if or only directive, we can check PULL in it and skip the command (not implemented)

@kindermax kindermax added the enhancement New feature or request label Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants