Repository navigation
chore: perform tool cleanup - #2726
thompson-tomo wants to merge 12 commits into
Conversation
yuminn-k
left a comment
There was a problem hiding this comment.
Nice cleanup, the removed tools aren't referenced anywhere else in the repo.
Two things about the govulncheck change:
GOOS=linux GOARCH=$(GOARCH) go tool govulncheck also builds govulncheck itself for linux/$(GOARCH). In cmd/go only built-in tools are forced to the host platform; tools from a tool directive are built like go run. I tried make govulncheck on macOS (arm64): on this branch it fails with go tool govulncheck: fork/exec .../govulncheck: exec format error, while on main it runs the scan. It would be the same anywhere the host isn't linux/$(GOARCH). CI is linux/amd64 so it doesn't show up there. contrib clears GOOS/GOARCH for the tool build for this reason: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/b83eb00d069d77f9bd77c6c247dfcdaa3628cdc9/Makefile.Common#L84-L88
The committed go.work is now what lets go tool find govulncheck from collector/, but it also has to keep its go line >= every module's go line. Renovate's gomod manager only tracks go.mod, so I'm not sure go.work would get bumped along with the modules in a go directive PR (e.g. the 1.27.0 one waiting on the dashboard). If it doesn't, CI would fail the same way an earlier run on this PR did. collector and contrib both use go tool -modfile=internal/tools/go.mod ... and don't commit a go.work. Would that work here so we can drop go.work?
Unrelated to this change, but since golangci-lint is kept: it doesn't build in the tools module right now. make install-tools on this branch fails with undefined: goheader.Configuration, because go-header was bumped to v1.0.1 by the lock file PRs while golangci-lint v2.15.0 expects v0.5.0. So make golint and make goporto still can't run. Not blocking, just flagging.
Just to confirm, this is a pre-existing issue.
Go.work is recommended by the collector development/contributing guidelines. If renovate doesn't bump go.work (which i suspect is the case), we will add config to manage it & raise an issue in renovate repo. |
Go through and tidy up tools, removing those that are un-necessary/not used by collector.
Summary of the tools purpose from copilot