Skip to content

[release-0.9] Bump golangci-lint #2619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: release-0.9
Choose a base branch
from

Conversation

mandre
Copy link
Contributor

@mandre mandre commented Jul 14, 2025

Trying to debug CI failures in release-0.9 branch.

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 14, 2025
Copy link

netlify bot commented Jul 14, 2025

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
🔨 Latest commit 5541d6e
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-openstack/deploys/6875231167d9850008cddf1a
😎 Deploy Preview https://deploy-preview-2619--kubernetes-sigs-cluster-api-openstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 14, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign emilienm for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 14, 2025
mandre added 4 commits July 14, 2025 17:29
Golangci-lint v1.64 is the first one to support go 1.24, which is the
version of go we're now getting in the CI jobs.
We were getting an error:

    WARN The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar.
    ERRO [linters_context] exportloopref: This linter is fully inactivated: it will not produce any reports.
There were a couple of deprecation warnings after bumping golangci-lint
version:

    WARN [linters_context] copyloopvar: this linter is disabled because the Go version (1.20) of your project is lower than Go 1.22
    WARN [config_reader] The configuration option `run.skip-files` is deprecated, please use `issues.exclude-files`.
    WARN [config_reader] The configuration option `linters.gci.local-prefixes` is deprecated, please use `prefix()` inside `linters.gci.sections`.
    WARN [config_reader] The configuration option `linters.staticcheck.go` is deprecated, please use global `run.go`.
    WARN [config_reader] The configuration option `linters.stylecheck.go` is deprecated, please use global `run.go`.
Linters have picked up a couple of new offenses. Add new exclusion
rules.
@mandre mandre force-pushed the golangci-lint-0.9 branch from bfb0689 to 5541d6e Compare July 14, 2025 15:32
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 14, 2025
@mandre mandre changed the title DNM: Try bumping golangci-lint Bump golangci-lint Jul 14, 2025
@mandre mandre changed the title Bump golangci-lint [release-0.9] Bump golangci-lint Jul 14, 2025
@k8s-ci-robot
Copy link
Contributor

@mandre: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-openstack-e2e-test 5541d6e link true /test pull-cluster-api-provider-openstack-e2e-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@mandre
Copy link
Contributor Author

mandre commented Jul 14, 2025

OK, this has fixed the failure we saw with pull-cluster-api-provider-openstack-test however I'm not entirely satisfied, we should used a pinned version of go so that we don't run into issues in the future.

And there's a chance we have the same problem with the other stable branches.

@mandre
Copy link
Contributor Author

mandre commented Jul 15, 2025

I'm not getting why GOTOOLCHAIN=go1.22.8 doesn't seem to be picked up in CI.

Looking at this job failure, from #2612, we should see lines such as go: downloading go1.22.8 (linux/amd64) but we're not.

Trying to replicate locally, using the same image that is being used in CI, I'm not having the problem:

❯ podman run --rm --entrypoint /bin/bash gcr.io/k8s-staging-test-infra/kubekins-e2e:v20250613-876fb90a97-master -c "git clone https://github.com/kubernetes-sigs/cluster-api-provider-openstack.git -b release-0.9; cd cluster-api-provider-openstack; make lint"
Cloning into 'cluster-api-provider-openstack'...
make -C hack/tools bin/golangci-lint
make[1]: Entering directory '/workspace/cluster-api-provider-openstack/hack/tools'
go: downloading go1.22.8 (linux/amd64)
mkdir -p bin
./ensure-golangci-lint.sh -b bin v1.54.2
golangci/golangci-lint info checking GitHub for tag 'v1.54.2'
golangci/golangci-lint info found version: 1.54.2 for v1.54.2/linux/amd64
golangci/golangci-lint info installed bin/golangci-lint
make[1]: Leaving directory '/workspace/cluster-api-provider-openstack/hack/tools'
hack/tools/bin/golangci-lint run -v --fast=false
level=info msg="[config_reader] Config search paths: [./ /workspace/cluster-api-provider-openstack /workspace / /root]"
level=info msg="[config_reader] Used config file .golangci.yml"
level=info msg="[lintersdb] Active 47 linters: [asasalint asciicheck bidichk bodyclose cyclop dogsled dupword durationcheck errcheck exportloopref forbidigo gci goconst gocritic gocyclo godot gofmt gofumpt goheader goimports gomodguard goprintffuncname gosec gosimple govet importas ineffassign makezero misspell nakedret nestif nilerr noctx nolintlint prealloc predeclared revive rowserrcheck sqlclosecheck staticcheck stylecheck thelper unconvert unparam unused wastedassign whitespace]"
level=info msg="[loader] Using build tags: [e2e]"
level=info msg="[loader] Go packages loading at mode 575 (compiled_files|files|name|types_sizes|deps|exports_file|imports) took 1m15.404779941s"
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 24.957759ms"
level=info msg="[linters_context/goanalysis] analyzers took 10m17.610491812s with top 10 stages: buildir: 5m38.707611551s, gocritic: 1m51.410613508s, goimports: 21.745358365s, nilness: 17.55712907s, bidichk: 14.008850206s, the_only_name: 13.881633366s, fact_purity: 12.452365037s, fact_deprecated: 12.227488806s, printf: 11.328795613s, ctrlflow: 11.286286877s"
level=info msg="[runner] Issues before processing: 673, after processing: 0"
level=info msg="[runner] Processors filtering stat (out/in): filename_unadjuster: 673/673, path_prettifier: 673/673, skip_dirs: 444/444, exclude: 444/444, exclude-rules: 12/444, skip_files: 444/673, autogenerated_exclude: 444/444, cgo: 673/673, identifier_marker: 444/444, nolint: 0/12"
level=info msg="[runner] processing took 32.275576ms with stages: exclude-rules: 16.772909ms, identifier_marker: 8.539655ms, nolint: 2.725422ms, autogenerated_exclude: 2.395487ms, path_prettifier: 1.485711ms, skip_dirs: 188.504µs, skip_files: 106.865µs, cgo: 34.714µs, filename_unadjuster: 23.013µs, max_same_issues: 849ns, exclude: 456ns, fixer: 396ns, uniq_by_line: 355ns, diff: 247ns, source_code: 231ns, severity-rules: 192ns, sort_results: 170ns, max_from_linter: 140ns, max_per_file_from_linter: 92ns, path_shortener: 90ns, path_prefixer: 78ns"
level=info msg="[runner] linters took 1m1.249761493s with stages: goanalysis_metalinter: 1m1.217419716s"
level=info msg="File cache stats: 177 entries of total size 1.4MiB"
level=info msg="Memory: 1281 samples, avg is 1016.5MB, max is 4411.3MB"
level=info msg="Execution took 2m16.695956715s"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Status: Inbox
Development

Successfully merging this pull request may close these issues.

2 participants