fix(scripts): preserve go client go.mod/go.sum across regeneration - #3540
Merged
nicoloboschi merged 1 commit intoAug 19, 2026
Merged
Conversation
Client regeneration deleted go.mod/go.sum and re-resolved them with go mod tidy. Deps pulled in by the maintained tests (testify) are not pinned by the generator, so tidy resolved them to upstream's latest release. Every new testify release changed the regeneration output and broke the verify-generated-files check for all pull requests. Treat go.mod/go.sum as maintained files: stash them before wiping generated code and restore them over the generator-emitted ones. go mod tidy still runs but now only adds entries for new imports. Dependency upgrades become explicit go get + go mod tidy commits.
nicoloboschi
approved these changes
Aug 19, 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.
Summary
scripts/generate-clients.shdeleted the Go client'sgo.mod/go.sumbefore regeneration and re-resolved them with a freshgo mod tidy. Dependencies pulled in by the maintained test files (testify) are not pinned by the generator, so tidy resolved them to upstream's latest release.verify-generated-filescheck for all pull requests (currently happening with testify v1.12.0: recent PRs each had to commit the samego.mod/go.sumbump to get CI green).go.mod/go.sumas maintained files — stash them alongsideREADME.md/integration_test.gobefore wiping generated code and restore them over the generator-emitted ones.go mod tidystill runs, but now only adds entries for new imports; dependency upgrades become explicitgo get+go mod tidycommits, same as any normal Go module.Test plan
bash -n scripts/generate-clients.sh