Repository navigation
[quality] scripts: subprocess tests for update-version.js release automation - #6898
Conversation
…omation Adds scripts/update-version.test.ts — 11 vitest tests exercising the release-automation script scripts/update-version.js against a temp docs- repo-shaped fixture. Uses the same subprocess pattern already established by scripts/check-leaderboard-regression.test.ts. Coverage: - argument validation (missing --version, unknown --project, no args) - non-latest release: new entry inserted after main, latest untouched - idempotency: re-running with the same version reports 'already exists' and does not double-insert - --set-latest: latest label/branch bumped, PROJECTS.currentVersion updated, previous latest preserved as a historical entry - --set-latest with previous latest still pointing at main: no synthesized 'main' historical entry - shared.json parity: non-latest adds entry, --set-latest bumps latest + currentVersion + editBaseUrls.kubestellar - non-kubestellar --set-latest does NOT rewrite editBaseUrls.kubestellar - regex-metacharacter safety: version '0.30.0.*' is escaped, not injected Refs #6842 Signed-off-by: kubestellar-hive[bot] <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
❌ Deploy Preview for kubestellar-docs failed. Why did it fail? →
|
|
Hi @kubestellar-hive[bot]. Thanks for your PR. I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
Netlify's production build has failed on every commit to main since 2026-09-09 (`Build script returned non-zero exit code: 2`, tracked in #6828/#6905/#6957) - the generic message never surfaced the real cause because the maintainer-facing reporter only relays Netlify's summary line, not the underlying build log. Reproduced the exact failure locally (Node 20.11.1 on Linux, matching netlify.toml's pinned NODE_VERSION and this repo's committed package-lock.json - a Windows repro hit an unrelated, Windows-only ESM path error and was not representative). `next build`'s "Running TypeScript" step fails with: vitest.config.ts(3,37): error TS2307: Cannot find module 'rollup' scripts/update-version.test.ts(253,90): error TS1501: This regular expression flag is only available when targeting 'es2018' or later. scripts/update-version.test.ts(284,93): error TS1501: (same) Root causes: - vitest.config.ts imported `SourceMapInput` from `rollup` directly. vite@8 replaced rollup with rolldown as its bundler (introduced in #6834, which is the exact commit and date #6828 was first filed against), so `rollup` is no longer part of the dependency tree at all - not even transitively. vite re-exports the same rolldown-backed types under its own stable `Rollup` compat namespace specifically for this kind of consumer code, so that's what this now imports instead of reaching into whichever bundler vite happens to use internally. - tsconfig.json's `target` was still "ES2017", predating the `/s` (dotAll) regex flags added in #6898 on 2026-09-12, which require ES2018+. Bumped to the minimum needed ("ES2018") rather than further, to keep this fix's blast radius as small as possible. `noEmit: true` means this only affects tsc's own syntax acceptance during type checking, not Turbopack's actual output. Verified end-to-end: `next build` (the literal command netlify.toml runs) now completes with exit 0 on Linux/Node 20.11.1, past type check, static generation (232/232 pages), and page optimization - a full reproduction of the previously-broken production build. Signed-off-by: Bryan Saravia <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]>
Test Improvement
Adds
scripts/update-version.test.ts— 11 vitest subprocess tests forscripts/update-version.js, the release-automation script called bysync-console-release-versions.yml. Verified locally: 11 passed in 7.7s.update-version.jsis a top-level Node program with no exported functions, so the test pattern mirrors the existingscripts/check-leaderboard-regression.test.ts: build a temp docs-repo-shaped directory withscripts/+src/config/versions.ts+public/config/shared.jsonfixtures, copy the script in, and spawn it withnode.What is now guarded
--version; unknown--project; no args at allmainin the correct*_VERSIONSconst--set-latestpromotionPROJECTS.currentVersionupdated; previous latest preserved as a historical entry--set-latestwhen previous latest was stillmain"main"historical entry (script correctly logs "No previous latest to preserve")shared.jsonnon-latest parityupdatedAtrefreshedshared.json--set-latestparityeditBaseUrls.kubestellarrewritten to the new frozen branch--set-latestona2adoes not rewriteeditBaseUrls.kubestellar"0.30.0.*"is escaped viaescapeRegex, not injected into the regex — no wholesale corruption of the existing"0.29.0"entryWhy now
scripts/update-version.jswas one of the 8 untested CI-automation scripts flagged in #6842, and the highest-impact of the eight — it runs from an automated PR-opening workflow (sync-console-release-versions.yml), so a regex bug that corruptsversions.tsorshared.jsonships to a release PR before a human reads the diff. These tests lock the eight distinct behavioural classes above.Refs #6842 — this PR closes the highest-risk gap (
update-version.js); the remaining 7 scripts in the finding table (generate-leaderboard.mjs,generate-acmm-history.mjs,generate-contributor-profiles.mjs,add-repo-breakdown.mjs, and the 4*.shscripts) stay open for follow-up PRs.Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-opus-4.7