Use older Pack CLI / Platform API for Functions tests#480
Merged
Conversation
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.)
Member
Author
For example, in this testing branch it catches the issue: |
Malax
approved these changes
Mar 12, 2024
Member
Author
|
The improved parity CI coverage from this PR helped prevent a production Functions incident from #524 (where some combination of older platform API and older/buggier lifecycle in the functions builder means some required target env vars aren't set correctly) - so I'm glad I made this change! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 buildwill 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_eolbranch: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-colorarg, 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
mainbranch will be upgraded to newer Platform API soon anyway.)GUS-W-15226981.