From d80253cbacbb6229247b4ee5323d61470b5df97d Mon Sep 17 00:00:00 2001 From: Josh W Lewis Date: Tue, 3 Sep 2024 07:26:52 -0500 Subject: [PATCH] Add deprecation notices for dep, gb, glide, godep, govendor (#569) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add deprecation notices for dep, gb, glide, godep, govendor Signed-off-by: Josh W Lewis * Add test assertions for deprecation messages * Add changelog entry for tool deprecation * Drop extra newline Co-authored-by: David Zülke * Add extra newline Co-authored-by: David Zülke --------- Signed-off-by: Josh W Lewis Co-authored-by: David Zülke --- CHANGELOG.md | 4 ++++ bin/compile | 12 ++++++++++++ test/run.sh | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afb24d64..d0a7c765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +* Deprecate support for unmaintained dependency managers: `dep`, `gb`, `glide`, `godep` and `govendor`. + Support for these dependency managers will be removed on March 1, 2025. + Apps using these dependency managers should migrate to Go modules as soon as possible. + Learn more about using Go modules on Heroku [here](https://devcenter.heroku.com/articles/go-modules). * Add support for wwwauth[] git credential arguments ## [v195] - 2024-08-13 diff --git a/bin/compile b/bin/compile index a90efeb1..38b7185d 100755 --- a/bin/compile +++ b/bin/compile @@ -352,6 +352,13 @@ warnPackageSpecOverride() { fi } +warnDeprecatedTool() { + local tool=$1 + warn "This application is using ${tool}, but ${tool} is no longer maintained." + warn "${tool} support on Heroku is deprecated and will be removed on March 1, 2025." + warn "Please migrate to Go modules. Learn more about Go modules on Heroku here: https://devcenter.heroku.com/articles/go-modules." +} + # Sets up GOPATH (and posibly other GO* env vars) and returns the location of # the source code as $src. The output of this function is meant to be eval'd' setupGOPATH() { @@ -708,6 +715,11 @@ if needConcurrency ${ver}; then cp $buildpack/vendor/concurrency.sh $build/.profile.d/ fi +# dep, gb, glide, godep, govendor are all unmaintained. +if [ "${TOOL}" != "gomodules" ]; then + warnDeprecatedTool "$TOOL" +fi + t="${build}/.heroku/go" mkdir -p "${t}" t="${t}/.meta" diff --git a/test/run.sh b/test/run.sh index 7c2f2abc..0f780a6d 100755 --- a/test/run.sh +++ b/test/run.sh @@ -635,6 +635,8 @@ testDepGoVersion() { assertCaptured "Fetching any unsaved dependencies (dep ensure)" assertCaptured "Running: go install -v -tags heroku ." assertCaptured "github.com/heroku/fixture" + assertCaptured "This application is using dep, but dep is no longer maintained." + assertCapturedSuccess assertCompiledBinaryExists } @@ -867,6 +869,8 @@ testGodepBasicGo14WithGOVERSIONOverride() { compile assertCaptured "Installing go1.6" assertCaptured "Using \$GOVERSION override." + assertCaptured "This application is using godep, but godep is no longer maintained." + assertCapturedSuccess assertCompiledBinaryExists assertBuildDirFileDoesNotExist ".profile.d/concurrency.sh" @@ -975,6 +979,8 @@ testGlideBasic() { assertCaptured "Fetching any unsaved dependencies (glide install)" assertCaptured "Running: go install -v -tags heroku ." assertCaptured "github.com/heroku/fixture" + assertCaptured "This application is using glide, but glide is no longer maintained." + assertCapturedSuccess assertCompiledBinaryExists } @@ -1234,6 +1240,8 @@ testGBBasic() { assertCaptured "Running: gb build -tags heroku" assertCaptured "cmd/fixture" assertCaptured "Post Compile Cleanup" + assertCaptured "This application is using gb, but gb is no longer maintained." + assertCapturedSuccess assertCompiledBinaryExists } @@ -1373,6 +1381,8 @@ testGovendorBasic() { assertCaptured "Running: go install -v -tags heroku ." assertCaptured "Installing package '.' (default)" assertCaptured "github.com/heroku/fixture" + assertCaptured "This application is using govendor, but govendor is no longer maintained." + assertCapturedSuccess assertCompiledBinaryExists }