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

Upgrade legacy builder deprecation warnings to errors #478

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Mar 8, 2024

This upgrades the deprecation warnings added in #429 to errors, for the reasons mentioned in #474. It uses an approach similar to that used for the Heroku-18 EOL in #336.

These errors can be skipped by setting the env var: ALLOW_EOL_SHIMMED_BUILDER=1

For example:

pack build --env ALLOW_EOL_SHIMMED_BUILDER=1 ...

However, users are strongly encouraged to migrate from the legacy shimmed heroku/buildpacks:20 and heroku/builder-classic:22 images to the new heroku/builder:* builder images.

For the differences between the available images, see:
https://github.com/heroku/cnb-builder-images#available-images

The buildpack has also been moved to the start of each [[order]] group (rather than the end), so that the build fails early, rather than wasting the user/build system's time with a build that's only going to fail. (We had the buildpack at the end of the group before, to make the EOL warning more visible, since often users won't scroll back through the logs, and only see what's printed at the end of the build log in their console.)

Example error message:

error-message

See also:
https://github.com/heroku/cnb-builder-images/actions/runs/8204908398/job/22440626428?pr=478#step:6:30

Closes #474.
GUS-W-15212520.

@edmorley edmorley self-assigned this Mar 8, 2024
@edmorley
Copy link
Member Author

edmorley commented Mar 8, 2024

I've opened this early as a draft to make it easier for anyone following #474 to see what's upcoming, however, I won't be merging this PR until slightly later this month.

@edmorley edmorley force-pushed the edmorley/upgrade-deprecations-to-errors branch from 21a9ab6 to 63f6462 Compare March 13, 2024 08:29
@edmorley edmorley marked this pull request as ready for review March 13, 2024 08:30
@edmorley edmorley requested a review from a team as a code owner March 13, 2024 08:31
@edmorley
Copy link
Member Author

I plan to merge this at the start of next week.

@edmorley edmorley force-pushed the edmorley/upgrade-deprecations-to-errors branch from 63f6462 to 0f5b38d Compare March 13, 2024 10:00
This upgrades the deprecation warnings added in #429 to errors,
for the reasons mentioned in #474.

These errors can be skipped by setting the env var:
`ALLOW_EOL_SHIMMED_BUILDER=1`

For example:

`pack build --env ALLOW_EOL_SHIMMED_BUILDER=1 ...`

However, users are strongly encouraged to migrate from the legacy
shimmed `heroku/buildpacks:20` and `heroku/builder-classic:22`
images to the new `heroku/builder:*` builder images.

For the differences between the available images, see:
https://github.com/heroku/cnb-builder-images#available-images

The buildpack has also been moved to the start of each `[[order]]`
group (rather than the end), so that the build fails early, rather than
wasting the user/build system's time with a build that's only going
to fail. (We had the buildpack at the end of the group before, to
make the EOL warning more visible, since often users won't scroll
back through the logs, and only see what's printed at the end of the
build log in their console.)

Closes #474.
GUS-W-15212520.
@edmorley edmorley force-pushed the edmorley/upgrade-deprecations-to-errors branch from 0f5b38d to 72c91cc Compare March 15, 2024 14:08
@edmorley edmorley merged commit 80be4fb into main Mar 18, 2024
42 checks passed
@edmorley edmorley deleted the edmorley/upgrade-deprecations-to-errors branch March 18, 2024 08:23
edmorley added a commit to heroku/cnb-shim that referenced this pull request Mar 25, 2024
Heroku's legacy shimmed builder images (`heroku/buildpacks:20` and
`heroku/builder-classic:22`) are EOL and will soon stop receiving
security updates.

We added deprecation warnings to the builder images back in October:
heroku/cnb-builder-images#429

And these warnings were just upgraded to errors:
heroku/cnb-builder-images#478

However, the way these warnings/errors are shown is via the builders
default buildpack detection group configuration, which means that if a
project provides a custom buildpack list (either via `project.toml`,
`--buildpack` args to Pack CLI, or via a third party build tool that
overrides the buildpack list), these warnings aren't shown.

As such, I'm adding them directly to cnb-shim, to raise awareness of the
Heroku builder image sunset, as well as the deprecated nature of cnb-shim.

The implementation is based on that here:
https://github.com/heroku/cnb-builder-images/blob/88cb8159fff129ab498c2e9a5df9bbaff8ea204a/buildpacks-20/end-of-life-buildpack/bin/build

I've re-used the same `ALLOW_EOL_SHIMMED_BUILDER` env var name,
since otherwise it will cause another round of breaking changes for
people who've already seen the error message from the builder itself,
and have already set that env var.

Since cnb-shim may be being used by non-Heroku builder images too (for which
the sunset nature of the builder doesn't apply; only the cnb-shim deprecation),
we check the stack ID and vary the message/behaviour accordingly.

GUS-W-15325154.
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.

Upgrade legacy builder image deprecation warnings to an error
2 participants