Add ability to show which projects would hit cache #23419
Closed
rlmestre
started this conversation in
Feature Requests
Replies: 3 comments
-
+1 on this. I'd love to skip some code-generation tasks in CI if I know ahead of time that all tasks will hit the cache. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The reality is that there is no way to predetermine this. Nx waits until the last minute, right before running the task, to determine if it can reuse the cache. This is tasks can depend on the outputs of other tasks which would be run before it. So without running tasks, we don't know for certain if something is able to pull from cache. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
When using
nx run-many
or similar commands, there's no way to predetermine which runs would be retrieved from the cache and which ones wouldn't without running them.Motivation
Similar to why
nx show projects --affected
(previouslynx print-affected --select=projects
) exists: knowing which outputs need recomputation in advance may be useful for control flow or other reasons.I've thought about this to avoid stalling git hooks for reasons that aren't git-related. We have a pre-push hook that checks if linting passes for affected projects. When many projects need recomputation it takes a while which, even though engineers are aware of why it does, it's not ideal.
Checking if the targets are in the cache would let us short-circuit the process. We can have the git hook only check if all runs are in the cache and otherwise fail so the developer runs the process separately and have the cache rebuilt.
Suggested Implementation
A flag for
nx show
similar to-affected
would probably be ideal:nx show projects --cached --target=test
Alternate Implementations
None
Related
#6681 (closed as stale)
Beta Was this translation helpful? Give feedback.
All reactions