Repository navigation
Eliminate unused logrus replace, move to Go 1.27 and update dependencies - #30
alexanselmo wants to merge 4 commits into
Conversation
CI now reads its Go version from go.mod, so it builds with the toolchain the module declares instead of whatever ^1.13 resolves to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| go 1.20 | ||
|
|
||
| replace github.com/Sirupsen/logrus v1.4.2 => github.com/sirupsen/logrus v1.4.2 | ||
| go 1.27.4 |
There was a problem hiding this comment.
Blocking: go 1.27.4 makes 1.27.4 the minimum Go for every module that imports guac. go mod tidy in a consumer raises its own go line to match, so atc-console-prox (go 1.27.0) would move to go 1.27.4 on its next guac bump. From then on, Go 1.27.0–1.27.3 has to download 1.27.4 to build it under GOTOOLCHAIN=auto, and fails outright under GOTOOLCHAIN=local, which the official golang: images set. guac doesn't need anything from 1.27.4 that 1.27.0 lacks, since patch releases only carry fixes.
Use the same split as aws-api and atc-console-prox:
go 1.27.0
toolchain go1.27.4
Go ignores a dependency's toolchain line, so guac's own CI and local builds stay on 1.27.4 without raising the floor for consumers. I think go-version-file: go.mod reads the toolchain line, but it's worth checking the "Set up Go" step on the next run. The description's line about consumers needing 1.27.4 can go too.
There was a problem hiding this comment.
Switched to go 1.27.0 with toolchain go1.27.4 in 4178cd8 and took the 1.27.4 line out of the description. setup-go v7 reads the toolchain line as long as GOTOOLCHAIN isn't local, and the "Set up Go" step on the 8c9c263 run installed 1.27.4. I also ran the tests with GOTOOLCHAIN=local on 1.27.0 to make sure the floor builds.
| go 1.20 | ||
|
|
||
| replace github.com/Sirupsen/logrus v1.4.2 => github.com/sirupsen/logrus v1.4.2 | ||
| go 1.27.4 |
There was a problem hiding this comment.
Non-blocking: moving the go line off 1.20 also drops the 27 GODEBUG defaults Go kept for cmd/guac, so that binary's runtime behavior changes. Several touch what it does, for example tlssha1=1, tlsmlkem=0, x509negativeserial=1, httpmuxgo121=1, panicnil=1 and containermaxprocs=0. Run GOTOOLCHAIN=go1.27.4 go list -f '{{.DefaultGODEBUG}}' ./cmd/guac on master for the full list. If cmd/guac is only an example, a line in the description saying so covers it. Modules that import guac aren't affected, since their own go line sets their defaults.
There was a problem hiding this comment.
cmd/guac is the example main, and I added a paragraph to the description saying so. I also looked at what it touches. Its routes are plain paths and its TLS config sets its own CurvePreferences, so I don't expect httpmuxgo121 or tlsmlkem to change anything visible there.
|
Non-blocking: |
The go line is the minimum for every module that imports guac, and Go ignores a dependency's toolchain line. This keeps guac's own builds on 1.27.4 without moving consumers off 1.27.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ran |
There was a problem hiding this comment.
Non-blocking: line 26 still runs go get -v -t -d ./.... The 8c9c263 run logs go: -d flag is deprecated. -d=true is a no-op, and go get in CI can tidy go.mod/go.sum in the runner, so an untidy go.mod passes the build and merges unnoticed. Replace it with this, which fails on drift:
- name: Get dependencies
run: |
go mod download
go mod tidy -diffThere was a problem hiding this comment.
Non-blocking: the Gopkg.toml / dep ensure block (lines 27–30) is left over from before modules and never runs. If a Gopkg.toml ever showed up, it would pipe an install script from the archived golang/dep repo's master branch into sh. Delete it while you're in this file.
There was a problem hiding this comment.
Non-blocking: Build and Test (lines 33 and 36) only cover ., so cmd/guac is never compiled or vetted, and nothing checks gofmt, which is how config.go, doc.go and tunnel_map.go drifted. All of these pass on this branch today:
- name: Build
run: go build -v ./...
- name: Vet
run: go vet ./...
- name: gofmt
run: test -z "$(gofmt -l .)"
- name: Test
run: go test -race -v ./...
robgaston1
left a comment
There was a problem hiding this comment.
Gave one more pass using Opus just to be real safe. I think we're good, it had some cleanup items I thought you may want to know about. 👍
Fix #29
I don't believe the logrus 1.4.2 was being used, the replace line just wasn't removed last time we updated the dependencies. I also moved the module to Go 1.27 and pulled the dependencies up to their latest versions.
The
goline stays at 1.27.0 so modules that import guac aren't pushed onto a newer patch release, and thetoolchainline keeps guac's own CI and local builds on 1.27.4. CI reads its Go version from go.mod now instead of^1.13. logrus 1.10.2 is outside the affected ranges for GHSA-4f99-4q7p-p3gh.cmd/guacis the example main. Moving offgo 1.20drops the old GODEBUG settings it was built with (tlsmlkem=0,httpmuxgo121=1,panicnil=1, etc) so it runs with Go 1.27's defaults. I don't expect a visible change since its routes are plain paths and its TLS config sets its own curve list. Modules that import guac aren't affected since their owngoline sets their defaults.There's also a separate gofmt commit for
config.go,doc.goandtunnel_map.go, whitespace only.go build,go vetandgo test -racepass locally on Go 1.27.4 and on 1.27.0 withGOTOOLCHAIN=local.🤖 Generated with Claude Code