paketo-buildpacks / libpak

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

Clarify default settings versus user specified settings in the config table #314

Open dmikusa opened 6 months ago

dmikusa commented 6 months ago

Describe the Enhancement

The config table is a little confusing in that we don't specify what's a default setting versus user-supplied. This makes it a little tricky sometimes to understand what value is going to be applied, in particular with BP_JVM_VERSION.

Log without setting BP_JVM_VERSION explicitly:

[INFO]     [creator]     Paketo Buildpack for BellSoft Liberica 10.5.2
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[...]
[INFO]     [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              17                                                           the Java version
[...]
[INFO]     [creator]         Using Java version 21 extracted from MANIFEST.MF

Log with setting BP_JVM_VERSION to 17 explicitly.

[INFO]     [creator]     Paketo Buildpack for BellSoft Liberica 10.5.2
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[...]
[INFO]     [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              17                                                           the Java version
[...]
[INFO]     [creator]         Using Java version 17 from BP_JVM_VERSION

Note how the last line shows that they are different because it impacts which version is selected. In both cases $BP_JVM_VERSION is logged as 17, but only if I set it explicitly the variable is used to determine the runtime jdk.

Possible Solution

We need a way to specify when a value is a default value versus user-supplied.

Options:

  1. Add an asterisk after default values. Add a line below the table indicating items marked with an asterisk are default values.
  2. Both add an asterisk and add some colors.
  3. Do nothing, or maybe just indicate below the table that this is the list of combined settings, and don't worry about trying to differentiate.
  4. Something else? 🤔

Things I'd prefer not to do:

  1. I don't want to add another column to the table, cause the table is already a bit large and hard to read.
  2. I don't want to do something that would make existing columns wider, like showing both the default and user-supplied versions. Some of the columns are already very wide, this would make that worse.
  3. I don't want to add just colors because that's not friendly for someone that's color blind or that just has colors disabled.

Motivation

Spun out of libjvm issue -> https://github.com/paketo-buildpacks/libjvm/issues/350