Stop writing variables.js from the component versions script - #2884
Merged
Conversation
The generated variables.js template was stale: it hardcoded the old
component model (componentImage('cnx-node'), componentImage('calicoctl'),
imageNames from before the 3.24 image consolidation) and dropped
next-era fields like rhelPkgUrl and debPkgUrl. Running it for any
3.24+ stream would produce a variables.js that throws at build time.
The script now updates releases.json only and prints a reminder to
review variables.js by hand. IS_LATEST is removed because it only fed
the variables.js baseUrl logic.
Verified by running the script against the 3.23-2 stream: releases.json
is updated and variables.js is untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Deploy Preview for calico-docs-preview-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview succeeded!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Calico Enterprise version-autogen workflow so scripts/update-component-versions.sh only updates releases.json, avoiding regeneration of variables.js from an outdated template that can break newer streams.
Changes:
- Removed
variables.jstemplating/generation and allIS_LATEST/latest-version bookkeeping fromscripts/update-component-versions.sh. - Added an informational reminder message to manually review/update the target folder’s
variables.js. - Updated the Makefile guidance comment to match the script’s new behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/update-component-versions.sh | Stops rewriting variables.js; updates releases.json only and prints a manual-review reminder. |
| Makefile | Updates the version/autogen documentation comment to reflect the new script behavior. |
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.

Description
scripts/update-component-versions.sh(behindmake version/autogen) regenerated each version folder'svariables.jsfrom a hardcoded template. That template is now a liability:componentImage('cnx-node', ...)andcomponentImage('calicoctl', ...), and CE 3.24 releases.json has neither key (images were consolidated into thetigera/calicomono-image; there is no calicoctl image at all). A generated variables.js for any 3.24+ stream throws a TypeError at build time.imageNames.node: 'tigera/cnx-node').rhelPkgUrl,debPkgUrl,helmPre,prodnamedashWindows, and others), so re-running it on an existing folder loses content.This PR makes the script update
releases.jsononly. It prints a reminder to reviewvariables.jsby hand.IS_LATESTand the latest-version accounting are removed because they existed only to pick thebaseUrlwritten into variables.js. The Makefile comment is updated to match.Verification
Ran the modified script against the 3.23-2 stream (
VERSION=3.23.1 PRODUCT=calico-enterprise DOCS_VERSION_STREAM=3.23-2): releases.json was updated in place and variables.js was not touched.One pre-existing issue surfaced during that test, not caused by this change:
scripts/versions/format-versionsonly adds thetigera/image prefix when the upstream component has no explicit image name, and upstream versions.yml now ships bare names for about 10 components. Re-generated entries lose the prefix until hand-patched. That deserves a separate fix inscripts/versions/main.go.🤖 Generated with Claude Code