Ultra runner --build feature doesn't work in CI environments when non tracked files are downloaded from cache
remorses opened this issue · 4 comments
I want to use ultra runner to have faster CI pipelines, only rebuilding changed packages
Ultra runner uses the ultra.cache.json
files to detect when something changed, to detect if a non tracked file changes it compares it with the last modified timestamp from the json file.
This doesn't work in the CI because downloading the cache will modify the last modified timestamp.
In my opinion we shouldn't check the last modified timestamp of non tracked files, we should only check that they exist.
We can do this removing the --directory
argument from the git ls-files
command and not doing the last modified time check.
Removing the --directory
argument from the ls-files produces output like this
+ artifacts/file.js
+ artifacts/file.d.ts
- artifacts/
normal_file.js
I can work on a PR if you agree
that would probably break a couple of cases.
The most obvious I can think of, would be if you update a package which changes node-modules.
If we only check that the file exists, a new build would not be triggered if the package update only changes existing files.
Unless I'm misunderstanding something here?
The following issue might also be relevant: #101 (comment)
Another solution would be to check if the artifacts last modified time is the same as the ultra.cache.json
file, this would mean that they have been downloaded together from CI cache and that the artifacts content is up to date with the last ultra run
This would be done only behind a flag obviously, what do you think? Can i open a PR for this?