You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test-only Go dependencies force the Go version of the whole repo (see #1548) #1549
While looking at Dependabot PR #1548 I noticed that a test-only dependency can raise the Go version for the whole repo.
go.mod says go 1.25.4, and scripts/install_go.sh installs Go 1.25.10, which bin/supply and bin/finalize use for go build -mod=vendor. otel 1.47.0 needs Go 1.26, so #1548 changes go.mod to go 1.26.0. The build with Go 1.25.10 (GOTOOLCHAIN=local) then fails with go: go.mod requires go >= 1.26.0. On main it works.
The buildpack binaries (supply, finalize, javaexec) only use a few modules: libbuildpack, libbuildpack-dynatrace, the two semver libraries, backoff, the YAML libraries and golang.org/x. OpenTelemetry is pulled in by the integration tests: go mod why go.opentelemetry.io/otel gives src/integration -> switchblade -> docker/docker/client -> otelhttp -> otel. As far as I can see, the same tooling brings in many of the other test-only modules. vendor/ holds 51 modules in 1,526 committed files (24 MB), so one bump can change tens of thousands of lines (#1528: about 35,000, of which 90% are two generated files).
Some ideas, in the order I would try them:
Move src/integration into its own Go module (own go.mod and vendor/). Bumps of switchblade, the Docker client or otel would then no longer change the Go version or the vendored code of the buildpack itself. I have not tried this; scripts/integration.sh and the CI jobs would need a check.
Dependabot rules: group or ignore the test-only modules, so a Go version jump is not proposed as a routine update.
Raise the Go version of the buildpack on purpose now and then, in its own PR (new version and sha256 per stack in install_go.sh), so the gap to the newest Go stays small.
Question: is vendor/ needed because bin/supply and bin/finalize build from source when staging (possibly without network access), or is there another reason? That would help to decide which of these ideas makes sense.
Activity