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

Use older Pack CLI / Platform API for Functions tests #480

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Mar 11, 2024

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.

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.)
@edmorley edmorley self-assigned this Mar 11, 2024
@edmorley
Copy link
Member Author

This test coverage will help catch things like:
buildpacks/lifecycle#1309 (comment)

For example, in this testing branch it catches the issue:
https://github.com/heroku/cnb-builder-images/actions/runs/8236398654/job/22522794409#step:6:16

@edmorley edmorley marked this pull request as ready for review March 11, 2024 17:15
@edmorley edmorley requested a review from a team as a code owner March 11, 2024 17:15
@edmorley edmorley enabled auto-merge (squash) March 11, 2024 17:19
@edmorley edmorley merged commit a904e2f into main Mar 12, 2024
42 checks passed
@edmorley edmorley deleted the edmorley/functions-older-pack-cli branch March 12, 2024 10:41
@edmorley
Copy link
Member Author

edmorley commented May 24, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants