-
Notifications
You must be signed in to change notification settings - Fork 609
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] feat(buildcache): improve access to operation build cache #5058
[rush] feat(buildcache): improve access to operation build cache #5058
Conversation
Signed-off-by: Aramis Sennyey <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, but using the wrong object to store the state.
libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Aramis Sennyey <[email protected]>
libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Aramis Sennyey <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
@dmichon-msft This should be ready for another round 🙇 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, just a couple of nits.
libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: David Michon <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
Summary
Work towards #3994. This adds a new method to
ProjectBuildCache
,forOperation
that generates a build cache accessor from an operation and a few additional classes, but aims to reduce the amount of boilerplate it takes to interact with the build cache.Details
stateHash
calculation toOperation
, and only sets after acalculate
method is called. I was trying to mirror this as best I could to what we had before, the big issue with moving it to, say, the constructor is we'd have to add more options to allow us to calculate it. This way, we calculate both an operation and its dependencies and can cache the hash result easily on each operation itself.forOperation
onProjectBuildCache
that should now be easier to call from rush-sdk code, assuming you've called thecalculateStateHash
method.How it was tested
I ran
rush build
a few times to make sure that caching isn't in place on changes and is in place when nothing has changed. Are there any more in depth checks I should do?Impacted documentation