Conversation
How to use the Graphite Merge QueueAdd the label main-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
e37d263 to
46058f9
Compare
1bceebb to
63a88ca
Compare
07b502a to
1441c11
Compare
1441c11 to
bcc56f4
Compare
Graphite Automations"Add anton/matt/sergey/kristina as reviwers on operator PRs" took an action on this PR • (03/05/26)2 reviewers were added to this PR based on Anton Bykov's automation. |
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive linting and static analysis configuration to the repository. It introduces a .golangci.yaml configuration file for golangci-lint v2, updates the pre-commit hook to use golangci-lint instead of make fmt vet, adds linting Make targets, and restructures the build.yaml CI workflow (renamed to "CI") to run lint, deadcode analysis, govulncheck, and tests as separate parallel jobs. Additionally, all GitHub Actions workflows are updated to use actions/checkout@v6 and actions/setup-go@v6.
Changes:
- Added
.golangci.yamlwith golangci-lint v2 configuration including linters (errcheck, govet, staticcheck, unused, misspell, gocritic) and exclusions for Kubernetes controller complexity - Restructured
.github/workflows/build.yamlfrom a singlebuildjob into four parallel jobs (lint,static-checks,security,test) and bumped all action versions (actions/checkout@v6,actions/setup-go@v6) across all workflows - Added Makefile lint targets (
lint,lint-go,lint-deadcode,lint-govulncheck,lint-fix) and updated.pre-commit-config.yamlto use golangci-lint
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.golangci.yaml |
New golangci-lint v2 configuration file with linter settings and exclusions |
.pre-commit-config.yaml |
Replaced make fmt vet hook with golangci-lint pre-commit hook |
Makefile |
Added lint-related Make targets for golangci-lint, deadcode, govulncheck, and auto-fix |
.github/workflows/build.yaml |
Renamed to "CI", split single build job into lint/static-checks/security/test parallel jobs |
.github/workflows/conventional-commits.yaml |
Bumped actions/checkout from v4 to v6 |
.github/workflows/dagger_ci_on_merge_queue_plan.yaml |
Bumped actions/checkout from v4 to v6 in all checkout steps |
.github/workflows/helm_lint.yaml |
Bumped actions/checkout from v4 to v6 |
.github/workflows/package.yaml |
Bumped actions/checkout from v4 to v6 and actions/setup-go from v5 to v6 |
.github/workflows/run_upgrade_test.yaml |
Bumped actions/checkout from v4 to v6 and actions/setup-go from v5 to v6 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| # Kubernetes controllers often have long functions due to reconciliation logic | ||
| rules: | ||
| - path: internal/controllers/ | ||
| text: "cognitive complexity|cyclomatic complexity" | ||
| linters: | ||
| - gocritic | ||
|
|
||
| issues: | ||
| max-issues-per-linter: 0 | ||
| max-same-issues: 0 |
There was a problem hiding this comment.
In golangci-lint v2 configuration format (as indicated by version: "2" on line 1), issues is no longer a valid top-level section. The max-issues-per-linter and max-same-issues settings should be placed under linters.exclusions instead. This will likely produce a configuration error or be silently ignored.
The correct location would be:
linters:
exclusions:
max-issues-per-linter: 0
max-same-issues: 0| # Kubernetes controllers often have long functions due to reconciliation logic | |
| rules: | |
| - path: internal/controllers/ | |
| text: "cognitive complexity|cyclomatic complexity" | |
| linters: | |
| - gocritic | |
| issues: | |
| max-issues-per-linter: 0 | |
| max-same-issues: 0 | |
| max-issues-per-linter: 0 | |
| max-same-issues: 0 | |
| # Kubernetes controllers often have long functions due to reconciliation logic | |
| rules: | |
| - path: internal/controllers/ | |
| text: "cognitive complexity|cyclomatic complexity" | |
| linters: | |
| - gocritic |
| go vet ./... | ||
|
|
||
| .PHONY: lint | ||
| lint: lint-go lint-deadcode ## Run all linters (golangci-lint and deadcode). |
There was a problem hiding this comment.
The help text says "Run all linters (golangci-lint and deadcode)" but lint-govulncheck is also defined below and not included. The comment is misleading — it should either include lint-govulncheck as a dependency or clarify the comment to say the lint target doesn't include govulncheck (e.g., "Run fast linters" or just "Run golangci-lint and deadcode").
| lint: lint-go lint-deadcode ## Run all linters (golangci-lint and deadcode). | |
| lint: lint-go lint-deadcode ## Run golangci-lint and deadcode linters. |

No description provided.