lifecycle icon indicating copy to clipboard operation
lifecycle copied to clipboard

Buildpack API deprecation warning not shown for transitive dependency buildpacks

Open edmorley opened this issue 2 years ago • 4 comments

Summary

If a buildpack is using a deprecated Buildpack API version, lifecycle outputs a warning like so during detect:

===> DETECTING
Warning: Buildpack 'heroku/[email protected]' requests deprecated API '0.6'

However, if the buildpack in question isn't in the top level buildpack group, and instead is a transitive dependency of a composite buildpack, then the warning isn't shown.

It seems that the check here isn't traversing the full buildpack order group graph: https://github.com/buildpacks/lifecycle/blob/dbd27bdef0e60e4145b34d7726cab612b0e922f2/cmd/lifecycle/main.go#L136-L143 https://github.com/buildpacks/lifecycle/blob/dbd27bdef0e60e4145b34d7726cab612b0e922f2/cmd/apis.go#L35-L66


Reproduction

Steps
  1. mkdir testcase && cd $_
  2. pack build test --builder heroku/builder-classic:22 --buildpack heroku/[email protected]
  3. pack build test --builder heroku/builder-classic:22 --buildpack heroku/[email protected]
Current behavior

At step 2 (where the buildpack is referenced directly), a deprecation warning is correctly shown:

===> DETECTING
Warning: Buildpack 'heroku/[email protected]' requests deprecated API '0.6'
Timer: Detector started at 2023-11-15T08:45:46Z
======== Results ========
fail: heroku/[email protected]

At step 3 (where the buildpack with the deprecated Buildpack API version is instead a transitive dependency of the composite buildpack heroku/nodejs-function), the deprecation warning is missing:

===> DETECTING
Timer: Detector started at 2023-11-15T08:45:18Z
======== Results ========
pass: heroku/[email protected]
fail: heroku/[email protected]
fail: heroku/[email protected]
Expected behavior

For the deprecation warning about Buildpack API version to be shown regardless of whether the buildpack in question is referenced directly, or is a transitive dependency of a composite buildpack.


Context

lifecycle version

0.17.2 (only since 0.18.x has since dropped support for Buildpack API 0.6, meaning there are no deprecated versions left at the moment with which the issue can be demonstrated).

platform version(s)

Pack 0.32.1+git-b14250b.build-5241

anything else?

The buildpacks in question: https://github.com/heroku/buildpacks-nodejs/blob/v2.3.0/buildpacks/npm/buildpack.toml https://github.com/heroku/buildpacks-nodejs/blob/v2.3.0/meta-buildpacks/nodejs-function/buildpack.toml

edmorley avatar Nov 15 '23 08:11 edmorley