-
Notifications
You must be signed in to change notification settings - Fork 1.5k
build: bump Go version requirement to 1.24 #7839
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
build: bump Go version requirement to 1.24 #7839
Conversation
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ec1444e to
ea1558a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Thanks for another fine contribution to OPA, Ville! Just a question about the nolint directive, but not a blocker as far as I'm concerned.
internal/wasm/sdk/opa/opa_test.go
Outdated
| data := parseJSON(eval.NewData) | ||
| if err := instance.SetPolicyData(ctx, policy, data); err != nil { | ||
| t.Errorf(err.Error()) | ||
| t.Errorf("%s", err.Error()) //nolint:govet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the linter complaining about here? Isn't that fixed by the change?
Same question goes for all lines with //nolint:govet directives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right! I re-ran the linter and it worked just fine without them. Likely caused by a false positive/cache issue. Pushed a fix now.
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| t.Chdir(rootDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat 👍
Go 1.23 is no longer supported as per Go release policy. Changes: - Use Go v1.24.6 as the project SDK requirement Signed-off-by: Ville Vesilehto <[email protected]>
Signed-off-by: Ville Vesilehto <[email protected]>
Fix "non-constant format string in call" issues as seen in CI. Signed-off-by: Ville Vesilehto <[email protected]>
Replace t.Error() call from goroutine with error channel communication to prevent "Fail in goroutine after test completion" panic on Go 1.21 with ubuntu-24.04 by the "Go compat build/test" Github Actions workflow. The race occurred when oneShot() errors were reported after the main test goroutine completed. Signed-off-by: Ville Vesilehto <[email protected]>
e8d24aa to
6f49636
Compare
Inadvertently added due to false positives. Signed-off-by: Ville Vesilehto <[email protected]>
6f49636 to
983fe27
Compare
|
Excellent! There's likely a few more things we can benefit from with 1.24, but this is a very reasonable limit for the scope of this change. Thank you for this! |
|
For libraries, it's a best practice to specify the lowest version of Go you depend on and let consumers build with the latest version of Go. It doesn't matter that 1.23 is no longer supported, it's up to dependents to build with a supported version. By specifying If you're aren't using any language features of Go 1.24, you could downgrade back to 1.23 or maybe even an older version. If you are using language features, can you specify |
|
OPA isn't a "library" per se, and the decision about which Go version to use tries to account for both API consumers and the needs of the application itself. Using |
|
I've filed #7879, thanks! |
Why the changes in this PR are needed?
Go 1.23 is no longer supported as per Go release policy.
What are the changes in this PR?
This PR bumps the Go version requirement to the latest 1.24.6, also matching the toolchain version.
Notes to assist PR review:
Further comments:
I also looked into bumping the toolchain version to 1.25.0 and using the latest
golangci-lint. As it implies a linter config migration to v1 and v2 with a ton of changes, I decided to just keep the PR at 1.24.