Pin code generation and bring renovate.json to the org baseline - #1733
Open
biglittlebigben wants to merge 1 commit into
Open
Pin code generation and bring renovate.json to the org baseline#1733biglittlebigben wants to merge 1 commit into
biglittlebigben wants to merge 1 commit into
Conversation
protoc's plugins were unpinned inputs to committed code: the generate
workflow installed all four with `go install ...@latest`, ran mage from
`mage-action` with `version: latest`, and floated protoc within its
major. Worse, every `--plugin=` flag in the magefile used the short form
(`--plugin=go=`), which protoc silently ignores, so generation actually
ran whatever binary happened to be in GOPATH/bin.
Pin each generator to the version stamped in the committed headers:
- protoc-gen-go, -go-grpc, -psrpc, -twirp and mage become `tool`
directives in go.mod, resolved at generation time with `go tool -n`
- the `--plugin=` flags use the full-executable-name form protoc
honours, so those pinned paths are actually used
- protoc is pinned exactly rather than floated within its major; it
stamps its version into every generated file, so a bump rewrites
the committed output and should be a reviewable edit
- release.yaml gets the same protoc pin: it builds the published JS
package via `pnpm generate:proto`, so protoc is a release input
google.golang.org/protobuf moves 1.36.11 -> 1.36.12 because 1.36.12 is
what generated the committed files; pinning to 1.36.11 would land a
downgrade of every header disguised as a pin. Verified by regenerating
with the pinned protoc: the generated tree comes back byte-identical.
GOPATH/bin here held older plugins (protoc-gen-go v1.36.11, psrpc
v0.7.0), so an empty diff also proves the plugin paths are honoured
rather than falling back to PATH.
`mage bootstrap` stays as a developer convenience for installing the
plugins system-wide, documented as such: it is not a build step, and
generation ignores what it installs. bootstrap.sh is removed - it did
the same job pinned to protoc-gen-go v1.31.0 and psrpc v0.5.1, and
nothing referenced it.
renovate.json moves off the deprecated config:base to the baseline used
across the Go repos: third-party modules ungrouped so a bad bump reverts
alone, livekit deps grouped and exempt from quarantine, pion grouped
because they are co-released, a vulnerability fast path, and both the
go and toolchain directives disabled - this module is a library, so its
go directive is the minimum we ask of consumers. Drops the stale
go 1.22 constraint, four minors behind go.mod.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
boks1971
approved these changes
Aug 22, 2026
davidzhao
approved these changes
Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
protoc's plugins were unpinned inputs to code we commit. The generate workflow installed all four with
go install ...@latest, ran mage viamage-actionwithversion: latest, and floated protoc within its major.Worse, every
--plugin=flag in the magefile used the short form:protoc only honours the full-executable-name form. No error, no warning — so generation was really running whatever was in
GOPATH/bin, and the@latestinstalls were the de facto pin. The failure mode is quiet: generated files change whenever an upstream release lands, arriving in an automatedgenerated protobufcommit nobody reads.Pinning
Each generator is pinned to the version stamped in the committed headers:
arduino/setup-protoc'sversion:, exact rather than35.xtooldirectives in go.mod, resolved withgo tool -ntooldirective too —go tool mage proto--plugin=flags now use the form protoc honours, so those pinned paths are actually used.release.yamlgets the same pin. It had noversion:at all, and it builds the published@livekit/protocolpackage viapnpm generate:proto— protoc is a release input there, so the published JS package could be generated by a different compiler than the committed Go code.google.golang.org/protobufmoves 1.36.11 → 1.36.12 because 1.36.12 is what generated the committed files. Pinning to 1.36.11 would land a downgrade of every header disguised as a pin.go get -toolalso dragged psrpc 0.7.3 → 0.7.4 along the way; that's put back.Verification
Regenerated with the pinned protoc (35.1) and plugins:
git statusonlivekit rpc infrais empty — the tree comes back byte-identical, so this is a pin and not a generator upgrade in disguise.That check is meaningful rather than vacuous here. My
GOPATH/binheld older plugins than the pins:A surviving PATH fallback would have churned every header downward. An empty diff proves the plugin paths are honoured.
CI confirms it independently: the Generate job ran the new path on this branch and added no
generated protobufcommit, i.e. a clean runner with an emptyGOPATH/binreproduced the committed tree exactly.renovate-config-validatorpasses, andgo build ./.../go test ./...pass.mage bootstrap
Kept, as a developer convenience for installing the plugins system-wide, and documented as such. It is not a build step — nothing in
.github/,package.jsonor any mage target references it, andmage protoignores what it installs, since plugins resolve through the tool directives to explicit paths. If someone did generate with something else, the Generate workflow regenerates and commits on every push to a non-mainbranch, so what reachesmainalways comes from the pinned versions.Removing bootstrap.sh
bootstrap.shis deleted. It duplicatedmage bootstrap— install the four plugins intoGOPATH/bin— but at versions that had gone badly stale:That mattered because of the
--plugin=bug above: while generation resolved plugins fromPATH, a contributor who ran./bootstrap.shand thenmage protogenerated the tree with protoc-gen-go v1.31.0 and psrpc v0.5.1 — five minors and two minors behind. The script wasn't a neutral convenience, it was a way to produce wrong output.The rest of it had also rotted:
GO_TARGET_VERSION=1.17and had a whole second branch usinggo get -ufor older toolchains. go.mod requires 1.26, so that branch was dead code pinning even older plugins (protoc-gen-go v1.30.0, psrpc v0.3.1).git clone-ingmagefile/mageinto/tmpand runninggo run bootstrap.go— an unpinned clone of the default branch. mage is now atooldirective, sogo tool mageneeds no install at all.go mod downloadis a workflow step.Nothing referenced it — no workflow, no
package.jsonscript, no docs (the repo has no README). Keeping a second, staler entry point next tomage bootstrapwould just reintroduce the hazard this PR removes, so it goes.mage bootstrapremains for anyone who wants the plugins on theirPATH.renovate.json
Off the deprecated
config:baseand onto the baseline used across the Go repos:go depsgroup).livekit depsgrouped and exempt from quarantine — we track pseudo-versions that move constantly.pion depsgrouped: 3 direct pion modules, co-released, so one-at-a-time bumps produce PRs that don't build.golangandtoolchaindeptypes disabled. This module is a library: thegodirective is the minimum we ask of consumers, and atoolchainline would raise the floor for everyone.constraints: {go: "1.22"}, four minors behind go.mod.Follow-ups (not in this PR)
stringerinsip/sip.go'sgo:generateis still unpinned from PATH; CI never runs it.gotestfmtinbuildtest.yamlis pinned by commit SHA — fine, but hand-maintained.🤖 Generated with Claude Code