Skip to content

S02-03 - Dependency Updates

Purpose: How Renovate keeps every pin current, and what it leaves to the maintainer.

Renovate keeps every pin current: the .mise.toml tools and mise.lock, the Go module, the docs site’s package.json and bun.lock, the Swift package’s Package.swift and Package.resolved, the GitHub Actions, and Renovate’s own image. renovate.json is the policy, and .github/workflows/renovate.yml runs it as a GitHub App of the wraithbox organization, on this repository only (docs/github-settings.md, “Renovate”).

go.work.sum holds the checksums of the Go workspace’s module graph that no go.sum holds. Renovate’s gomod manager doesn’t update it, and the go command adds lines to it but never removes one. A stale file changes the working tree on the next go list -m all, and the build-version check of swift:build then refuses the tree (I759I759 (closed): go.work.sum goes stale after Go dependency updates, and every local mise run ci then fails in swift:buildmise run ci on a clean checkout of main fails.).

  • internal/tools/worksum writes the file from nothing, in a temporary copy of the workspace. It lists the module graph, then the packages of each GOOS of go:cross with their tests and the tool directives. On darwin it lists them without cgo, and again with cgo and the build tags that select files.
  • It sets the Go environment of those commands itself. GOFLAGS is empty, and every module is checked against sum.golang.org and fetched only through the module proxy (GOVCS=*:off). It leaves GOTOOLCHAIN alone, so a Go update can switch to its new toolchain.
  • mise run go:worksum writes the file. go:worksum-check fails when the file in git’s index differs from a fresh one, and refuses to run while go.work, a go.mod or a go.sum differs from the index. A changed hash for the same module version is reported as a checksum mismatch, for the maintainer to look into, not as a stale file.
  • After each gomod update, Renovate runs worksum write as a post-upgrade task, once per branch. fileFilters limits what the task may add to the branch to go.work.sum.
  • The task runs where the App token is. So worksum imports only the standard library, and TestStandardLibraryOnly fails when it imports anything else. Renovate runs the code of the branch it updates, which is main’s code with new dependency versions that worksum doesn’t use.
  • Renovate is self-hosted, and runs a post-upgrade command only when RENOVATE_ALLOWED_COMMANDS in .github/workflows/renovate.yml matches it. That holds one regular expression, anchored at both ends, for the one command (docs/github-settings.md, “Renovate”).
  • Renovate installs Go for its own Go commands. Without a constraint it installs the newest Go 1.x, so constraints.go and constraints.golang in renovate.json pin it to the other Go pins. A regex manager moves both in the same pull request as the mise pin, go.work and the go.mod go directive, which moves only with rangeStrategy: "bump".

The Renovate step holds the GitHub App token, which can write contents, workflows and pull requests, and merge once CI is green. It runs these programs, and nothing else (docs/github-settings.md, “Renovate”):

  • go mod tidy and go get, from the gomod manager, with go at the version of constraints.go.
  • mod upgrade, from gomodUpdateImportPaths, after a Go module major update. Renovate installs it with go install github.com/marwan-at-work/mod/cmd/mod@<version>, and constraints.gomodMod sets the version. The checksum database authenticates the download.
  • mise trust and mise lock, with the App token in GITHUB_TOKEN. RENOVATE_ALLOWED_UNSAFE_EXECUTIONS names mise, so mise lock runs the branch’s own .mise.toml. Renovate installs mise, node, npm, Go and ruby for it (constraints.mise, node, npm, go and ruby). node, npm and ruby are only for the backends that resolve versions through them.
  • bun install --ignore-scripts, from the bun manager, after a change to packages/wraithbox-doc, with bun at constraints.bun.
  • The one post-upgrade command, worksum write, with golang at constraints.golang.

Every tool that Renovate’s installer (Containerbase) fetches for these has an exact version in constraints, with a regex manager in renovate.json that keeps it current. A new release waits the same 7 days as any other update, so no tool runs at a floating version next to the token, as the supply-chain rule of AGENTS.md requires. A tool that a new Renovate release starts to install on its own, or a new manager that runs one, needs a pin before it ships. Renovate’s debug log lists each tool it installs. The GitHub Actions lockfile step (gh-actions-lock) is inactive, because the repository has no .github/workflows/actions.lock.

gomodMod is pinned and gomodUpdateImportPaths stays on. Renovate supports the pin, and a Go major update with a new import path, such as go.yaml.in/yaml, still needs it (I770I770 (open): ON HOLD policyfile: move go.yaml.in/yaml from v3 to v4, and refuse the node kinds v4 addsRenovate proposes go.yaml.in/yaml/v3 v3.0.6 to go.yaml.in/yaml/v4 v4.0.0 in #768.).

Renovate 44 can run mise lock in safe mode (MISE_SAFE=1) when mise isn’t in RENOVATE_ALLOWED_UNSAFE_EXECUTIONS. Then it installs only mise, and the branch’s .mise.toml can’t run code. Not adopted: it is untested with the go: backend of .mise.toml, and the pins above already close the finding that asked for them (I788I788 (closed): Renovate: tools in the token-holding run float at latest (gomodUpdateImportPaths' mod@latest, mise and Containerbase tools)From the security review of #784 (F2).).

Status: Active