Skip to content

bump golangci-lint to v2#1167

Merged
istio-testing merged 5 commits intoistio:masterfrom
zirain:golangci-lint-v2
Apr 10, 2025
Merged

bump golangci-lint to v2#1167
istio-testing merged 5 commits intoistio:masterfrom
zirain:golangci-lint-v2

Conversation

@zirain
Copy link
Copy Markdown
Member

@zirain zirain commented Apr 8, 2025

No description provided.

@zirain zirain requested a review from a team as a code owner April 8, 2025 01:40
@istio-testing istio-testing added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 8, 2025
@howardjohn howardjohn added the do-not-merge/hold Block automatic merging of a PR. label Apr 9, 2025
Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with hold for the tools change to land

@zirain zirain removed the do-not-merge/hold Block automatic merging of a PR. label Apr 10, 2025
@istio-testing istio-testing merged commit c4bd2fb into istio:master Apr 10, 2025
3 checks passed
@zirain zirain deleted the golangci-lint-v2 branch April 10, 2025 01:10
@dhawton
Copy link
Copy Markdown
Member

dhawton commented Apr 18, 2025

For note, this completely breaks istio.io importing tests from istio/istio.

@zirain
Copy link
Copy Markdown
Member Author

zirain commented Apr 18, 2025

can you share me the link?

@dhawton
Copy link
Copy Markdown
Member

dhawton commented Apr 18, 2025

can you share me the link?

No, cause the step has to run locally to create the PR. And istio.io isn't setup for overrides so I'm trying to figure out how to fix it and where in the tooling this all lies. However, since this what linting now shows when I try to do the branch cutting in istio.io:

tests/setup/profile-ambient/doc_test.go:39:18: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func setupConfig(ctx resource.Context, cfg *istio.Config) {
                 ^
tests/setup/profile-ambient/doc_test.go:19:2: import 'istio.io/istio.io/pkg/test/istioio' is not allowed from list 'Main' (depguard)
        "istio.io/istio.io/pkg/test/istioio"
        ^
tests/setup/profile-ambient/doc_test.go:20:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
tests/setup/profile-ambient/doc_test.go:21:2: import 'istio.io/istio/pkg/test/framework/components/istio' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/components/istio"
        ^
tests/setup/profile-ambient/doc_test.go:22:2: import 'istio.io/istio/pkg/test/framework/resource' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/resource"
        ^
tests/setup/profile-default/doc_test.go:39:18: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func setupConfig(ctx resource.Context, cfg *istio.Config) {
                 ^
tests/setup/profile-default/doc_test.go:19:2: import 'istio.io/istio.io/pkg/test/istioio' is not allowed from list 'Main' (depguard)
        "istio.io/istio.io/pkg/test/istioio"
        ^
tests/setup/profile-default/doc_test.go:20:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
tests/setup/profile-default/doc_test.go:21:2: import 'istio.io/istio/pkg/test/framework/components/istio' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/components/istio"
        ^
tests/setup/profile-default/doc_test.go:22:2: import 'istio.io/istio/pkg/test/framework/resource' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/resource"
        ^
tests/setup/profile-demo/doc_test.go:39:18: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func setupConfig(ctx resource.Context, cfg *istio.Config) {
                 ^
tests/setup/profile-demo/doc_test.go:19:2: import 'istio.io/istio.io/pkg/test/istioio' is not allowed from list 'Main' (depguard)
        "istio.io/istio.io/pkg/test/istioio"
        ^
tests/setup/profile-demo/doc_test.go:20:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
tests/setup/profile-demo/doc_test.go:21:2: import 'istio.io/istio/pkg/test/framework/components/istio' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/components/istio"
        ^
tests/setup/profile-demo/doc_test.go:22:2: import 'istio.io/istio/pkg/test/framework/resource' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/resource"
        ^
tests/setup/profile-minimal/doc_test.go:39:18: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func setupConfig(ctx resource.Context, cfg *istio.Config) {
                 ^
tests/setup/profile-minimal/doc_test.go:19:2: import 'istio.io/istio.io/pkg/test/istioio' is not allowed from list 'Main' (depguard)
        "istio.io/istio.io/pkg/test/istioio"
        ^
tests/setup/profile-minimal/doc_test.go:20:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
tests/setup/profile-minimal/doc_test.go:21:2: import 'istio.io/istio/pkg/test/framework/components/istio' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/components/istio"
        ^
tests/setup/profile-minimal/doc_test.go:22:2: import 'istio.io/istio/pkg/test/framework/resource' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/resource"
        ^
tests/setup/profile-none/doc_test.go:19:2: import 'istio.io/istio.io/pkg/test/istioio' is not allowed from list 'Main' (depguard)
        "istio.io/istio.io/pkg/test/istioio"
        ^
tests/setup/profile-none/doc_test.go:20:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
pkg/test/istioio/script.go:90:12: G306: Expect WriteFile permissions to be 0600 or less (gosec)
        if err := os.WriteFile(path.Join(ctx.WorkDir(), fileName), []byte(command), 0o644); err != nil {
                  ^
pkg/test/istioio/snapshot_validator.go:64:12: G306: Expect WriteFile permissions to be 0600 or less (gosec)
        if err := os.WriteFile(inBeforeFileCopy, inBeforeBytes, os.ModePerm); err != nil {
                  ^
pkg/test/istioio/snapshot_validator.go:94:13: G306: Expect WriteFile permissions to be 0600 or less (gosec)
                if err := os.WriteFile(diffFile, []byte(diffText), os.ModePerm); err != nil {
                          ^
pkg/test/istioio/snapshotter.go:61:12: G306: Expect WriteFile permissions to be 0600 or less (gosec)
        if err := os.WriteFile(outputFile, []byte(snapshotJSON), os.ModePerm); err != nil {
                  ^
pkg/test/istioio/framework.go:92:22: unused-parameter: parameter 'info' seems to be unused, consider removing or renaming it as _ (revive)
                        func(path string, info os.FileInfo, walkError error) error {
                                          ^
pkg/test/istioio/builder.go:21:2: import 'istio.io/istio/pkg/test/env' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/env"
        ^
pkg/test/istioio/builder.go:22:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
pkg/test/istioio/builder.go:23:2: import 'istio.io/istio/pkg/test/scopes' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/scopes"
        ^
pkg/test/istioio/framework.go:28:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
pkg/test/istioio/framework.go:29:2: import 'istio.io/istio/pkg/test/scopes' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/scopes"
        ^
pkg/test/istioio/script.go:27:2: import 'istio.io/istio/pkg/log' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/log"
        ^
pkg/test/istioio/script.go:28:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
pkg/test/istioio/script.go:29:2: import 'istio.io/istio/pkg/test/scopes' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/scopes"
        ^
pkg/test/istioio/snapshot.go:26:2: import 'k8s.io/apimachinery/pkg/apis/meta/v1' is not allowed from list 'Main' (depguard)
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
        ^
pkg/test/istioio/snapshot.go:27:2: import 'k8s.io/apimachinery/pkg/runtime/schema' is not allowed from list 'Main' (depguard)
        "k8s.io/apimachinery/pkg/runtime/schema"
        ^
pkg/test/istioio/snapshot.go:29:2: import 'istio.io/istio/pkg/config/schema/gvr' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/config/schema/gvr"
        ^
pkg/test/istioio/snapshot.go:30:2: import 'istio.io/istio/pkg/kube' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/kube"
        ^
pkg/test/istioio/snapshot.go:31:2: import 'istio.io/istio/pkg/test/scopes' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/scopes"
        ^
pkg/test/istioio/snapshot_validator.go:23:2: import 'github.com/pmezard/go-difflib/difflib' is not allowed from list 'Main' (depguard)
        "github.com/pmezard/go-difflib/difflib"
        ^
pkg/test/istioio/snapshot_validator.go:25:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
pkg/test/istioio/snapshot_validator.go:26:2: import 'istio.io/istio/pkg/test/scopes' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/scopes"
        ^
pkg/test/istioio/snapshot_validator.go:27:2: import 'istio.io/istio/pkg/test/util/retry' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/util/retry"
        ^
pkg/test/istioio/snapshotter.go:21:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
pkg/test/istioio/snapshotter.go:22:2: import 'istio.io/istio/pkg/test/scopes' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/scopes"
        ^
pkg/test/istioio/step.go:17:8: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
import "istio.io/istio/pkg/test/framework"
       ^
pkg/test/istioio/util.go:23:2: import 'k8s.io/client-go/tools/clientcmd' is not allowed from list 'Main' (depguard)
        "k8s.io/client-go/tools/clientcmd"
        ^
pkg/test/istioio/util.go:25:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
pkg/test/istioio/util.go:26:2: import 'istio.io/istio/pkg/test/framework/components/environment/kube' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/components/environment/kube"
        ^
pkg/test/istioio/snapshot.go:144:1: The line is 123 characters long, which exceeds the maximum of 120 characters. (lll)
                                if services, err := client.Kube().CoreV1().Services(namespace).List(context.TODO(), metav1.ListOptions{}); err != nil {
^
pkg/test/istioio/snapshot.go:154:1: The line is 129 characters long, which exceeds the maximum of 120 characters. (lll)
                                if deployments, err := client.Kube().AppsV1().Deployments(namespace).List(context.TODO(), metav1.ListOptions{}); err != nil {
^
pkg/test/istioio/snapshot.go:174:1: The line is 129 characters long, which exceeds the maximum of 120 characters. (lll)
                                if replicaSets, err := client.Kube().AppsV1().ReplicaSets(namespace).List(context.TODO(), metav1.ListOptions{}); err != nil {
^
pkg/test/istioio/snapshot.go:184:1: The line is 127 characters long, which exceeds the maximum of 120 characters. (lll)
                                if daemonSets, err := client.Kube().AppsV1().DaemonSets(namespace).List(context.TODO(), metav1.ListOptions{}); err != nil {
^
pkg/test/istioio/snapshot.go:251:1: The line is 138 characters long, which exceeds the maximum of 120 characters. (lll)
                        err := client.Kube().AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.TODO(), metav1.ListOptions{}); err != nil {
^
pkg/test/istioio/snapshot.go:262:1: The line is 140 characters long, which exceeds the maximum of 120 characters. (lll)
                        err := client.Kube().AdmissionregistrationV1().ValidatingWebhookConfigurations().List(context.TODO(), metav1.ListOptions{}); err != nil {
^
tests/setup/dualstack/doc_test.go:39:18: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func setupConfig(ctx resource.Context, cfg *istio.Config) {
                 ^
tests/setup/dualstack/doc_test.go:19:2: import 'istio.io/istio.io/pkg/test/istioio' is not allowed from list 'Main' (depguard)
        "istio.io/istio.io/pkg/test/istioio"
        ^
tests/setup/dualstack/doc_test.go:20:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"
        ^
tests/setup/dualstack/doc_test.go:21:2: import 'istio.io/istio/pkg/test/framework/components/istio' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/components/istio"
        ^
tests/setup/dualstack/doc_test.go:22:2: import 'istio.io/istio/pkg/test/framework/resource' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework/resource"
        ^
tests/setup/multicluster/doc_test.go:19:2: import 'istio.io/istio.io/pkg/test/istioio' is not allowed from list 'Main' (depguard)
        "istio.io/istio.io/pkg/test/istioio"
        ^
tests/setup/multicluster/doc_test.go:20:2: import 'istio.io/istio/pkg/test/framework' is not allowed from list 'Main' (depguard)
        "istio.io/istio/pkg/test/framework"

@zirain
Copy link
Copy Markdown
Member Author

zirain commented Apr 18, 2025

it's suprised that make lint didn't failed on istio.io repo.

@dhawton
Copy link
Copy Markdown
Member

dhawton commented Apr 18, 2025

it's suprised that make lint didn't failed on istio.io repo.

Because the lint that uses golangci-lint is only run when the go files are changed, which is basically at branch cut, which is the absolute WORST time for big things like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants