Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

[BUG] cache doesnt work correctly for PRs #19

Closed
ronnetzer opened this issue Feb 9, 2022 · 0 comments · Fixed by #38
Closed

[BUG] cache doesnt work correctly for PRs #19

ronnetzer opened this issue Feb 9, 2022 · 0 comments · Fixed by #38
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@ronnetzer
Copy link
Member

ronnetzer commented Feb 9, 2022

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When using the actions in a PR, a cache key is created for the first commit in that PR, subsequent commits wont get cached.
Also cache is only requested once, for the entire runner and it contains the entire nx cache.

Expected behavior

cache key should include the hash of the task (the same hash that is used for the cache management in nx), which will invalidate the cache when the task or the deps have changed.
we should use nx's hasher in order to calculate the hash of a task, and the cache should be splitted to be per task, with the following structure nx-cache-{PLATFORM}-{LOCKFILE_HASH}-{TASK_HASH}-{PR_REF}
Instead of caching the entire nx cache directory once, we should cache each task separately, with its own cache key.

After this change we can expect to see the ReserveCacheError for the first run of the workflow because of duplicate tasks in different distributions

@ronnetzer ronnetzer added bug Something isn't working enhancement New feature or request labels Feb 9, 2022
@ronnetzer ronnetzer added this to the v2 milestone Feb 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant