Incremental / partial caching #2274
yacinehmito
started this conversation in
Ideas
Replies: 1 comment
-
|
@yacinehmito What does your setup look like? We don't do anything with files like tsbuildinfo/.eslintcache/etc, so I'm curious how moon is involved here. Those should persist between runs and different hashes. The only time files are removed, is if they are defined as |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! 👋
I'd to start a conversation about incremental / partial caching and whether it's something the project has considered.
The problem
Moon uses task-level caching that's all-or-nothing: either the input hash matches exactly (cache hit) or you rebuild from scratch (cache miss). This works well for small packages, but becomes painful when working with large packages.
Example: I have a package with 500 test files. If I change one file, I have to re-run all 500 tests because the task hash changed. The current workaround is using VCS integration to identify affected tests (moon run --affected). It works OK in CI, but locally this requires being disciplined with one's git workflow. I'd rather have something more robust that works regardless of how git is used.
Many tools support their own incremental caching at the file level:
The problem is that moon's task-level caching can't leverage these. On a cache miss, these incremental artifacts aren't restored, so tools start from scratch.
What I'd like
The ability to cache and restore task outputs at a finer granularity, so that changing one file in a large package doesn't invalidate the entire task cache. Tool-level incremental caches (like tsBuildInfo, .eslintcache, or test result caches) can be preserved and reused across runs
Questions
I understand this would be a significant change to how caching works. Curious to hear your thoughts/
Beta Was this translation helpful? Give feedback.
All reactions