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 implementation uses the same interface for V2 and CNB. A top level Metadata object is a loose wrapper around a low level metadata store that responds to get/set/fetch.
I do need to figure out a migration strategy to migrate from existing heroku-buildpack-ruby metadata to this scheme, but that can come later.
As values are set on the metadata stores they're written to disk right away so we don't have to worry about remembering to write to disk when we're done.
A layer is currently represented as 3 things:
Currently, EnvProxy handles writing the env and the config. With the addition of this store, we've got a fairly comprehensive view for a layer. It's a little odd that the EnvProxy knows about config. I might want to change that in the future. But for now it's probably fine.
There are some possible safety concerns. I'm not sure what happens if we write to a
store.toml
that is not configured. (build/launch/cache). We might need to add some guard statements like how EnvProxy will validate a layer before letting you write an env var to it.I explicitly wanted a non-hash-like interface for this metadata so that it would be crystal clear that a custom object is being interacted with. Currently nothing in the codebase is using the metadata store , which is a bit odd for me. From a process perspective I usually only implement when I'm also using the interface. But I'm very satisfied with the current implementation.