Skip to content

Commit

Permalink
BOT: run 'make upgrade-klone' and 'make generate'
Browse files Browse the repository at this point in the history
Signed-off-by: cert-manager-bot <[email protected]>
  • Loading branch information
cert-manager-bot committed May 2, 2024
1 parent ac88cca commit 4a5e7bd
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
2 changes: 0 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ linters:
- gocritic
- gofmt
- goheader
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
Expand Down
24 changes: 12 additions & 12 deletions klone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions make/_shared/go/.golangci.override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ linters:
- gocritic
- gofmt
- goheader
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
Expand Down
25 changes: 14 additions & 11 deletions make/_shared/go/01_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""; \
Expand All @@ -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 ""; \
Expand All @@ -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 ""; \
Expand Down
9 changes: 6 additions & 3 deletions make/_shared/tools/00_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 #
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions make/_shared/tools/util/lock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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
Expand Down

0 comments on commit 4a5e7bd

Please sign in to comment.