From 4dbb437c3bf56078c91a275c2b46ef1ab6e69b18 Mon Sep 17 00:00:00 2001 From: Anilkumar Reddy Date: Sat, 28 Nov 2026 15:13:16 -0600 Subject: [PATCH] ci: use Node 26 for integration tooling --- .github/workflows/_scenario.yml | 1 + .github/workflows/build-approve-deploy.yml | 3 ++ .github/workflows/ci.yml | 7 +++++ .github/workflows/cleanup.yml | 1 + .github/workflows/integration.yml | 1 + .node-version | 2 +- AGENTS.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 12 +++++++- action-inputs.json | 15 ++++++---- docs/REPORTING.md | 12 +++++--- docs/SETUP.md | 8 ++++- package.json | 2 +- scripts/check-policy.mjs | 34 ++++++++++++++++++++++ tests/workflow-policy.test.mjs | 34 ++++++++++++++++++++++ 15 files changed, 121 insertions(+), 15 deletions(-) diff --git a/.github/workflows/_scenario.yml b/.github/workflows/_scenario.yml index 0db5f60..2c0eee8 100644 --- a/.github/workflows/_scenario.yml +++ b/.github/workflows/_scenario.yml @@ -48,6 +48,7 @@ jobs: node-version-file: .node-version registry-url: https://npm.pkg.github.com scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile env: diff --git a/.github/workflows/build-approve-deploy.yml b/.github/workflows/build-approve-deploy.yml index b75bc78..87a3385 100644 --- a/.github/workflows/build-approve-deploy.yml +++ b/.github/workflows/build-approve-deploy.yml @@ -31,6 +31,7 @@ jobs: node-version-file: .node-version registry-url: https://npm.pkg.github.com scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile env: @@ -72,6 +73,7 @@ jobs: node-version-file: .node-version registry-url: https://npm.pkg.github.com scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile env: @@ -112,6 +114,7 @@ jobs: node-version-file: .node-version registry-url: https://npm.pkg.github.com scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84299d2..2771896 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,9 +21,16 @@ jobs: node-version-file: .node-version registry-url: https://npm.pkg.github.com scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Offline format, lint, tests, workflow policy and audit run: pnpm quality + - name: Set up the Action compatibility runtime + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 + with: + node-version: '24.21.0' + - name: Check the Node 24 reporting compatibility runner + run: node --test tests/reporting.test.mjs diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index d9ab75e..ed434d1 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -34,6 +34,7 @@ jobs: node-version-file: .node-version registry-url: https://npm.pkg.github.com scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile env: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3eadc31..41d5370 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -46,6 +46,7 @@ jobs: node-version-file: .node-version registry-url: https://npm.pkg.github.com scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile env: diff --git a/.node-version b/.node-version index df6ae33..a2e8115 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -24.21.0 +26.13.1 diff --git a/AGENTS.md b/AGENTS.md index 543abff..f6379d2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ Read this file and [CONTRIBUTING.md](CONTRIBUTING.md) before changes. Inspect th current branch/status, manifests, workflows, relevant scripts, and tests first. Keep changes focused and preserve unrelated work. -- Use Node 24, pnpm 12.6.0, strict code, and existing dependencies. +- Use Node 26.13.1 for development and builds, pnpm 12.6.0, strict code, and existing dependencies. - Keep domain expectations in the shared scenario catalog and lifecycle/control behavior in the shared runner. Do not duplicate complete Actions or shared package internals. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2702163..6b97025 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Use Node 24 and pnpm 12.6.0. Install dependencies with +Use Node 26.13.1 and pnpm 12.6.0. Install dependencies with `pnpm install --frozen-lockfile`, using GitHub Packages credentials held outside the repository. Follow [setup](docs/SETUP.md#local-development). diff --git a/README.md b/README.md index e5f1a43..a9d8ebe 100644 --- a/README.md +++ b/README.md @@ -68,15 +68,25 @@ separately and does not substitute for registry-backed validation. ## Development -Use Node 24 and pnpm 12.6.0, then configure local GitHub Packages read access as +Use Node 26.13.1 and pnpm 12.6.0, then configure local GitHub Packages read access as described in [setup](docs/SETUP.md#local-development). ```sh +npm install --global corepack@0.36.0 corepack enable pnpm install --frozen-lockfile pnpm quality ``` +Node 26 is the development and workflow-script host; it no longer bundles +Corepack, so install the pinned bootstrap shown above. The immutable CommerceKit +Action refs still execute on GitHub's Node 24 runtime. Their runtime/input +metadata is bound to the same refs in `action-inputs.json`; composite wrappers +do not replace that execution runtime. The opt-in local reporting replay keeps +its explicit Node 24 compatibility runner as described in [reporting](docs/REPORTING.md). +CI runs its focused offline reporting tests on Node 24 after the main Node 26 +quality gate; it does not duplicate the full suite or dispatch live scenarios. + The harness reuses `@commercekit-tools/notification-contract` and `@commercekit-tools/ccv2-client`. See the [revision and compatibility guide](docs/SETUP.md#action-and-package-revisions) for the diff --git a/action-inputs.json b/action-inputs.json index 089fc0a..430a84d 100644 --- a/action-inputs.json +++ b/action-inputs.json @@ -13,7 +13,8 @@ "api-base-url", "poll-interval-seconds", "timeout-minutes" - ] + ], + "runtime": "node24" }, "commercekit-tools/ccv2-deploy": { "ref": "1af852b9a00e981da4ea13565bb18c7ce7fda27f", @@ -39,11 +40,13 @@ "api-base-url", "poll-interval-seconds", "timeout-minutes" - ] + ], + "runtime": "node24" }, "commercekit-tools/notify": { "ref": "abc752ead104a6e5153c5f166d04ee5e595e0ca6", - "inputs": ["provider", "event-json", "event-file", "webhook-url", "fail-on-notification-error"] + "inputs": ["provider", "event-json", "event-file", "webhook-url", "fail-on-notification-error"], + "runtime": "node24" }, "commercekit-tools/ccv2-build-cleanup": { "ref": "8b1786b731be8d2d3fac137cd358d2ee5488bd58", @@ -62,10 +65,12 @@ "exclude-build-codes", "timeout-minutes", "continue-on-delete-error" - ] + ], + "runtime": "node24" }, "commercekit-tools/setup-commercekit": { "ref": "52a5a098d89f9ef2c42a234b4c3baa5d60a7a896", - "inputs": ["version"] + "inputs": ["version"], + "runtime": "node24" } } diff --git a/docs/REPORTING.md b/docs/REPORTING.md index f761090..2c46e47 100644 --- a/docs/REPORTING.md +++ b/docs/REPORTING.md @@ -25,7 +25,7 @@ not used by the normal registry validator or ordinary CI. ## What executes -`pnpm test:reporting` is an explicit local-only integration command. It verifies +`scripts/validate-reporting.mjs` is an explicit local-only integration command. It verifies normal registry manifests/locks, public package exports/schema, installed package bytes against an independently downloaded registry tarball, source commit/tree/ dirty fingerprints, matching runtime sources and exact bundle hashes. The five @@ -57,8 +57,12 @@ workflow origin/approval/confirmation guards remain separate and unchanged. ## Run locally -Use Node 24.21.0 and pnpm 12.6.0. Install normal frozen dependencies in this -repository and the five reviewed Action checkouts; build each normal committed +Use the development Node 26.13.1/pnpm 12.6.0 toolchain to install this repository. +Keep an explicit Node 24 executable for this opt-in compatibility replay: its +actual bundled Actions must run on their declared Node 24 execution runtime. +Invoke that executable directly with the reporting environment values shown below; +the replay retains its Node 24 guard and does not inherit the development host. +Install normal frozen dependencies in the five reviewed Action checkouts; build each normal committed bundle and pass its repository's full validation. Install the existing reviewed local Sandbox's dependencies. OpenSSL and a free local HTTPS port are required. @@ -113,7 +117,7 @@ files require a fresh reviewed fingerprint. Hashes identify inputs, not approval ```sh REPORTING_MANIFEST=/private/tmp/reviewed-reporting-manifest.json \ REPORTING_LOCAL_ORIGIN=https://localhost:18987 \ -pnpm test:reporting +/path/to/node24/bin/node scripts/validate-reporting.mjs ``` Only HTTPS localhost/127.0.0.1/::1 origins with explicit unprivileged ports and diff --git a/docs/SETUP.md b/docs/SETUP.md index 881d226..e16cfdc 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -169,13 +169,14 @@ sanitized form. ## Local development -Use Node 24 and pnpm 12.6.0. Configure a classic GitHub personal access token with +Use Node 26.13.1 and pnpm 12.6.0. Configure a classic GitHub personal access token with `read:packages` in user-level or ephemeral npm authentication outside this repository, with organization SSO authorization when required. Never store it in source or a repository secret. `npm config get userconfig` identifies the selected user configuration; do not print authentication settings. ```sh +npm install --global corepack@0.36.0 corepack enable pnpm install --frozen-lockfile pnpm quality @@ -187,6 +188,11 @@ dependency installation/audit can contact package registries. Do not run the live runner from a local shell by weakening its GitHub repository/event/ref guards. Use a deliberate manual workflow dispatch after setup. +Node 26 does not include Corepack; the explicit 0.36.0 bootstrap above is also +used by the existing workflow script hosts. This does not migrate the pinned +CommerceKit Actions: they continue to execute on Node 24. Preserve their refs, +Node 24 runtime metadata and manual-run guards when updating the harness. + ## Release hold This repository has no Marketplace, Action-tagging, GitHub Release, or package diff --git a/package.json b/package.json index 606afe0..1859041 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "description": "Guarded cross-repository Sandbox integration tests for CommerceKit Actions.", "packageManager": "pnpm@12.6.0", "engines": { - "node": ">=24.21.0 <25" + "node": ">=26.13.1 <27" }, "scripts": { "format": "prettier --write .", diff --git a/scripts/check-policy.mjs b/scripts/check-policy.mjs index 4a98c33..588b7de 100644 --- a/scripts/check-policy.mjs +++ b/scripts/check-policy.mjs @@ -22,11 +22,16 @@ export function readPolicyFiles() { ...compositePaths, 'action-refs.json', 'action-inputs.json', + '.node-version', + 'package.json', ]; return Object.fromEntries(paths.map((path) => [path, readFileSync(path, 'utf8')])); } export function validatePolicy(files) { + const developmentNode = files['.node-version'].trim(); + assert.match(developmentNode, /^26\.\d+\.\d+$/); + assert.equal(JSON.parse(files['package.json']).engines.node, `>=${developmentNode} <27`); const workflows = Object.keys(files).filter((path) => path.startsWith('.github/workflows/')); assert.deepEqual([...workflows].sort(), [...workflowPaths].sort(), 'Unreviewed workflow.'); const pins = JSON.parse(files['action-refs.json']); @@ -41,6 +46,7 @@ export function validatePolicy(files) { ); for (const [name, snapshot] of Object.entries(metadata)) { assert.equal(snapshot.ref, pins[name], 'Input metadata must bind to the adopted Action ref.'); + assert.equal(snapshot.runtime, 'node24', 'CommerceKit Actions retain Node 24 execution.'); assert( Array.isArray(snapshot.inputs) && snapshot.inputs.length > 0 && snapshot.inputs.length <= 50, ); @@ -51,6 +57,24 @@ export function validatePolicy(files) { const docs = Object.fromEntries( [...workflowPaths, ...compositePaths].map((path) => [path, parse(files[path])]), ); + for (const [path, doc] of Object.entries(docs)) { + if (path.startsWith('.github/actions/')) { + assert.equal(doc.runs.using, 'composite', 'Wrappers must preserve pinned Action execution.'); + continue; + } + for (const job of Object.values(doc.jobs)) { + const steps = job.steps ?? []; + const install = steps.findIndex((step) => step.run === 'pnpm install --frozen-lockfile'); + if (install < 0) continue; + const setup = steps.findIndex((step) => step.uses?.startsWith('actions/setup-node@')); + const bootstrap = steps.findIndex( + (step) => step.run === 'npm install --global corepack@0.36.0', + ); + const enable = steps.findIndex((step) => step.run === 'corepack enable'); + assert(setup >= 0 && bootstrap > setup && enable > bootstrap && install > enable); + assert.equal(steps[setup].with['node-version-file'], '.node-version'); + } + } const seenActions = new Set(); function walk(value, path) { if (!value || typeof value !== 'object') return; @@ -114,6 +138,16 @@ export function validatePolicy(files) { ); } assert(ci.jobs.quality.steps.some((step) => step.run === 'pnpm quality')); + const qualitySteps = ci.jobs.quality.steps; + const qualityIndex = qualitySteps.findIndex((step) => step.run === 'pnpm quality'); + const compatibilityNode = qualitySteps.findIndex( + (step) => + step.uses?.startsWith('actions/setup-node@') && step.with?.['node-version'] === '24.21.0', + ); + const compatibilityTest = qualitySteps.findIndex( + (step) => step.run === 'node --test tests/reporting.test.mjs', + ); + assert(compatibilityNode > qualityIndex && compatibilityTest > compatibilityNode); const entry = docs[workflowPaths[1]]; assert.deepEqual(Object.keys(entry.on), ['workflow_dispatch']); diff --git a/tests/workflow-policy.test.mjs b/tests/workflow-policy.test.mjs index ec1eb86..6ee1f67 100644 --- a/tests/workflow-policy.test.mjs +++ b/tests/workflow-policy.test.mjs @@ -15,6 +15,40 @@ test('checked-in workflows preserve live-test and release boundaries', () => { assert.doesNotThrow(() => validatePolicy(readPolicyFiles())); }); +test('Node 26 script hosts retain explicit bootstrap and Node 24 Action execution contracts', () => { + const path = '.github/workflows/ci.yml'; + for (const change of [ + (doc) => { + doc.jobs.quality.steps = doc.jobs.quality.steps.filter( + (step) => step.run !== 'npm install --global corepack@0.36.0', + ); + }, + (doc) => { + doc.jobs.quality.steps.find((step) => step.with?.['node-version-file']).with = { + 'node-version': '24', + }; + }, + (doc) => { + doc.jobs.quality.steps = doc.jobs.quality.steps.filter( + (step) => step.run !== 'node --test tests/reporting.test.mjs', + ); + }, + ]) + assert.throws(() => validatePolicy(mutation(path, change))); + const files = readPolicyFiles(); + const metadata = JSON.parse(files['action-inputs.json']); + metadata['commercekit-tools/notify'].runtime = 'node26'; + files['action-inputs.json'] = JSON.stringify(metadata); + assert.throws(() => validatePolicy(files)); + assert.throws(() => + validatePolicy( + mutation('.github/actions/build/action.yml', (doc) => { + doc.runs.using = 'node26'; + }), + ), + ); +}); + test('release triggers, write access, floating Actions and shell interpolation fail closed', () => { const path = '.github/workflows/ci.yml'; const mutations = [