From 8eb3afce0beddd7b6148dec103300b9e71b97ba8 Mon Sep 17 00:00:00 2001 From: Steve Azzopardi Date: Tue, 20 Dec 2022 14:06:09 +0100 Subject: [PATCH] refactor: remove -compat check for `go mod tidy` What --- Remove the `-compat` flag where we run `go mod tidy` Why --- This was added in https://gitlab.com/gitlab-org/labkit/-/merge_requests/171 because of an indirect dependency, where go mod tidy had to run in 1.17 compatibility mode as go.sum cannot generate the same dependency graph on go <= 1.16. We no longer support go 1.16 or go 1.17 since those are EOL from the Go team themselves. Signed-off-by: Steve Azzopardi --- backwords_compat.sh | 2 +- downstream-vendor.sh | 2 +- tidy.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backwords_compat.sh b/backwords_compat.sh index 012d135..b0ceb28 100755 --- a/backwords_compat.sh +++ b/backwords_compat.sh @@ -12,7 +12,7 @@ cd "$cloneDir" go mod edit -replace=gitlab.com/gitlab-org/labkit="$CI_PROJECT_DIR" # Ensure go.mod and go.sum are up to date in the cloned repo, otherwise build may fail. -go mod tidy -compat=1.18 +go mod tidy make -j "$(nproc)" diff --git a/downstream-vendor.sh b/downstream-vendor.sh index c7fc751..517d948 100755 --- a/downstream-vendor.sh +++ b/downstream-vendor.sh @@ -79,7 +79,7 @@ function vendor_downstream_project() { # Update to the appropriate commit SHA go get -u=patch "gitlab.com/gitlab-org/labkit@$LABKIT_VERSION_TAG" - go mod tidy -compat=1.18 + go mod tidy git add go.mod go.sum if [[ "$vendor_branch_exists" == "yes" ]]; then diff --git a/tidy.sh b/tidy.sh index c3b8811..c102ad3 100755 --- a/tidy.sh +++ b/tidy.sh @@ -4,7 +4,7 @@ set -eux # Check go tidy git diff go.sum go.mod > /tmp/gomod-"${CI_JOB_ID}"-before -go mod tidy -compat=1.18 +go mod tidy git diff go.sum go.mod > /tmp/gomod-"${CI_JOB_ID}"-after diff -U0 /tmp/gomod-"${CI_JOB_ID}"-before /tmp/gomod-"${CI_JOB_ID}"-after -- GitLab