vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.21k stars 1.81k forks source link

Feature: run task *only* from cache #4627

Closed tnorrisvnc closed 8 months ago

tnorrisvnc commented 1 year ago

Which project is this feature idea for?

Turborepo

Describe the feature you'd like to request

My CI pipeline writes some metadata files, including the build number, when deploying a package. These metadata files are cached as outputs of a "deploy" task in turborepo.

When a subsequent pipeline runs, I'd like to be able to do an up-front check: (1) check if the current code needs to be published (ie., is not cached) (2) pull down, open and print information from the cached metadata files, if any

But I don't want this step of the build to actually run the "deploy" task in case of a cache miss.

Describe the solution you'd like

Something like a --cached-only flag that either skips uncached tasks or errors out when one is found.

Describe alternatives you've considered

mehulkar commented 1 year ago

I'm not opposed to this as a feature, it seems like a good win to me. I'd be interested in ironing out an API that can pick and choose any combination of caches (fs or remote) and execution (real or dry).