Skip to content

chore: perform tool cleanup - #2726

Open
thompson-tomo wants to merge 12 commits into
open-telemetry:mainfrom
thompson-tomo:tool-cleanup
Open

thompson-tomo wants to merge 12 commits into
open-telemetry:mainfrom
thompson-tomo:tool-cleanup

Conversation

@thompson-tomo

@thompson-tomo thompson-tomo commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Go through and tidy up tools, removing those that are un-necessary/not used by collector.

Summary of the tools purpose from copilot

Tool Purpose Status
golangci-lint Popular Go linting aggregator that runs many linters together and reports code quality issues. Retained
addlicense Adds or updates licence headers in source files automatically. Retained
impi Organises and formats Go import statements according to project rules. Removed
ghr Uploads release assets to GitHub Releases from scripts and CI pipelines. Removed
gocovmerge Merges multiple Go coverage profiles into a single report. Removed
chloggen OpenTelemetry tool for generating and maintaining changelog entries. Removed
semconvgen Generates code and documentation from OpenTelemetry Semantic Convention definitions. Removed
apidiff Compares two versions of a Go package API and reports breaking or behavioural changes. Retained
goimports Formats Go source code and automatically manages import statements. Often used instead of gofmt. Retained
porto Go package dependency analysis and repository maintenance tool used in some Go projects. Retained
multimod Helps manage repositories containing multiple Go modules. Retained
crosslink OpenTelemetry documentation utility that validates and generates cross-links between docs. Retained
govulncheck Official Go vulnerability scanner that checks dependencies and code against the Go vulnerability database. Retained

@thompson-tomo
thompson-tomo requested a review from a team as a code owner November 6, 2026 04:25
@github-actions github-actions Bot added the go Pull requests that update Go code label Nov 6, 2026

@yuminn-k yuminn-k left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@thompson-tomo

Copy link
Copy Markdown
Contributor Author

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

Just to confirm, this is a pre-existing issue.

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?

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.

@thompson-tomo thompson-tomo moved this from Todo to Need more Approval in Lambda Triage Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Projects

Status: Need more Approval

Development

Successfully merging this pull request may close these issues.

2 participants