From 61f9ef6cceed98b28cd591a51e21405706a36e17 Mon Sep 17 00:00:00 2001 From: Zach Krzyzanowski Date: Tue, 3 Jan 2023 11:37:04 -0500 Subject: [PATCH] allow multiple heroku install directives --- .github/pull_request_template.md | 27 +++++++++++++++++++++++++++ bin/compile | 12 ++++++++---- test/run.sh | 10 ++++++---- 3 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..6470aacc --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,27 @@ +# Overview + +A brief description of the change + +## Story + +[#12345](https://www.pivotaltracker.com/story/show/12345) + +## Things That I Tested + +List out any scenarios or items that were tested manually + +## Where More Testing Might Be Necessary + +List any outliers, edge cases or potential side effects from this change + +## Implementation Notes + +Any technical decisions, thoughts, concerns, etc + +## Dependencies + +List any stories, tasks or other PRs that might block this change from being merged + +## Code Review Best Practices + +Use [code best practices](https://github.com/b-lab-org/assessment-api/wiki/engineering-code-best-practices) for PR reviews \ No newline at end of file diff --git a/bin/compile b/bin/compile index ea75b5c0..8be53e87 100755 --- a/bin/compile +++ b/bin/compile @@ -383,8 +383,10 @@ setupGOPATH() { } installPkgs() { - step "Running: go install -v ${FLAGS[@]} ${pkgs}" - go install -v "${FLAGS[@]}" ${pkgs} 2>&1 + for pkg in ${pkgs}; do + step "Running: go install -v ${FLAGS[@]} ${pkg}" + go install -v "${FLAGS[@]}" ${pkg} 2>&1 + done } loadEnvDir "${env_dir}" @@ -489,7 +491,8 @@ case "${TOOL}" in fi step "Determining packages to install" - pkgs=${GO_INSTALL_PACKAGE_SPEC:-$(awk '{ if ($1 == "//" && $2 == "+heroku" && $3 == "install" ) { print substr($0, index($0,$4)); exit }}' ${goMOD})} + pkgs=${GO_INSTALL_PACKAGE_SPEC:-$(awk '{ if ($1 == "//" && $2 == "+heroku" && $3 == "install" ) { print substr($0, index($0,$4)); }}' ${goMOD})} + if [ -z "${pkgs}" ]; then pkgs=$(mainPackagesInModule) if [ -z "${pkgs}" ]; then @@ -560,7 +563,8 @@ case "${TOOL}" in fi step "Determining packages to install" - pkgs=${GO_INSTALL_PACKAGE_SPEC:-$(awk '{ if ($1 == "//" && $2 == "+heroku" && $3 == "install" ) { print substr($0, index($0,$4)); exit }}' ${goWork})} + pkgs=${GO_INSTALL_PACKAGE_SPEC:-$(awk '{ if ($1 == "//" && $2 == "+heroku" && $3 == "install" ) { print substr($0, index($0,$4)); }}' ${goWork})} + if [ -z "${pkgs}" ]; then pkgs=$(mainPackagesInModule) if [ -z "${pkgs}" ]; then diff --git a/test/run.sh b/test/run.sh index 55e7edb4..0a9e33e5 100755 --- a/test/run.sh +++ b/test/run.sh @@ -874,7 +874,8 @@ testGlideMassageVendor() { assertCaptured "Installing go" assertCaptured "Installing glide" assertCaptured "Fetching any unsaved dependencies (glide install)" - assertCaptured "Running: go install -v -tags heroku . github.com/heroku/fixture/vendor/github.com/mattes/migrate" + assertCaptured "Running: go install -v -tags heroku ." + assertCaptured "Running: go install -v -tags heroku github.com/heroku/fixture/vendor/github.com/mattes/migrate" assertCaptured "github.com/heroku/fixture" assertCaptured "github.com/heroku/fixture/vendor/github.com/fatih/color/vendor/github.com/mattn/go-colorable" assertCaptured "github.com/heroku/fixture/vendor/github.com/fatih/color/vendor/github.com/mattn/go-isatty" @@ -1051,7 +1052,7 @@ testGodepBasicGo14() { assertBuildDirFileExists ".profile.d/concurrency.sh" } -testGodepCGOVendored(){ +testGodepCGOVendored() { fixture "godep-cgo-vendored" env "CGO_CFLAGS" '-I${build_dir}/vendor/include' @@ -1076,8 +1077,9 @@ testGodepMassageVendor() { compile assertCaptured "Checking Godeps/Godeps.json file." assertCaptured "Installing go" - assertCaptured "Running: go install -v -tags heroku . github.com/heroku/fixture/vendor/github.com/mattes/migrate" + assertCaptured "Running: go install -v -tags heroku ." assertCaptured "github.com/heroku/fixture" + assertCaptured "Running: go install -v -tags heroku github.com/heroku/fixture/vendor/github.com/mattes/migrate" assertCaptured "github.com/heroku/fixture/vendor/github.com/mattn/go-isatty" assertCaptured "github.com/heroku/fixture/vendor/github.com/shiena/ansicolor" assertCaptured "github.com/heroku/fixture/vendor/github.com/fatih/color" @@ -1253,7 +1255,7 @@ testGodepLDSymbolValue() { assertCapturedSuccess assertCompiledBinaryExists assertCompiledBinaryOutputs "fixture" "fixture" -# assertTrue "Binary has the right value" '[ "$(${compile_dir}/bin/fixture)" = "fixture" ]' + # assertTrue "Binary has the right value" '[ "$(${compile_dir}/bin/fixture)" = "fixture" ]' } # # Older versions of Go have a different format for specifying linked flags