From 4a5e7bdbbd0cd44e9bd85e85c56f4e03b2a1371b Mon Sep 17 00:00:00 2001 From: cert-manager-bot Date: Thu, 2 May 2024 01:05:41 +0000 Subject: [PATCH] BOT: run 'make upgrade-klone' and 'make generate' Signed-off-by: cert-manager-bot --- .golangci.yaml | 2 -- klone.yaml | 24 ++++++++++++------------ make/_shared/go/.golangci.override.yaml | 2 -- make/_shared/go/01_mod.mk | 25 ++++++++++++++----------- make/_shared/tools/00_mod.mk | 9 ++++++--- make/_shared/tools/util/lock.sh | 6 ++---- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 614a7f4..5e66512 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -30,8 +30,6 @@ linters: - gocritic - gofmt - goheader - - gomoddirectives - - gomodguard - goprintffuncname - gosec - gosimple diff --git a/klone.yaml b/klone.yaml index 8415219..dbb9d44 100644 --- a/klone.yaml +++ b/klone.yaml @@ -9,60 +9,60 @@ targets: - folder_name: api-docs repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/api-docs - folder_name: boilerplate repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/boilerplate - folder_name: cert-manager repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/cert-manager - folder_name: controller-gen repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/controller-gen - folder_name: generate-verify repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/generate-verify - folder_name: go repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/go - folder_name: help repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/help - folder_name: kind repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/kind - folder_name: klone repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/klone - folder_name: oci-build repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/oci-build - folder_name: repository-base repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/repository-base - folder_name: tools repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 98c34c9f1a00f9be03d5020b46fccb21c6a566bd + repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4 repo_path: modules/tools diff --git a/make/_shared/go/.golangci.override.yaml b/make/_shared/go/.golangci.override.yaml index e569eff..86c2337 100644 --- a/make/_shared/go/.golangci.override.yaml +++ b/make/_shared/go/.golangci.override.yaml @@ -25,8 +25,6 @@ linters: - gocritic - gofmt - goheader - - gomoddirectives - - gomodguard - goprintffuncname - gosec - gosimple diff --git a/make/_shared/go/01_mod.mk b/make/_shared/go/01_mod.mk index 70f576b..0e4d418 100644 --- a/make/_shared/go/01_mod.mk +++ b/make/_shared/go/01_mod.mk @@ -46,10 +46,11 @@ shared_generate_targets += generate-govulncheck # not want new vulnerabilities in existing code to block the merging of PRs. # Instead `make verify-govulnecheck` is intended to be run periodically by a CI job. verify-govulncheck: | $(NEEDS_GOVULNCHECK) - @find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) -printf '%h\n' \ + @find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \ | while read d; do \ - echo "Running 'GOTOOLCHAIN=go$(VENDORED_GO_VERSION) $(bin_dir)/tools/govulncheck ./...' in directory '$${d}'"; \ - pushd "$${d}" >/dev/null; \ + target=$$(dirname $${d}); \ + echo "Running 'GOTOOLCHAIN=go$(VENDORED_GO_VERSION) $(bin_dir)/tools/govulncheck ./...' in directory '$${target}'"; \ + pushd "$${target}" >/dev/null; \ GOTOOLCHAIN=go$(VENDORED_GO_VERSION) $(GOVULNCHECK) ./... || exit; \ popd >/dev/null; \ echo ""; \ @@ -73,10 +74,11 @@ shared_generate_targets += generate-golangci-lint-config ## Verify all Go modules using golangci-lint ## @category [shared] Generate/ Verify verify-golangci-lint: | $(NEEDS_GO) $(NEEDS_GOLANGCI-LINT) $(NEEDS_YQ) $(bin_dir)/scratch - @find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) -printf '%h\n' \ + @find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \ | while read d; do \ - echo "Running '$(bin_dir)/tools/golangci-lint run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config)' in directory '$${d}'"; \ - pushd "$${d}" >/dev/null; \ + target=$$(dirname $${d}); \ + echo "Running '$(bin_dir)/tools/golangci-lint run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config)' in directory '$${target}'"; \ + pushd "$${target}" >/dev/null; \ $(GOLANGCI-LINT) run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config) --timeout 4m || exit; \ popd >/dev/null; \ echo ""; \ @@ -87,18 +89,19 @@ shared_verify_targets_dirty += verify-golangci-lint .PHONY: fix-golangci-lint ## Fix all Go modules using golangci-lint ## @category [shared] Generate/ Verify -fix-golangci-lint: | $(NEEDS_GOLANGCI-LINT) $(NEEDS_YQ) $(bin_dir)/scratch - gci write \ +fix-golangci-lint: | $(NEEDS_GOLANGCI-LINT) $(NEEDS_YQ) $(NEEDS_GCI) $(bin_dir)/scratch + $(GCI) write \ -s "standard" \ -s "default" \ -s "prefix($(repo_name))" \ -s "blank" \ -s "dot" . - @find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) -printf '%h\n' \ + @find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \ | while read d; do \ - echo "Running '$(bin_dir)/tools/golangci-lint run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config) --fix' in directory '$${d}'"; \ - pushd "$${d}" >/dev/null; \ + target=$$(dirname $${d}); \ + echo "Running '$(bin_dir)/tools/golangci-lint run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config) --fix' in directory '$${target}'"; \ + pushd "$${target}" >/dev/null; \ $(GOLANGCI-LINT) run --go $(VENDORED_GO_VERSION) -c $(CURDIR)/$(golangci_lint_config) --fix || exit; \ popd >/dev/null; \ echo ""; \ diff --git a/make/_shared/tools/00_mod.mk b/make/_shared/tools/00_mod.mk index eaed36b..550ff5e 100644 --- a/make/_shared/tools/00_mod.mk +++ b/make/_shared/tools/00_mod.mk @@ -114,7 +114,7 @@ TOOLS += helm-tool=v0.4.2 # https://github.com/cert-manager/cmctl TOOLS += cmctl=2f75014a7c360c319f8c7c8afe8e9ce33fe26dca # https://pkg.go.dev/github.com/cert-manager/release/cmd/cmrel?tab=versions -TOOLS += cmrel=fa10147dadc8c36718b7b08aed6d8c6418eb2 +TOOLS += cmrel=84daedb44d61d25582e22eca48352012e899d1b2 # https://github.com/golangci/golangci-lint/releases TOOLS += golangci-lint=v1.57.1 # https://pkg.go.dev/golang.org/x/vuln?tab=versions @@ -125,6 +125,8 @@ TOOLS += operator-sdk=v1.34.1 TOOLS += gh=v2.47.0 # https:///github.com/redhat-openshift-ecosystem/openshift-preflight/releases TOOLS += preflight=1.9.2 +# https://github.com/daixiang0/gci/releases/ +TOOLS += gci=v0.13.4 # https://pkg.go.dev/k8s.io/code-generator/cmd?tab=versions K8S_CODEGEN_VERSION=v0.29.1 @@ -312,6 +314,7 @@ GO_DEPENDENCIES += golangci-lint=github.com/golangci/golangci-lint/cmd/golangci- GO_DEPENDENCIES += govulncheck=golang.org/x/vuln/cmd/govulncheck GO_DEPENDENCIES += operator-sdk=github.com/operator-framework/operator-sdk/cmd/operator-sdk GO_DEPENDENCIES += gh=github.com/cli/cli/v2/cmd/gh +GO_DEPENDENCIES += gci=github.com/daixiang0/gci ################# # go build tags # @@ -550,7 +553,7 @@ $(DOWNLOAD_DIR)/tools/rclone@$(RCLONE_VERSION)_$(HOST_OS)_$(HOST_ARCH): | $(DOWN PREFLIGHT_linux_amd64_SHA256SUM=20f31e4af2004e8e3407844afea4e973975069169d69794e0633f0cb91d45afd PREFLIGHT_linux_arm64_SHA256SUM=c42cf4132027d937da88da07760e8fd9b1a8836f9c7795a1b60513d99c6939fe -# Currently there are no offical releases for darwin, you cannot submit results +# Currently there are no offical releases for darwin, you cannot submit results # on non-official binaries, but we can still run tests. # # Once https://github.com/redhat-openshift-ecosystem/openshift-preflight/pull/942 is merged @@ -614,7 +617,7 @@ tools-learn-sha: | $(bin_dir) HOST_OS=linux HOST_ARCH=arm64 $(MAKE) tools HOST_OS=darwin HOST_ARCH=amd64 $(MAKE) tools HOST_OS=darwin HOST_ARCH=arm64 $(MAKE) tools - + HOST_OS=linux HOST_ARCH=amd64 $(MAKE) vendor-go HOST_OS=linux HOST_ARCH=arm64 $(MAKE) vendor-go HOST_OS=darwin HOST_ARCH=amd64 $(MAKE) vendor-go diff --git a/make/_shared/tools/util/lock.sh b/make/_shared/tools/util/lock.sh index d3c437e..22564f7 100755 --- a/make/_shared/tools/util/lock.sh +++ b/make/_shared/tools/util/lock.sh @@ -28,8 +28,6 @@ set -o pipefail finalfile="$1" lockfile="$finalfile.lock" -# Timeout in seconds. -timeout=60 # On OSX, flock is not installed, we just skip locking in that case, # this means that running verify in parallel without downloading all @@ -42,8 +40,8 @@ if [[ "$flock_installed" == "yes" ]]; then exec {FD}<>"$lockfile" # wait for the file to be unlocked - if ! flock -x -w $timeout $FD; then - echo "Failed to obtain a lock for $lockfile within $timeout seconds" + if ! flock -x $FD; then + echo "Failed to obtain a lock for $lockfile" exit 1 fi fi