-
-
Notifications
You must be signed in to change notification settings - Fork 159
ci: put every Node the project chooses on 26, and assert it from one file #7967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| **Every Node the project chooses is now 26, and one file is asserted to be the source (#7967).** `.node-version` (26.5.1) has been the authoritative oracle since #6367, but the pin leaked twice: CLAUDE.md's prose drifted off the file (#7599), and `.github/workflows/npm-launcher.yml` was created by #6350 on the *same day* #6367 converted every workflow that existed, keeping that day's ambient `"22.23.1"` literal by omission rather than by decision. CLAUDE.md compounded it by saying "**Two** workflows are deliberately exempt" and then listing three, which is why the fourth pin read as accounted-for. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Correct the release-note claim. “Every Node the project chooses is now 26” is false. This PR deliberately retains Node 22 for Based on learnings: “describe the final shipped behavior as one coherent release-note entry.” 🧰 Tools🪛 LanguageTool[uncategorized] ~1-~1: The official name of this software platform is spelled with a capital “H”. (GITHUB) 🤖 Prompt for AI AgentsSource: Learnings |
||
|
|
||
| Changed: | ||
|
|
||
| - **`npm-launcher.yml`** (both jobs): `"22.23.1"` → `node-version-file: .node-version`. This one is behaviour-sensitive, not a toolchain: the `detect-self-test` job runs `node npm/perry/test/detect.test.cjs`, exercising `npm/perry/bin/detect.cjs` — shipped JS that every installing user executes. Safe on the `ubuntu-22.04` glibc-2.35 job: Node 26 requires glibc ≥ 2.28 (nodejs/node `v26.x` BUILDING.md, Tier 1 for linux x64/arm64). | ||
| - **`release-packages.yml`**: `"20"` → `"26"`. Node 20 reached end-of-life on 2026-04-30, and this is the repo's most privileged job (`id-token: write`, OIDC-publishes every platform package) — an EOL runtime there is a defect independent of the sweep. | ||
| - **`release-hono-server.yml`**: `"24"` → `"26"`. | ||
|
|
||
| Both release workflows stay pinned to a bare **major literal** rather than `node-version-file`, deliberately: they are npm *publishing* toolchains, and a gap-suite oracle bump made for parity reasons must never be able to move the runtime that publishes releases. Their `npm install -g npm@latest` step is kept — Node 26 already clears the OIDC ≥ 11.5.1 floor, but pinning the guarantee beats inheriting it. | ||
|
|
||
| New **`scripts/check_node_version_consistency.py`**, wired as a step in `lint` (a required context), following the `check_gc_doc_claims.py` pattern: it re-derives every restatement of a Node version from the file that restatement quotes (CLAUDE.md ×2, `llms.txt`, `test-parity/node-compat-matrix.baseline.json`), and requires every literal `node-version:` under `.github/workflows/` to be a *registered exemption carrying a reason*. A rewording that removes a marker fails rather than silently ceasing to be checked; exemptions are asserted against the tree, so one that stops matching fails and must be updated or deleted. It deliberately does **not** assert that `.node-version` and `external-tools.json`'s pin are equal — CLAUDE.md documents the compat-matrix oracle as independent, so encoding that coupling would be wrong. `--self-test` proves each rule can fail (including both vacuity floors); reverting `npm-launcher.yml` to `"22.23.1"` reproduces the historical bug as two named failures. | ||
|
|
||
| **Not changed, and this is the substantive finding: `benchmarks/public-baseline-config.json` still pins `v22.23.1`.** Perry's *published* performance comparison is measured against a runtime four majors old (pre-existing — #6376, regenerated #7285; #7958 only made it declarative, which is how it became visible). It cannot be edited on its own: the file is in `public_baseline.HARNESS_PATHS`, so its bytes feed the committed artifact's `harness_fingerprint`, and `validate_public()` separately compares the config against the version recorded in `benchmarks/results/public-node-bun-v1.json`. Measured rather than assumed — flipping the pin to `v26.5.1` and running the gate exits **2** with `public artifact benchmark harness changed`, and that gate is the "Public benchmark evidence freshness" step of **`lint`**. Shipping the pin edit alone would therefore not be "stale but honest"; it would be a required gate red for `main` and every open PR. The pin and its ~2 h measurement are atomic by design (#7282/#7958). | ||
|
|
||
| It is instead registered as a **self-clearing exemption** carrying the runbook: regenerate on `perry@perry-macos.local` (the Apple M1 / 8 GB mini recorded in the artifact's `host` block — the artifact pins host identity, so regenerating elsewhere replaces the baseline rather than updating it), ~2 h across five components, each gated on ≤ 25% CPU active for 60 consecutive seconds. When that happens the config value moves, the exemption stops matching, and the check fails until the entry is deleted — so the stale pin cannot quietly become a fossil. **Expect the regeneration to reduce Perry's published advantage**: Node 26 ships a materially newer V8 than Node 22. The magnitude was not measured, because the box available for this work has run at load 30–200 all day and cannot satisfy the artifact's own quiet-host policy; a number produced there would be junk wearing a decimal point. | ||
|
|
||
| Also corrected: `external-tools.json` instructed readers to bump "the `NODE_PIN.version` constant in `scripts/node_compat_matrix.mjs`", which does not exist — that script reads `external-tools.json` itself. | ||
|
|
||
| Out of scope: `bun: 1.3.14` in the same config is **not** equally stale (1.3.x is the current Bun line), but it is frozen by the same atomicity rule and should be re-pinned in the same regeneration run. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 50369
🌐 Web query:
actions/setup-node@v7 registry-url npm trusted publishing OIDC documentation💡 Result:
In actions/setup-node@v7, using Trusted Publishing (OIDC) to publish to npm requires specific configuration to replace long-lived npm tokens with short-lived OIDC tokens [1][2]. Requirements: - npm version: You must use npm ≥ 11.5.1 [2]. - Node.js: Node.js 24 or newer is recommended as it includes a compatible version of npm [2]. - npm Trusted Publisher configuration: You must configure a Trusted Publisher in npm that matches your GitHub repository, workflow, and optional environment [1][2]. Workflow Configuration: To enable OIDC, you must explicitly grant the id-token: write permission in your GitHub Actions workflow [1][2]. Unlike classic token-based authentication, OIDC does not require or use the NODE_AUTH_TOKEN secret during the publish step [3][4]. Example Workflow Snippet: permissions: contents: read id-token: write # Required for OIDC steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: '24' registry-url: 'https://registry.npmjs.org' # Recommended to disable automatic caching if not strictly needed # to mitigate potential cache poisoning risks package-manager-cache: false - run: npm ci - run: npm run build --if-present - run: npm publish Important Considerations: - Avoiding Token Conflicts: In v7.0.0, the action no longer exports a dummy NODE_AUTH_TOKEN [5]. This change prevents issues where the action might inadvertently attempt classic authentication when only OIDC is intended, which previously caused some workflows to fail with ENEEDAUTH or E404 [3][6]. - Security Note: When using Trusted Publishing, it is recommended to set package-manager-cache: false to reduce the risk of cache poisoning, as cached data can expose credentials to attacker-controlled code [1][2]. - Matching Identity: Ensure your GitHub repository, workflow file path, and environment (if used) match exactly what is defined in the npm Trusted Publisher settings, or the publish may fail with an E404 error [1][2].
Citations:
🌐 Web query:
site:docs.npmjs.com trusted publishers GitHub Actions registry-url npm💡 Result:
When using Trusted Publishers with GitHub Actions to publish packages to npm, you do not need to configure the registry-url in the same way you would with traditional access tokens [1][2]. Trusted publishing uses OpenID Connect (OIDC) to authenticate automatically, eliminating the need for long-lived NPM_TOKEN secrets [2][3]. For your GitHub Actions workflow, follow these requirements: 1. Permissions: You must explicitly grant your workflow the ability to generate an OIDC token by setting the id-token permission to write [1]. permissions: id-token: write contents: read 2. Setup: Use actions/setup-node to prepare your environment. While you can still specify the registry-url if needed for other operations, the publishing step will use the trusted OIDC relationship automatically [1]. - uses: actions/setup-node@v6 with: node-version: '24' registry-url: 'https://registry.npmjs.org' 3. Publishing: Simply run npm publish in your workflow [1]. You do not need to provide an authentication token as an environment variable or via an.npmrc file, as the npm CLI will detect the OIDC token provided by the GitHub Actions environment [1][2]. To configure the trust relationship, use the npm trust command locally on your machine before pushing your workflow: npm trust github [package-name] --file [workflow-filename.yml] --repo [owner/repo] --allow-publish [4][5]. Using Trusted Publishers is the recommended method for publishing from CI/CD, as it improves security by removing the need for long-lived tokens and enables the generation of provenance statements for your packages [2][3].
Citations:
Correct the
registry-urlcomment.registry-urldoes not contradict npm Trusted Publishing. State that it is unnecessary becauseregistry.npmjs.orgis the default registry.🤖 Prompt for AI Agents
Source: MCP tools