HMS-9066: Updating go version to 1.24#21
Conversation
rverdile
left a comment
There was a problem hiding this comment.
I would do a dependency bump here: go get -u ./...
|
Getting lint errors which suggest to use the pattern to set verison is 1.24.x and i have set it to 1.24 which seems a better option to me |
|
It's a little confusing, but the linter errors are actually caused by this line here: https://github.com/content-services/tang/blob/main/.github/workflows/tang-actions.yaml#L23 It needs to be updated to a newer version of golangci-lint. I would say v2.4 to match the backend: https://github.com/content-services/content-sources-backend/blob/main/.github/workflows/content-sources-actions.yml#L51-L53 |
how do you figure it out ? that it should match with backend golangci-lint version ? |
Good question. |
|
there's a CI error. sounds like you just need to bump the action version |
63acd74 to
ef793b0
Compare
|
/retest |
0f5492c to
4127eb5
Compare
…ling - Bump Go version to 1.24 and golangci-lint to v2.4.0 in GitHub Actions workflow - Update .golangci.yaml for compatibility with golangci-lint v2 - Refactor internal/zestwrapper/rpm.go to use safer HTTP response body closing with error handling and improved logging - Switch to math/rand/v2 in pkg/tangy/queries.go for randomness, remove golang.org/x/exp/rand (deprecated) dependency - Update dependancies in go.mod and go.sum
4127eb5 to
5127acc
Compare
There seem to be ~4 different changes? But they are all in the same commit 🤔 Are they strictly connected thus being in one commit? |
internal/zestwrapper/rpm.go
Outdated
| defer func() { | ||
| if closeErr := httpResp.Body.Close(); closeErr != nil { | ||
| fmt.Printf("failed to close response body: %v\n", closeErr) | ||
| } | ||
| }() |
There was a problem hiding this comment.
We prefer to ignore this linter error. Can you update the PR to use the config from the backend? That will make sure all the right linters are turned on
@marusak They're all connected to bumping the go version and failures related to that |
Hey yes, these are connected. Updating linter version, recomended these changes which looked good to me in pkg/tangy/queries.go and internal/zestwrapper/rpm.go. Although i need to undo the changes in internal/zestwrapper/rpm.go as per |
19cef2a to
8063453
Compare
Update .golangci.yaml to match backend linter configuration to ensure all appropriate linters are enabled. - G115 - Integer overflow in pool limit: Change PoolLimit type from int to int32 to match pgxpool.Config.MaxConns, eliminating type conversion and preventing potential integer overflow. - ST1005 - Error strings should not be capitalized Fix error message capitalization in zestwrapper/rpm.go
8063453 to
115be3e
Compare
pkg/tangy/interface.go
Outdated
| dbConfig.PoolLimit = DefaultMaxPoolLimit | ||
| } | ||
| pxConfig.MaxConns = int32(dbConfig.PoolLimit) | ||
| pxConfig.MaxConns = dbConfig.PoolLimit |
There was a problem hiding this comment.
This works! but changing types here will also require changes in the backend. Let's fix this linting issue by checking the int max, instead of changing the type of dbConfig.PoolLimit to int32, like this: https://github.com/content-services/content-sources-backend/blob/93863b503e71c6bb93e10f1b2239887efc476c86/pkg/tasks/queue/pgqueue.go#L218-L220
Validate that dbConfig.PoolLimit is within 32-bit integer range (math.MinInt32 to math.MaxInt32) before converting to int32 to prevent overflow issues.
rverdile
left a comment
There was a problem hiding this comment.
looks good! going to merge and release a new version. Then you'll be able to update your backend PR
No description provided.