feat(scripts): add bump-sdk.mjs#2114
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
Bumping sdkexamples/ to a new helm.sh/helm/v4 release was a manual chore (e.g. helm#2067) that required running `go get`, `go mod tidy`, and a build check by hand. scripts/v4/bump-version.mjs already automates the docs-site side of a release bump, but it is a Node.js script that intentionally does not shell out to the Go toolchain, so extending it would muddy that contract. Add scripts/v4/bump-sdk.mjs as a sibling: a standalone Node script that auto-detects the latest stable v4 release (or accepts --version), runs `go get helm.sh/helm/v4@<version>` + `go mod tidy` + `go build ./...` in sdkexamples/, and bails with a clear message when the build fails (the script cannot apply API-rename fixes like InsecureSkipTLSverify -> InsecureSkipTLSVerify on its own; those need a human). A --dry-run flag prints the resolved version and the commands that would run without writing anything. Fixes helm#2113 Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
benoittgt
reviewed
May 22, 2026
Contributor
benoittgt
left a comment
There was a problem hiding this comment.
I'm wondering if it should be called from scripts/v4/bump-version.mjs even behind a flag --bump-sdk, or at least mentionned at the end of the command output.
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
Closes #2113. Add
scripts/v4/bump-sdk.mjsto automatesdkexamples/version bumps. The script auto-detects the latest stable Helm v4 release (or accepts an explicit--version), runsgo get helm.sh/helm/v4@<version>+go mod tidy+go build ./...insdkexamples/, and bails non-zero with a clear message when the build fails (e.g. an API rename between releases).Why this matters
The motivation in #2113 (and the linked review on #2067) was:
sdkexamples/needs to track each new Helm v4 release so the docs-site examples stay buildable.scripts/v4/bump-version.mjsalready automates the docs-site side of a release bump, but it is a Node.js script that intentionally does not shell out to the Go toolchain. Extending it would muddy that contract and pull Go into a Node-only file.bump-sdk.mjs) keeps concerns separated and matches the existing per-script directory convention (scripts/v4/).v4.1.xrenamedInsecureSkipTLSverify->InsecureSkipTLSVerify, which broke fix(sdkexamples): bump helm.sh/helm/v4 to v4.2.0 and fix build #2067 and required a manual code fix). The script detects thego buildfailure and exits with a message that names that exact failure mode, so the maintainer knows to fix the example code by hand.Changes
scripts/v4/bump-sdk.mjs(new, +151 lines). Style and arg parsing match the existingbump-version.mjs(--version,--dry-run,--help).sdkexamples/go.modorgo.sumin this PR. The script is a tool to drive the bump, run separately when the maintainer decides to cut a new docs release.How to test
Locally, on a clean checkout of
main(current SDK pin:v4.1.4, latest stable:v4.2.0):The
--version v4.X.Yform was syntax-checked but not run end-to-end against the live registry; that is the next step for the human running the script on the day a release lands.Acceptance criteria from #2113:
sdkexamples/go.modandgo.sumfor the specified (or latest) Helm v4 release - viago get+go mod tidy.go build ./...and exits non-zero with a clear error if the build fails -runGo(["build", "./..."], ...)exits with a message naming the API-rename failure mode.--version vX.Y.Zflag for explicit version.--dry-runto preview without writing.Fixes #2113
AI-assisted.