[rush] feat(buildcache): improve access to operation build cache#5058
Merged
dmichon-msft merged 11 commits intomicrosoft:mainfrom Jan 8, 2025
Merged
[rush] feat(buildcache): improve access to operation build cache#5058dmichon-msft merged 11 commits intomicrosoft:mainfrom
dmichon-msft merged 11 commits intomicrosoft:mainfrom
Conversation
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Contributor
dmichon-msft
left a comment
There was a problem hiding this comment.
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 <aramissennyeydd@users.noreply.github.com>
dmichon-msft
reviewed
Jan 3, 2025
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 <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Contributor
Author
|
@dmichon-msft This should be ready for another round 🙇 ! |
dmichon-msft
approved these changes
Jan 8, 2025
Contributor
dmichon-msft
left a comment
There was a problem hiding this comment.
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 <dmichon@microsoft.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
dmichon-msft
approved these changes
Jan 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Work towards #3994. This adds a new method to
ProjectBuildCache,forOperationthat 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
stateHashcalculation toOperation, and only sets after acalculatemethod 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.forOperationonProjectBuildCachethat should now be easier to call from rush-sdk code, assuming you've called thecalculateStateHashmethod.How it was tested
I ran
rush builda 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