feat: split stack property into per-builder properties

The `stack` property lived on the `buildpacks` plugin but was shared by both the herokuish and pack builders, so a value valid for one builder broke the other. Each builder now owns its own `stack` property managed via `builder-herokuish:set` and `builder-pack:set`, while `buildpacks:set-property stack` is deprecated and forwards the value to the builder detected from it; existing values migrate automatically on upgrade and changing a builder's stack clears that builder's cache.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-11-02 16:48:11 -05:00
1 parent 5ef061d3d2
commit 59594937f9
23 files changed
+449 -178

No files matched your search

+30
View File
@@ -1,6 +1,8 @@
package builderpack
import (
"os"
"github.com/dokku/dokku/plugins/common"
)
@@ -17,12 +19,17 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
flags = map[string]common.ReportFunc{
"--builder-pack-computed-projecttoml-path": reportComputedProjecttomlPath,
"--builder-pack-global-projecttoml-path": reportGlobalProjecttomlPath,
"--builder-pack-computed-stack": reportComputedStack,
"--builder-pack-global-stack": reportGlobalStack,
}
} else {
flags = map[string]common.ReportFunc{
"--builder-pack-computed-projecttoml-path": reportComputedProjecttomlPath,
"--builder-pack-global-projecttoml-path": reportGlobalProjecttomlPath,
"--builder-pack-projecttoml-path": reportProjecttomlPath,
"--builder-pack-computed-stack": reportComputedStack,
"--builder-pack-global-stack": reportGlobalStack,
"--builder-pack-stack": reportStack,
}
}
@@ -64,3 +71,26 @@ func reportComputedProjecttomlPath(appName string) string {
return value
}
func reportStack(appName string) string {
return common.PropertyGet("builder-pack", appName, "stack")
}
func reportGlobalStack(appName string) string {
return common.PropertyGet("builder-pack", "--global", "stack")
}
func reportComputedStack(appName string) string {
value := reportStack(appName)
if value == "" {
value = reportGlobalStack(appName)
}
if value == "" {
value = os.Getenv("DOKKU_CNB_BUILDER")
}
if value == "" {
value = "heroku/builder:24"
}
return value
}