From 019f7bdf271e1ee9a6fe304eeff83ac090477a78 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 1 Dec 2026 17:27:41 -0500 Subject: [PATCH 1/2] fix: Tidy Go modules under examples and tests config:recommended ignores examples, test and tests directories, so Renovate never updates or tidies a go.mod there. Such a module often replaces the repository's root module with a relative path, so when an update moves a requirement in the root go.mod, the nested go.mod goes stale. go mod tidy then fails on it, and golangci-lint refuses to load it ("running `go mod tidy` may solve the problem"). That is how datum-cloud/galactic#1554 went red after a k8s.io patch group. Key features/changes: - Give the gomod manager its own ignorePaths that keeps only vendor, node_modules and Go testdata fixtures out, so nested modules are extracted - Their updates join the same group branches as the root module's, and the existing gomodTidy option tidies each go.mod the branch changes - Other managers keep config:recommended's ignore list --- renovate-config.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/renovate-config.json b/renovate-config.json index 44d321b..5f92879 100644 --- a/renovate-config.json +++ b/renovate-config.json @@ -18,6 +18,10 @@ "lockFileMaintenance": { "dependencyDashboardApproval": false }, + "gomod": { + "description": "Update and tidy Go modules under examples, test and tests directories too, which config:recommended ignores. Such a module often replaces the repository's root module with a relative path, so when an update moves a requirement in the root go.mod, the nested go.mod goes stale and go mod tidy and golangci-lint fail on it. Vendored modules, node_modules and Go testdata fixtures stay ignored.", + "ignorePaths": ["**/node_modules/**", "**/vendor/**", "**/testdata/**"] + }, "packageRules": [ { "description": "Group every Go module minor update in a repository into one pull request, so the dashboard asks for one approval per repository instead of one per module.", @@ -78,7 +82,7 @@ "dependencyDashboardApproval": false }, { - "description": "Run go mod tidy after a Go module update, so go.sum gains the hashes the new versions need and loses the ones nothing uses.", + "description": "Run go mod tidy after a Go module update, so go.sum gains the hashes the new versions need and loses the ones nothing uses. It runs in every go.mod Renovate updates, nested modules included.", "matchManagers": ["gomod"], "postUpdateOptions": ["gomodTidy"] }, From eb7904d0eea7797d681cbb38fabfcb0a6111d647 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 1 Dec 2026 17:48:23 -0500 Subject: [PATCH 2/2] fix: Tidy nested modules that replace an updated module go mod tidy ran only in the go.mod Renovate edited. An example that builds against the root through a local replace, and lists the updated dependency as indirect or not at all, was left stale by a root-only update, and go mod tidy and golangci-lint then failed on it. gomodTidyAll also tidies every go.mod whose local replace points at the updated module, and commits those go.mod and go.sum files in the same branch. --- renovate-config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renovate-config.json b/renovate-config.json index 5f92879..24fd36e 100644 --- a/renovate-config.json +++ b/renovate-config.json @@ -82,9 +82,9 @@ "dependencyDashboardApproval": false }, { - "description": "Run go mod tidy after a Go module update, so go.sum gains the hashes the new versions need and loses the ones nothing uses. It runs in every go.mod Renovate updates, nested modules included.", + "description": "Run go mod tidy after a Go module update, so go.sum gains the hashes the new versions need and loses the ones nothing uses. It runs in every go.mod Renovate updates, and then in every go.mod that replaces that module with a local path, such as an example built against the root. Renovate does not otherwise touch a nested module whose own go.mod lists the dependency only as indirect, or not at all, so a root-only update would leave it stale.", "matchManagers": ["gomod"], - "postUpdateOptions": ["gomodTidy"] + "postUpdateOptions": ["gomodTidyAll"] }, { "description": "Move the Go toolchain as one pull request per repository, opened without waiting for approval: the go.mod toolchain line, golang build images, the Go that setup-go installs, golangci-lint and chainsaw. golangci-lint refuses a module whose toolchain is newer than the Go it was built with, and older chainsaw releases do not build on a newer Go, so moving any one of them alone fails CI. The go.mod go line is not in this group, and Renovate never proposes it: it sets runtime defaults and, in a library, the minimum Go of every importer, so it moves in a change of its own or when go get raises it for a dependency.",