paketo-buildpacks / libpak

An opinionated extension to the libcnb Cloud Native Buildpack Library
Apache License 2.0
15 stars 17 forks source link

Add interface for layer contributor to also contribute process types #349

Open dmikusa opened 1 month ago

dmikusa commented 1 month ago

Describe the Enhancement

As a layer contributor, I can't presently set process types. That can only happen in the build func. Enable a layer contributor to set process types, so that logic can move out of build into the layer contributors which often are the ones with the most knowledge about the command to run.

This should be optional though. If the layer contributor does not want to contribute processes, that's OK. If the layer contributor doesn't have enough information to set the process types, that's OK too, and they should still be possible to be set in the build func.

Motivation

In simple cases, which is where layer contributor excels the layer contributor can contribute a process type and then the logic for this is more cleanly separated in the layer contributor versus in the build func.