Makefile: Move Go tools into tools module#407
Makefile: Move Go tools into tools module#407timflannagan wants to merge 1 commit intoagentregistry-dev:mainfrom
Conversation
We moved executable Go tooling into a dedicated tools module and wired make targets and scripts to run tools through go tool with a modfile override. The lint workflow now runs our make targets directly and no longer depends on the third-party golangci action. This also committed formatter changes from golangci-lint --fix so the tree matches the new lint behavior.
| # Use kind via go tool directives (tools/go.mod) so no separate install step is needed. | ||
| # Override KIND to use a different binary or command. | ||
| TOOLS_MODFILE="${TOOLS_MODFILE:-${REPO_ROOT}/tools/go.mod}" | ||
| KIND="${KIND:-go tool -modfile=${TOOLS_MODFILE} kind}" | ||
| read -r -a KIND_TOOL <<<"${KIND}" |
There was a problem hiding this comment.
TODO: AI generated, but this should be improved.
|
|
||
| go 1.25.7 | ||
|
|
||
| tool ( |
There was a problem hiding this comment.
We should add helm as well in the future
| with: | ||
| version: v2.8.0 | ||
| - name: Lint Go | ||
| run: make lint |
There was a problem hiding this comment.
TODO: Override the arg variable since --fix is enabled by default
There was a problem hiding this comment.
Pull request overview
This PR relocates executable Go tooling (kind, gotestsum, golangci-lint) into a dedicated tools Go module and updates local/CI entrypoints to invoke tools via go tool with a -modfile override, eliminating the previously broken lint target.
Changes:
- Add a
tools/Go module (tools/go.mod,tools/go.sum) to manage Go tool dependencies viatool (...). - Update
Makefileandscripts/kind/setup-kind.shto runkind,gotestsum, andgolangci-lintvia the tools module (-modfile=tools/go.mod). - Simplify the Go lint GitHub workflow to run
make lintinstead of usinggolangci-lint-action.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tools/go.mod |
Introduces a dedicated tools module and declares tool executables in tool (...). |
tools/go.sum |
Adds the dependency lockfile for the tools module. |
Makefile |
Wires tool execution through go tool -modfile=tools/go.mod and updates Kind/lint/mod targets accordingly. |
scripts/kind/setup-kind.sh |
Uses the tools module modfile when invoking kind, with override support. |
.github/workflows/lint.yml |
Replaces the third-party golangci action with make lint. |
go.mod |
Removes tool declarations from the root module and adjusts indirect deps accordingly. |
go.sum |
Drops sums for deps that moved out of the root module. |
internal/cli/mcp/frameworks/python/generator.go |
Switches from WriteString(fmt.Sprintf(...)) to fmt.Fprintf(...). |
internal/cli/agent/tui/mcp_wizard.go |
Switches from WriteString(fmt.Sprintf(...)) to fmt.Fprintf(...). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| gotest.tools/v3 v3.5.2 // indirect | ||
| k8s.io/klog/v2 v2.130.1 // indirect | ||
| k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect | ||
| mvdan.cc/sh/v3 v3.7.0 // indirect | ||
| sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect | ||
| sigs.k8s.io/kind v0.31.0 // indirect | ||
| sigs.k8s.io/randfill v1.0.0 // indirect | ||
| sigs.k8s.io/release-utils v0.6.0 // indirect | ||
| sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect | ||
| sigs.k8s.io/yaml v1.6.0 // indirect | ||
| ) |
There was a problem hiding this comment.
This PR removes the root-module tool (...) entries for sigs.k8s.io/kind, but e2e/e2e_test.go still checks for Kind via go tool kind version. After this change, that prerequisite check will fail unless the user already has kind installed globally. Consider updating the e2e prerequisite check to run Kind via the tools module (e.g., using go tool -modfile=tools/go.mod kind ...) or otherwise sourcing the same command path used by the Makefile/scripts.
Description
We moved executable Go tooling into a dedicated tools module and wired make targets and scripts to run tools through go tool with a modfile override.
The lint workflow now runs our make targets directly and no longer depends on the third-party golangci action. This also committed formatter changes from golangci-lint --fix so the tree matches the new lint behavior.
Fixes #377
Change Type
/kind cleanup
Changelog
Additional Notes