Skip to content

build: track Makefile Go tool pins in a nested tools module - #294

Draft
asivanadi0 wants to merge 2 commits into
NVIDIA:mainfrom
asivanadi0:cursor/tools-go-dependabot-pins-17d0
Draft

build: track Makefile Go tool pins in a nested tools module#294
asivanadi0 wants to merge 2 commits into
NVIDIA:mainfrom
asivanadi0:cursor/tools-go-dependabot-pins-17d0

Conversation

@asivanadi0

Copy link
Copy Markdown

Closes #279

Draft of the tools.go / Dependabot work. Issue-first: waiting on maintainer ack (especially the go.mod expansion). See asivanadi0#1 for the full test plan.

@copy-pr-bot

copy-pr-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@mchmarny mchmarny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment: 1 MAJOR, 1 MINOR against e62cc58. Reviewed against a base of ce70f5f; the workflow comment hunks still apply to main.

Comment thread go.mod Outdated
volcano.sh/apis v1.15.1 // indirect
)

tool (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

MAJOR: Putting the tool chain in the root module raises the require count from 103 to 305 — golangci-lint's tree, almost all // indirect. This module is importable: consumers use api/v1alpha1 for the CRD types, so every consumer's module graph inherits those 200 entries and MVS considers their versions when resolving shared dependencies.

That cost is not needed to get the automation. A nested tools/go.mod keeps tool dependencies out of the root graph entirely, and Dependabot reaches it with a second gomod entry using directory: /tools. The Makefile's gomodver call changes only which file it reads.

Worth deciding before merge rather than after: once a consumer pins a version of this module, the published graph is what they resolved against.

Minimum correction: either move the tool requires to a nested tools/go.mod with a matching Dependabot directory entry, or state in the PR why the root-module graph is the accepted trade-off.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moved the tool dependencies into a nested tools/go.mod and added a Dependabot gomod entry at directory: /tools. Root module is back to 103 requires, so the tool graph stays out of consumers importing api/v1alpha1.

Comment thread tools/tools.go Outdated
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

//go:build tools

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

MINOR: With the tool ( block present in go.mod, this build-tagged blank-import file looks redundant. tool directives are the Go 1.24+ mechanism and go mod tidy retains the requires they name; the //go:build tools pattern is what they replaced. This file's own comment says the tool lines are what keep tidy from dropping the requires, which argues the same thing.

Minimum correction: delete the file, run go mod tidy, and confirm the six requires survive. If they do, this also reverts the tools addition to the addlicense path list in the Makefile.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Deleted tools/tools.go, ran go mod tidy in the tools module, and confirmed all six tool requires survive as indirect requirements. Also removed tools from the addlicense path list.

The Makefile pinned six Go CLIs as hard-coded *_VERSION variables that no
Dependabot ecosystem parses, so they were bumped by hand and only noticed
during release prep.

Put the pins in a nested tools/go.mod as `tool` directives and have the
Makefile read them with gomodver, which now takes an optional module
directory. A second `gomod` entry with `directory: /tools` brings them under
Dependabot on the same weekly schedule and cooldown as the root module.

The tool chain lives in its own module rather than the root one on purpose.
This module is importable -- consumers use api/v1alpha1 for the CRD types --
and golangci-lint's tree alone would take the root module from 103 requires
to ~305, nearly all indirect. Every consumer would inherit that graph and MVS
would weigh those versions when resolving shared dependencies. A nested
module keeps them out entirely; the root go.mod and go.sum are untouched.

No tools.go blank-import file: the `tool` directives are the Go 1.24+
mechanism for this, and `go mod tidy` retains the requires they name without
one. verify-mod now tidies both modules so the new one cannot drift.

The non-Go pins (cosign and crane workflow input defaults, syft plus its
digest, yq, kind, tilt, kwok) stay manual and are documented as such: they
sit outside any module graph, and several need a companion digest or a
release-format review that a blind bump would skip.

Signed-off-by: asivanadi0 <asivanadi0@users.noreply.github.com>
`go install pkg@version` resolves the Go toolchain from the tool module's own
go directive, which can be older than this repo's. golangci-lint built that
way on go1.26 refuses a go.mod asking for 1.27.0, so the install succeeds and
the tool then fails on the tree it is meant to check.

Pin GOTOOLCHAIN to this module's Go version for the install, and fail loudly
when a version resolves empty rather than silently installing @latest, which
is what an unlisted tool would otherwise get.

Signed-off-by: asivanadi0 <asivanadi0@users.noreply.github.com>
@asivanadi0
asivanadi0 force-pushed the cursor/tools-go-dependabot-pins-17d0 branch from e62cc58 to d554386 Compare September 3, 2026 18:29
@asivanadi0 asivanadi0 changed the title build: bring Makefile Go tool pins under Dependabot via tools.go build: track Makefile Go tool pins in a nested tools module Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bring Makefile and workflow tool pins under automated updates

2 participants