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

[stacked] Struct API and bullet stream for Bundle install layer #332

Merged

Conversation

schneems
Copy link
Contributor

@schneems schneems commented Oct 4, 2024

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.

@schneems schneems changed the title Struct API and bullet stream for Bundle install layer [stacked] Struct API and bullet stream for Bundle install layer Oct 4, 2024
@schneems schneems marked this pull request as ready for review October 4, 2024 15:58
@schneems schneems requested a review from a team as a code owner October 4, 2024 15:58
@schneems schneems merged commit a05fb5c into schneems/refactor-bundler Oct 7, 2024
7 of 8 checks passed
@schneems schneems deleted the schneems/refactor-bundle-install-layer-v2 branch October 7, 2024 21:35
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants