Repository navigation
Conversation
… move to go 1.26
```shell
go get $(go run golang.org/x/vuln/cmd/govulncheck@latest -format json ./... \
| jq -r 'select(.finding.trace[0].function) | .finding | "\(.trace[0].module)@\(.fixed_version)"' \
| sort -u -V \
| awk -F@ '{ v[$1] = $2 } END { for (m in v) print m "@" v[m] }')
github.com/klauspost/compress@v1.20.2
golang.org/x/text@v0.39.0
golang.org/x/net@v0.60.0
github.com/rabbitmq/amqp091-go@v1.14.0
```
Unfortunately, this requires moving forward the minimum Go version,
all the way to 1.26. In particular,
`github.com/klauspost/compress@v1.20.2` and
`golang.org/x/text@v0.39.0` force the minimum Go version to 1.25,
`golang.org/x/net@v0.60.0` forces it to 1.26.
`github.com/rabbitmq/amqp091-go` continues to work on Go 1.20.
Trivy is slightly stricter than `vulncheck` so requires a few dependencies to be updated further. Generated by running `trivy fs --scanners vuln,secret --severity HIGH,CRITICAL .` and then running `go get`.
Since Go 1.21[0], passing `nil` to `panic()` causes its own panic. Based on the surrounding code, I think this line was a typo and should always have passed the value it just checked wasn't `nil`. 0: https://go.dev/doc/go1.21#language
The `err` field in the `policies` table was being used for two purposes - the return value of `NewTracer` and the value being passed to `panic()` in case of failure (ie what `recover()` will get). Now that the previous commit ensured `nil` can't be passed to `panic()`, expand the table to split up the two concepts and provide a specific error for the `ExtractFailurePolicyError` case.
manually updated the workflow and allowed `golangci` to migrate the config with `golangci-lint migrate`. `revive` was listed twice in the list, it remains there after the conversion.
It produced 26 complaints for test files, doesn't seem very useful to make them all use constants.
all the functions in use were just moved to the `io` package.
tests: drop Go 1.25 run; min version for updated dependencies is 1.26
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #234 +/- ##
==========================================
- Coverage 66.83% 63.78% -3.06%
==========================================
Files 36 43 +7
Lines 1770 2278 +508
==========================================
+ Hits 1183 1453 +270
- Misses 542 825 +283
+ Partials 45 0 -45 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed that CI on master fails because Trivy flags the current versions of several dependencies as having vulnerabilities. This PR updates dependencies to versions that Trivy is OK with, and updates the linter and CI config to work, and fixes some new lints discovered and a bug exposed by using Go > 1.20. Unfortunately, this required raising the minimum Go version to 1.26 (current version - 1), which specifically breaks the policy in the README of running under the two previous versions. I've not edited the policy in this PR, and I completely understand if this isn't an acceptable move. Either way, CI is green on my branch: tests, security.
They are mostly mechanical changes: I used a small script to first find the minimum dependency versions
govulncheckwas happy with (since it can check at the symbol level):I then ran
go geton the output. These updates required moving forward the minimum Go version, all the way to 1.26. In particular,github.com/klauspost/compress@v1.20.2andgolang.org/x/text@v0.39.0force the minimum Go version to 1.25,golang.org/x/net@v0.60.0forces it to 1.26.github.com/rabbitmq/amqp091-gocontinues to work on Go 1.20.Trivy then wanted two more updates (
x/net-> 0.62.0, andgrpc-> 1.83.2, which requiredprotobuf-> 1.36.11) - since it works at the module version level not the symbol level - but that didn't move the minimum Go version beyond 1.26.The rest of the changes:
golangci-lintneeded to be updated to a version that could run under Go 1.26 and Go 1.27, and it mechanically updated its own config (one commit)This would also supersede #232 .