Skip to content

Stop writing variables.js from the component versions script - #2884

Merged
ctauchen merged 1 commit into
tigera:mainfrom
ctauchen:versions-script-no-variables
Jul 29, 2026
Merged

Stop writing variables.js from the component versions script#2884
ctauchen merged 1 commit into
tigera:mainfrom
ctauchen:versions-script-no-variables

Conversation

@ctauchen

Copy link
Copy Markdown
Collaborator

Description

scripts/update-component-versions.sh (behind make version/autogen) regenerated each version folder's variables.js from a hardcoded template. That template is now a liability:

  • It bakes in the old component model. It calls componentImage('cnx-node', ...) and componentImage('calicoctl', ...), and CE 3.24 releases.json has neither key (images were consolidated into the tigera/calico mono-image; there is no calicoctl image at all). A generated variables.js for any 3.24+ stream throws a TypeError at build time.
  • It writes stale image names (imageNames.node: 'tigera/cnx-node').
  • It silently drops fields that newer version folders carry (rhelPkgUrl, debPkgUrl, helmPre, prodnamedashWindows, and others), so re-running it on an existing folder loses content.

This PR makes the script update releases.json only. It prints a reminder to review variables.js by hand. IS_LATEST and the latest-version accounting are removed because they existed only to pick the baseUrl written 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-versions only adds the tigera/ 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 in scripts/versions/main.go.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings July 28, 2026 15:58
@ctauchen
ctauchen requested a review from a team as a code owner July 28, 2026 15:58
@netlify

netlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploy Preview for calico-docs-preview-next ready!

Name Link
🔨 Latest commit 6bd2214
🔍 Latest deploy log https://app.netlify.com/projects/calico-docs-preview-next/deploys/6a68d1a36947390008ef9eb2
😎 Deploy Preview https://deploy-preview-2884--calico-docs-preview-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploy Preview succeeded!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6bd2214
🔍 Latest deploy log https://app.netlify.com/projects/tigera/deploys/6a68d1a395ed8f00071574b0
😎 Deploy Preview https://deploy-preview-2884--tigera.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 86 (🔴 down 12 from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js templating/generation and all IS_LATEST/latest-version bookkeeping from scripts/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.

@ctauchen
ctauchen merged commit 93219ff into tigera:main Jul 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants