Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] Refactor of build cache plugin API to better align with other plugins #5002

Open
dmichon-msft opened this issue Nov 13, 2024 · 0 comments

Comments

@dmichon-msft
Copy link
Contributor

dmichon-msft commented Nov 13, 2024

Summary

Instead of the current model of injecting factories for build cache operations, we should instead make build cache pack/unpack a first-class citizen in Rush with individual hooks for readBufferFromCacheAsync (an AsyncSeriesBailHook) and writeBufferToCacheAsync (an AsyncParallelHook).

Details

This would open up the following scenarios:

  1. Cache entry reads could be attempted from a series of caches, in order, and as soon as one returns a result it would be used
  2. Cache entry writes could be performed to multiple caches
  3. Build cache plugins could leverage beforeExecuteOperations to perform any required authentication to the cache. Additionally, with build cache entry ids being a first-class feature, we could provide the id as an (optional) property on the IOperationExecutionRecord object, so that plugins could aggressively start fetching cache entries before they are asked to.
  4. Build cache plugins would have the flexibility to not block the underlying operation on the cache write and instead wait for any outstanding cache writes during afterExecuteOperations.

For backwards compatibility we should have the existing factory model tap the new hooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs triage
Development

No branches or pull requests

1 participant