Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/_scenario.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-approve-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.21.0
26.13.1
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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).

Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions action-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"api-base-url",
"poll-interval-seconds",
"timeout-minutes"
]
],
"runtime": "node24"
},
"commercekit-tools/ccv2-deploy": {
"ref": "1af852b9a00e981da4ea13565bb18c7ce7fda27f",
Expand All @@ -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",
Expand All @@ -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"
}
}
12 changes: 8 additions & 4 deletions docs/REPORTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion docs/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 .",
Expand Down
34 changes: 34 additions & 0 deletions scripts/check-policy.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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,
);
Expand All @@ -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;
Expand Down Expand Up @@ -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']);
Expand Down
34 changes: 34 additions & 0 deletions tests/workflow-policy.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down