How to properly handle lock file diffs in CI? #1866
-
I have a monorepo with Yarn and Cargo (both using workspaces). I'm using Dependabot to update dependencies, and sometimes only the lock file changes. However, my CI, configured as shown below, does not trigger in such cases. Would it be correct to add Is it possible to configure moon so that it triggers only when a project's dependencies changes, and if so, how? fileGroups:
sources:
- 'src/**/*'
- 'Cargo.toml'
tasks:
build:
command: 'cargo build --release'
inputs:
- '@globs(sources)'
outputs:
- '/target/release/app' btw, Thanks for your work — really awesome project! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@akostylev0 So this should work this way already. When generating the task hash, we parse the package.json/Cargo.toml/lockfiles and extract package/version information and include it in the hash. So updating a dependency should bust the task cache. If you can verify that's not working, I can dig into it. |
Beta Was this translation helpful? Give feedback.
Sorry you are correct, I misread the post. I was thinking about this at the task caching level, and not the CI affected level.
Right now affected checks are based on input files/env vars, and nothing else. Once we finish the plugin migration, it'll open up more pathways for features like this.
As a temporary solution, you could use
implicitInputs
in.moon/tasks/node.yml
: https://moonrepo.dev/docs/config/tasks#implicitinputs But this would mark all node tasks as affected, and not just those with changed deps.