Skip to content

chore: upgrade go version to 1.24.4 and golangci-lint to 2.1.6 #204

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

Merged
merged 1 commit into from
Jun 17, 2025

Conversation

slashpai
Copy link
Member

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 17, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 17, 2025
@slashpai
Copy link
Member Author

cc @RainbowMango

@RainbowMango
Copy link
Member

This is most likely duplicated with #203.

@slashpai
Copy link
Member Author

This is most likely duplicated with #203.

ok I didn't see that, I was updating prometheus-adapter so found need to update dependencies here as well.
In this PR I have updated go version as well bumped k8s dependencies to v0.33.1

@RainbowMango
Copy link
Member

Maybe you can help to review that PR, and after that the dependent bot can help to bump to 1.33.1, and then this PR can focus on prometheus-adapter thing.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2025
@slashpai
Copy link
Member Author

I will rebase to just update go

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 17, 2025
@slashpai slashpai changed the title chore: upgrade go version to 1.24.3 and k8s dependencies to v0.33.1 chore: upgrade go version to 1.24.3 and golangci-lint to 2.1.6 May 17, 2025
@slashpai
Copy link
Member Author

@RainbowMango PTAL

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/assign

@slashpai
Copy link
Member Author

Lint file has been updated by running the command from https://golangci-lint.run/product/migration-guide

@RainbowMango
Copy link
Member

I know that migration tool, it changes things sometimes as I mentioned above, removed the timeout setting and removed the typecheck linter.

@slashpai
Copy link
Member Author

Sure let me review again

@richabanker
Copy link

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 29, 2025
@RainbowMango
Copy link
Member

@slashpai any update?

I'm going to tag a new release for the Kubernetes v1.33, it would be great to have this.

@slashpai
Copy link
Member Author

slashpai commented Jun 4, 2025

I will have it updated this week, was a bit occupied so couldn't look into this

@RainbowMango RainbowMango mentioned this pull request Jun 4, 2025
1 task
@RainbowMango
Copy link
Member

Hi @slashpai Kindly ping? We are waiting for this PR to cut the v1.33.0 release.
What I'm expected from this like:

diff --git a/.golangci.yml b/.golangci.yml
index 7f712891..5473cc79 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,6 +1,7 @@
 version: "2"
+run:
+  timeout: 7m
 linters:
-  default: none
   enable:
     - bodyclose
     - copyloopvar
@@ -25,6 +26,11 @@ linters:
     misspell:
       ignore-rules:
         - creater
+    staticcheck:
+      checks:
+        - all
+        # Disable QF1008 to retain embedded fields for better readability.
+        - "-QF1008"
   exclusions:
     generated: lax
     presets:
diff --git a/pkg/apiserver/endpoints/handlers/get.go b/pkg/apiserver/endpoints/handlers/get.go
index fa0920c1..1ce71623 100644
--- a/pkg/apiserver/endpoints/handlers/get.go
+++ b/pkg/apiserver/endpoints/handlers/get.go
@@ -181,5 +181,5 @@ func getRequestOptions(req *http.Request, scope handlers.RequestScope, into runt
                newQuery[subpathKey] = []string{p}
                query = newQuery
        }
-       return scope.DecodeParameters(query, scope.Kind.GroupVersion(), into)
+       return scope.ParameterCodec.DecodeParameters(query, scope.Kind.GroupVersion(), into)
 }
(END)
     generated: lax
     presets:
diff --git a/pkg/apiserver/endpoints/handlers/get.go b/pkg/apiserver/endpoints/handlers/get.go
index fa0920c1..1ce71623 100644
--- a/pkg/apiserver/endpoints/handlers/get.go
+++ b/pkg/apiserver/endpoints/handlers/get.go
@@ -181,5 +181,5 @@ func getRequestOptions(req *http.Request, scope handlers.RequestScope, into runt
                newQuery[subpathKey] = []string{p}
                query = newQuery
        }
-       return scope.DecodeParameters(query, scope.Kind.GroupVersion(), into)
+       return scope.ParameterCodec.DecodeParameters(query, scope.Kind.GroupVersion(), into)
 }

@slashpai slashpai changed the title chore: upgrade go version to 1.24.3 and golangci-lint to 2.1.6 chore: upgrade go version to 1.24.4 and golangci-lint to 2.1.6 Jun 16, 2025
@@ -109,7 +109,7 @@ func (b *AdapterBase) InstallFlags() {
b.CustomMetricsAdapterServerOptions = options.NewCustomMetricsAdapterServerOptions()
}

b.CustomMetricsAdapterServerOptions.AddFlags(b.FlagSet)
b.AddFlags(b.FlagSet)
Copy link
Member Author

Choose a reason for hiding this comment

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

@RainbowMango Let me know if these changes ok, these were suggested by linter

Copy link
Member

Choose a reason for hiding this comment

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

We don't need this change as we disabled the check

       # Disable QF1008 to retain embedded fields for better readability.
       - "-QF1008"

@slashpai
Copy link
Member Author

sorry for taking long was on unplanned PTO, I have addressed review comments. Please take a look again

@slashpai
Copy link
Member Author

@RainbowMango PTAL updated with changes

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
Thanks

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 17, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango, slashpai

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 17, 2025
@k8s-ci-robot k8s-ci-robot merged commit 5da93b5 into kubernetes-sigs:master Jun 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants