From 3d89fd38f193d2fb61afda792b6463539c30ab1e Mon Sep 17 00:00:00 2001 From: Walter Fender Date: Fri, 8 Mar 2024 07:50:06 +0000 Subject: [PATCH] Fixing the DCL generation. Updated linter to get past infinite recursion bug. Fix doc explaning the steps. Added extended timeout to work around long running linter. Added exclusions to prevent problems showing up on DCL generation. --- .github/workflows/lint.yaml | 4 +++- .golangci.yaml | 15 +++++++++++++++ Makefile | 4 ++-- README.UpdatingDCL.md | 4 ++-- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index efa235ca0d..a255a38004 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -20,11 +20,13 @@ on: - "third_party/**" - "**.md" - pkg/clients/generated + - config/tests pull_request: paths-ignore: - "third_party/**" - "**.md" - pkg/clients/generated + - config/tests permissions: read-all jobs: lint: @@ -44,4 +46,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 with: - version: v1.54.2 # should match the version in Makefile + version: v1.56.2 # should match the version in Makefile diff --git a/.golangci.yaml b/.golangci.yaml index 678c4fc8ee..85f69b647f 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -18,6 +18,7 @@ run: - third_party - pkg/clients/generated - scripts # todo acpana unskip + - temp-vendor linters: disable-all: true enable: @@ -44,3 +45,17 @@ linters: # - unconvert # - unused # - whitespace +linters-settings: + revive: + rules: + - name: unused-parameter + severity: warning + disabled: true + govet: + enable-all: true + disable: + - fieldalignment + - nilness + - shadow + - testinggoroutine + - unusedwrite diff --git a/Makefile b/Makefile index a062ad5d5b..e77e966b60 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ UNMANAGED_DETECTOR_IMG ?= gcr.io/${PROJECT_ID}/unmanageddetector:${SHORT_SHA} GOLANGCI_LINT_CACHE := $(shell pwd)/.tmp/golangci-lint # When updating this, make sure to update the corresponding action in # ./github/workflows/lint.yaml -GOLANGCI_LINT_VERSION := v1.54.2 +GOLANGCI_LINT_VERSION := v1.56.2 # Use Docker BuildKit when building images to allow usage of 'setcap' in # multi-stage builds (https://github.com/moby/moby/issues/38132) @@ -98,7 +98,7 @@ lint: docker run --rm -v $(shell pwd):/app \ -v ${GOLANGCI_LINT_CACHE}:/root/.cache/golangci-lint \ -w /app golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine \ - golangci-lint run -v + golangci-lint run -v --timeout=10m # Run go vet against code .PHONY: vet diff --git a/README.UpdatingDCL.md b/README.UpdatingDCL.md index c40010f646..d33648e58c 100644 --- a/README.UpdatingDCL.md +++ b/README.UpdatingDCL.md @@ -4,8 +4,8 @@ Approximately 25% of Config Connector resources leverage the [DCL](https://githu Upgrade Process: -1. In the repository root directory, run make `upgrade-dcl` to update the DCL dependency. -1. Run `make read-pr` to ensure proper updates for all generated files. +1. In the repository root directory, run `make upgrade-dcl` to update the DCL dependency. +1. Run `make ready-pr` to ensure proper updates for all generated files. 1. Check both the DCL [release notes](https://github.com/GoogleCloudPlatform/declarative-resource-client-library/releases) and the generated files, especially diff in CRDs. * Create a Pull Request titled "Update DCL to v1.58.0" (replace version as needed). * In the PR description, list the new CRD fields and relevant bug fixes introduced by the DCL update.