-
Notifications
You must be signed in to change notification settings - Fork 106
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
Always set CNB_TARGET_* variables during detect, build, and generate #1309
Conversation
when the Buildpack API version is at least 0.10. Previously, we only set these variables when the Platform API version was at least 0.12. But, newer Buildpack APIs expect these variables regardless of the Platform API version. If we are on an older platform, derive the target variables from the base image OS. Fixes #1308 Signed-off-by: Natalie Arellano <[email protected]>
Signed-off-by: Natalie Arellano <[email protected]>
Signed-off-by: Natalie Arellano <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1309 +/- ##
==========================================
+ Coverage 64.59% 64.60% +0.01%
==========================================
Files 101 101
Lines 6997 7007 +10
==========================================
+ Hits 4519 4526 +7
- Misses 2067 2069 +2
- Partials 411 412 +1
Flags with carried forward coverage won't be shown. Click here to find out more. |
@natalieparellano Thank you for fixing this! We're now using lifecycle 0.19.0 in our newer builders and it's resolved the issue. However, I've just realised we have an older builder that's stuck on (I think in general backporting should be for exceptional circumstances only, however, I wonder if for this specific case it might be worth the effort, just so buildpack authors don't hold back from upgrading to newer Buildpack API versions and targets instead of stacks) |
The latest version of Pack CLI (v0.33.2) supports Platform API <= 0.12: https://github.com/buildpacks/pack/blob/v0.33.2/internal/build/lifecycle_executor.go#L34 This means when it's used with any lifecycle version newer than 0.17.x, a `pack build` will end up using Platform API 0.12. Therefore all of our tests in our CNB repos, and the smoke tests in this repo are all testing against Platform API 0.12. However, Kodon is currently using Platform API 0.9, and whilst this is in the process of being upgraded (GUS-W-15122354), it's unlikely that the version will be upgraded for Kodon's `functions_eol` branch: https://github.com/heroku/kodon/blob/functions_eol/internal/constants/constants.go#L75 As such, I've updated the functions tests here to use Pack CLI 0.27.0, which similarly only supports Platform API <= 0.9, and therefore gives us greater testing parity between CI and Kodon. This test coverage will help catch things like: buildpacks/lifecycle#1309 (comment) Downgrading the Pack CLI version meant needing to remove the `--force-color` arg, since it's only supported as of v0.33.0. I've not changed the Pack CLI version used elsewhere, since it's helpful for us to also have coverage of the actual Pack CLI and Platform API versions everyone else will be using locally. (Plus hopefully Kodon's `main` branch will be upgraded to newer Platform API soon anyway.)
The latest version of Pack CLI (v0.33.2) supports Platform API <= 0.12: https://github.com/buildpacks/pack/blob/v0.33.2/internal/build/lifecycle_executor.go#L34 This means when it's used with any lifecycle version newer than 0.17.x, a `pack build` will end up using Platform API 0.12: https://github.com/buildpacks/lifecycle#supported-apis Therefore all of our tests in our CNB repos, and the smoke tests in this repo are all testing against Platform API 0.12. However, Kodon is currently using Platform API 0.9, and whilst this is in the process of being upgraded (GUS-W-15122354), it's unlikely that the version will be upgraded for Kodon's `functions_eol` branch: https://github.com/heroku/kodon/blob/functions_eol/internal/constants/constants.go#L75 As such, I've updated the functions tests here to use Pack CLI 0.27.0, which similarly only supports Platform API <= 0.9, and therefore gives us greater testing parity between CI and Kodon. This test coverage will help catch things like: buildpacks/lifecycle#1309 (comment) Downgrading the Pack CLI version meant needing to remove the `--force-color` arg, since it's only supported as of v0.33.0. I've not changed the Pack CLI version used elsewhere, since it's helpful for us to also have coverage of the actual Pack CLI and Platform API versions everyone else will be using locally. (Plus hopefully Kodon's `main` branch will be upgraded to newer Platform API soon anyway.) GUS-W-15226981.
Thank you - much appreciated! 😄 |
To pick up this fix: buildpacks/lifecycle#1309 ...so that these images still work after the removal of the `CNB_TARGET_*` env vars workaround in: heroku/base-images#260 Release notes: https://github.com/buildpacks/lifecycle/releases/tag/v0.17.5 Full changelog: buildpacks/lifecycle@v0.17.4...v0.17.5 GUS-W-15225541.
when the Buildpack API version is at least 0.10
Summary
Previously, we only set these variables when the Platform API version was at least 0.12. But, newer Buildpack APIs expect these variables regardless of the Platform API version. If we are on an older platform, derive the target variables from the base image OS.
Release notes
The lifecycle always set CNB_TARGET_* variables during detect, build, and generate when the Buildpack API version is at least 0.10
Related
Resolves #1308 and #1186
Context