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

Modifications to enable libcnb to be compatible with both versions 0.5 and 0.6 of the API #54

Merged
merged 5 commits into from
Apr 20, 2021

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Apr 15, 2021

At the moment, the latest version of libcnb (1.20.0) breaks compatibility for buildpacks that are still on the 0.5 version of the API. This patch creates compatibility for both 0.5 and 0.6.

The use case for this change is upgrading buildpacks. On the Paketo team, we have quite a few buildpacks that are using libpak and libcnb. This abrupt change means we either have to hold back libcnb updates or we have to go through and update all of the buildpacks to use the new API. Having compatibility for both version 0.5 and 0.6 eases the transition as we can keep updating libcnb and migrate buildpacks to 0.6 at a more leisurely pace.

My suggestion would be to remove this 0.5 compatibility layer when we add support for the 0.7 (or whatever's next) API version. That way we're supporting the latest two API versions at any given moment, again helping buildpack authors to transition more easily.

@dmikusa dmikusa requested a review from a team as a code owner April 15, 2021 14:54
Copy link
Member

@sambhav sambhav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were some additional attributes added to launch.toml like the default flag for processes. Should we add a warning or throw an error if someone sets that with the v0.5 api?

layer.go Show resolved Hide resolved
internal/layer_api_5.go Show resolved Hide resolved
@dmikusa
Copy link
Contributor Author

dmikusa commented Apr 19, 2021

There were some additional attributes added to launch.toml like the default flag for processes. Should we add a warning or throw an error if someone sets that with the v0.5 API?

I added logger.Info("WARNING: Launch layer is setting default=true, but that is not supported until API version 0.6. This setting will be ignored.") to run if any processes are set with Default=true. This check happens when it writes the launch.toml file.

build.go Outdated Show resolved Hide resolved
build_test.go Outdated Show resolved Hide resolved
@ekcasey ekcasey added semver:minor A change requiring a minor version bump type:enhancement A general enhancement labels Apr 20, 2021
Daniel Mikusa and others added 5 commits April 20, 2021 15:14
…5 and 0.6 of the API

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
Co-authored-by: Emily Casey <emilykimballcasey@gmail.com>
Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
@ekcasey ekcasey merged commit 902eaf0 into buildpacks:main Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants