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 <cert-manager-bot@users.noreply.github.com>
  • Loading branch information
cert-manager-bot committed May 2, 2024
1 parent 7e0ce13 commit 1fe8463
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
14 changes: 7 additions & 7 deletions klone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ targets:
- folder_name: boilerplate
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f053c2c92459763f424280dde8190aae674743b9
repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4
repo_path: modules/boilerplate
- folder_name: generate-verify
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f053c2c92459763f424280dde8190aae674743b9
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: f053c2c92459763f424280dde8190aae674743b9
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: f053c2c92459763f424280dde8190aae674743b9
repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4
repo_path: modules/help
- folder_name: klone
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f053c2c92459763f424280dde8190aae674743b9
repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4
repo_path: modules/klone
- folder_name: repository-base
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f053c2c92459763f424280dde8190aae674743b9
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: f053c2c92459763f424280dde8190aae674743b9
repo_hash: a3d5edd389774182bc0eb7eff32c9c9acf0254f4
repo_path: modules/tools
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
7 changes: 5 additions & 2 deletions make/_shared/tools/00_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1fe8463

Please sign in to comment.