From b763f015427358c06c34afd8ae33d789c6f0bf13 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Mon, 7 Sep 2026 00:07:13 +0000 Subject: [PATCH 1/2] ci: unbreak the lint job under Go 1.27 golangci-lint v2.12.2 is built with go1.26 and panics while typechecking the Go 1.27 standard library: panic: file requires newer Go version go1.27 (application built with go1.26) The workflow installs `stable`, which now resolves to 1.27.1, so the job fails before it reaches any of this repository's code. Bump the pin to v2.13.2, which is built with go1.27. That version renames one linter and surfaces two issues the old one did not: - exhaustruct ships its v5 rewrite under a new name, and only the new name matches from v2.13 on, so the existing disable entry silently stopped applying. List both, the way gomodguard already is. - The goconst half of the nolint directive on replaceSemanticPaths no longer suppresses anything. Drop it, keep the gochecknoglobals half. - pkg/engine/helm carries upstream's canonical-import-path comment, which Go ignores in module mode. Exclude the package from modernize rather than editing a file whose whole point is staying close to upstream. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin --- .github/workflows/pr.yml | 2 +- .golangci.yml | 16 ++++++++++++++++ pkg/engine/engine.go | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d0a96a78..2ff76a6d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -43,7 +43,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v7 with: - version: v2.12.2 + version: v2.13.2 args: --timeout=10m dco: diff --git a/.golangci.yml b/.golangci.yml index 22e96969..4cd729e3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,16 @@ linters: default: all disable: - depguard + # exhaustruct: v2.13 ships the v5 rewrite under a new name and keeps + # both generations enabled under `default: all`, so disabling one + # leaves the other reporting. Both names are needed. + # + # This pins a floor: `run` on v2.12.2 dies with + # `unknown linters: 'exhaustruct_v5'` before it analyses anything + # (`config verify` does not catch it). That matches the version this + # repository pins in CI, so a local binary has to keep up with it. - exhaustruct + - exhaustruct_v5 - gochecknoinits - wsl - lll @@ -135,6 +144,13 @@ linters: # failed for the same reason. Disable goconst on test files. - goconst path: _test\.go + # pkg/engine/helm is a copy of helm.sh/helm/v4/pkg/engine kept close + # to upstream so it can be re-synced. Its doc.go carries upstream's + # canonical-import-path comment, which Go ignores in module mode; + # rewriting it would buy nothing and add a diff against upstream. + - linters: + - modernize + path: pkg/engine/helm/ formatters: enable: diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 31f113c4..3b6492e3 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -935,7 +935,7 @@ func pruneBodyIdentitiesAgainstRendered(body, rendered []byte) ([]byte, bool, er // upstream replace then leaves rendered untouched. Skipping kicks in // only on the partial-edit branches below the deep-equal check. // -//nolint:gochecknoglobals,goconst // immutable lookup table consulted by pruneIdenticalKeysAt; init-time literal, never mutated. The second occurrence of each path string is in the docstring above (where it documents the v1alpha1 merge behaviour); making it a const just to satisfy goconst would split documentation from data without runtime benefit. +//nolint:gochecknoglobals // immutable lookup table consulted by pruneIdenticalKeysAt; init-time literal, never mutated. var replaceSemanticPaths = map[string]struct{}{ "cluster/network/podSubnets": {}, "cluster/network/serviceSubnets": {}, From a6e7dc92112ced1e2951b8c15403efd2483ea4e9 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Mon, 7 Sep 2026 00:07:13 +0000 Subject: [PATCH 2/2] build: require Go 1.27 CI already builds and tests with `stable`, which resolves to 1.27.1, so the go directive was the last thing still naming 1.26. Building from source now needs a 1.27 toolchain. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index dcfdcb30..20853e02 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cozystack/talm -go 1.26.5 +go 1.27.1 // Kubernetes dependencies sharing the same version. require (