Skip to content

[quality] scripts: subprocess tests for update-version.js release automation - #6898

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/update-version-tests
Sep 12, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/update-version-tests

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds scripts/update-version.test.ts — 11 vitest subprocess tests for scripts/update-version.js, the release-automation script called by sync-console-release-versions.yml. Verified locally: 11 passed in 7.7s.

update-version.js is a top-level Node program with no exported functions, so the test pattern mirrors the existing scripts/check-leaderboard-regression.test.ts: build a temp docs-repo-shaped directory with scripts/ + src/config/versions.ts + public/config/shared.json fixtures, copy the script in, and spawn it with node.

What is now guarded

Class Test
Argument validation missing --version; unknown --project; no args at all
Non-latest release new entry inserted after main in the correct *_VERSIONS const
Idempotency second run reports "already exists"; no double-insert
--set-latest promotion latest label + branch bumped; PROJECTS.currentVersion updated; previous latest preserved as a historical entry
--set-latest when previous latest was still main no synthesized "main" historical entry (script correctly logs "No previous latest to preserve")
shared.json non-latest parity new versions entry, latest + currentVersion untouched, updatedAt refreshed
shared.json --set-latest parity latest + currentVersion bumped; editBaseUrls.kubestellar rewritten to the new frozen branch
Cross-project isolation --set-latest on a2a does not rewrite editBaseUrls.kubestellar
Regex-metacharacter safety version "0.30.0.*" is escaped via escapeRegex, not injected into the regex — no wholesale corruption of the existing "0.29.0" entry

Why now

scripts/update-version.js was 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 corrupts versions.ts or shared.json ships 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 *.sh scripts) 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

…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]>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 12, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kproche for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for kubestellar-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 4c9cc7e
🔍 Latest deploy log https://app.netlify.com/projects/kubestellar-docs/deploys/6aa5e42ffc312e0008021b90

@kubestellar-prow kubestellar-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 12, 2026
@kubestellar-prow

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@hivecommons-hive
hivecommons-hive Bot merged commit 6d9d968 into main Sep 12, 2026
10 of 15 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/update-version-tests branch September 12, 2026 23:46
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

hivecommons-hive Bot pushed a commit that referenced this pull request Sep 15, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant