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

Add support for buildpack api 0.8 #131

Merged
merged 2 commits into from
Apr 11, 2022
Merged

Add support for buildpack api 0.8 #131

merged 2 commits into from
Apr 11, 2022

Conversation

samj1912
Copy link
Member

@samj1912 samj1912 commented Apr 4, 2022

Resolves #128

@samj1912 samj1912 added type:enhancement A general enhancement semver:minor A change requiring a minor version bump labels Apr 4, 2022
Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>
Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>
@samj1912 samj1912 marked this pull request as ready for review April 9, 2022 12:53
Copy link
Contributor

@dmikusa dmikusa left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I'm not 100% sure it's necessary, but my only observation is that in the detect & build tests, we're not testing the case where both args & env variables are set.

I believe that the code is going to take the env variables if both are set. It's an invalid state, so it would seem reasonable if we errored if both are set. I don't know if the platform/lifecycle would allow this (I didn't test), but my line of thinking is that it might be possible for a user to set one of these new env variables on an older platform/lifecycle since the older platform/lifecycle is unaware of them altering the behavior. In this particular case, erroring out would be beneficial.


ctx.Platform.Path = config.arguments[2]
logger.Debugf("Layers: %+v", ctx.Layers)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logger.Debugf("Layers: %+v", ctx.Layers)
logger.Debugf("Layers Directory: %+v", ctx.Layers)

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it okay if we keep it to the previous statement since that is what libcnb was logging before?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I thought that had changed in the diff. Yes, not a huge issue. Just thought that would be a little clearer.

@samj1912
Copy link
Member Author

Looks good to me.

I'm not 100% sure it's necessary, but my only observation is that in the detect & build tests, we're not testing the case where both args & env variables are set.

I believe that the code is going to take the env variables if both are set. It's an invalid state, so it would seem reasonable if we errored if both are set. I don't know if the platform/lifecycle would allow this (I didn't test), but my line of thinking is that it might be possible for a user to set one of these new env variables on an older platform/lifecycle since the older platform/lifecycle is unaware of them altering the behavior. In this particular case, erroring out would be beneficial.

Even if the user sets this on an older version of the platform/lifecycle, we only source from the env var if the buildpack api >= 0.8.

@samj1912 samj1912 merged commit 52e0183 into main Apr 11, 2022
@samj1912 samj1912 deleted the buildpack-0.8 branch April 11, 2022 15:13
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.

Support Buildpacks API 0.8: switch from build/detect args to env variables
2 participants