-
Notifications
You must be signed in to change notification settings - Fork 8
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
[stacked] Struct API and bullet stream for Bundle install layer #332
Merged
schneems
merged 26 commits into
schneems/refactor-bundler
from
schneems/refactor-bundle-install-layer-v2
Oct 7, 2024
Merged
[stacked] Struct API and bullet stream for Bundle install layer #332
schneems
merged 26 commits into
schneems/refactor-bundler
from
schneems/refactor-bundle-install-layer-v2
Oct 7, 2024
Conversation
This file contains 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
Meta<M> acts like a String for purposes of printing, but can optionally contain old metadata if the programmer needs it. This is useful for the "bundle install" layer which stores information in it's cache that is not used for cache invalidation but rather to determine whether or not it can skip running `bundle install`.
This diff will eventually control caching logic
colincasey
approved these changes
Oct 7, 2024
schneems
added a commit
that referenced
this pull request
Oct 7, 2024
* Move struct doc to module doc * Rename metadata to Metadata * Implement TryMigrate for bundle_download_layer::Metadata * Implement MetadatDiff for bundler download layer * Extract layer logic to function * Refactor Command argument formatting * Replace layer trait with struct API * Update logging to bullet_stream * [stacked] Struct API and bullet stream for Bundle install layer (#332) * Introduce meta struct for holding layer ref results * Rename generic to match M for metadata style * Rename metadata generic * Use Meta<M> to return old cached data Meta<M> acts like a String for purposes of printing, but can optionally contain old metadata if the programmer needs it. This is useful for the "bundle install" layer which stores information in it's cache that is not used for cache invalidation but rather to determine whether or not it can skip running `bundle install`. * Rename structs * Move docs to module * Update docs * Move metadata type alias to top of file * Update const name and add docs * Add docs * Implement MetadataDiff This diff will eventually control caching logic * Test caching logic * Refactor bundle install command invocation * Group imports * Stub handle function with no logic * Build install state from old cache data * Rename UpdateState to InstallState * Call bundle install from handle function * Replace layer with struct API call * Rename function * Remove unused imports * Move buildpack logging to the top of main * Remove import * Move logic out of function * Replace commons logging with bullet stream * Clippy
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.
This layer is a bit different from the others. We need to pull out the old layer metadata to determine whether we want to skip
bundle install
.To accommodate that I changed the behavior of the shared layer logic to return a new struct
Meta
which can act as either a message for why cache data was cleared or the old metadata. I was able to make this refactor without needing to modify any other layer (other than tests).Commits are self-contained they should all compile.