[v3-3-test] Catch lang-SDK Go example module drift before it reaches main (#70568) - #70624
Merged
Conversation
…main (#70568) * Catch lang-SDK Go example module drift before it reaches main kubernetes-tests/lang_sdk/go_example is a separate Go module that resolves the SDK through a `replace` onto ../../../go-sdk, so it carries its own copy of the SDK's indirect requirements. Nothing re-tidies it when a dependency moves inside /go-sdk, and Dependabot bumps exactly one module per PR. The blast radius is what makes this worth guarding. Go refuses to build an inconsistent module, so once such a bump merges, "Kubernetes tests / K8S Lang-SDK" fails at the Build Go bundle step on every pull request until someone notices and tidies the module by hand — not just on the PR that caused it. Dependabot security updates do not consult .github/dependabot.yml, so no per-directory configuration prevents this, and a second Dependabot PR for the example module would merge at a different time and leave main red in between. The drift has to fail the bump PR itself. The check is `go mod tidy -diff` in the example module: it asks exactly the question the failing CI step asks, never writes to the working tree, and exits non-zero when the module is untidy. * Let prek provide the Go toolchain for the tidy check Static checks run on a runner whose preinstalled toolchains are deleted to free disk space before prek starts, so the check could never find `go` there and failed on every run. Asking prek for the toolchain is how the Go SDK's own tidy hook already gets one, and it pins the same version everywhere. (cherry picked from commit bce20ff) Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
1 task
potiuk
marked this pull request as ready for review
July 28, 2026 16:22
potiuk
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl and
potiuk
as code owners
July 28, 2026 16:22
vatsrahul1001
pushed a commit
that referenced
this pull request
Aug 5, 2026
…main (#70568) (#70624) * Catch lang-SDK Go example module drift before it reaches main kubernetes-tests/lang_sdk/go_example is a separate Go module that resolves the SDK through a `replace` onto ../../../go-sdk, so it carries its own copy of the SDK's indirect requirements. Nothing re-tidies it when a dependency moves inside /go-sdk, and Dependabot bumps exactly one module per PR. The blast radius is what makes this worth guarding. Go refuses to build an inconsistent module, so once such a bump merges, "Kubernetes tests / K8S Lang-SDK" fails at the Build Go bundle step on every pull request until someone notices and tidies the module by hand — not just on the PR that caused it. Dependabot security updates do not consult .github/dependabot.yml, so no per-directory configuration prevents this, and a second Dependabot PR for the example module would merge at a different time and leave main red in between. The drift has to fail the bump PR itself. The check is `go mod tidy -diff` in the example module: it asks exactly the question the failing CI step asks, never writes to the working tree, and exits non-zero when the module is untidy. * Let prek provide the Go toolchain for the tidy check Static checks run on a runner whose preinstalled toolchains are deleted to free disk space before prek starts, so the check could never find `go` there and failed on every run. Asking prek for the toolchain is how the Go SDK's own tidy hook already gets one, and it pins the same version everywhere. (cherry picked from commit bce20ff) Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
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.
kubernetes-tests/lang_sdk/go_example is a separate Go module that resolves
the SDK through a
replaceonto ../../../go-sdk, so it carries its own copyof the SDK's indirect requirements. Nothing re-tidies it when a dependency
moves inside /go-sdk, and Dependabot bumps exactly one module per PR.
The blast radius is what makes this worth guarding. Go refuses to build an
inconsistent module, so once such a bump merges, "Kubernetes tests / K8S
Lang-SDK" fails at the Build Go bundle step on every pull request until
someone notices and tidies the module by hand — not just on the PR that
caused it.
Dependabot security updates do not consult .github/dependabot.yml, so no
per-directory configuration prevents this, and a second Dependabot PR for the
example module would merge at a different time and leave main red in between.
The drift has to fail the bump PR itself.
The check is
go mod tidy -diffin the example module: it asks exactly thequestion the failing CI step asks, never writes to the working tree, and
exits non-zero when the module is untidy.
Static checks run on a runner whose preinstalled toolchains are deleted to
free disk space before prek starts, so the check could never find
gothereand failed on every run. Asking prek for the toolchain is how the Go SDK's
own tidy hook already gets one, and it pins the same version everywhere.
(cherry picked from commit bce20ff)
Co-authored-by: Jarek Potiuk jarek@potiuk.com