Skip to content

feat(core): warn when running on an untested Node.js version - #90

Merged
not-matthias merged 2 commits into
mainfrom
cod-3399-warn-when-running-codspeed-node-with-unsupported-nodejs
Aug 27, 2026
Merged

feat(core): warn when running on an untested Node.js version#90
not-matthias merged 2 commits into
mainfrom
cod-3399-warn-when-running-codspeed-node-with-unsupported-nodejs

Conversation

@not-matthias

Copy link
Copy Markdown
Member

The plugins ship ABI-pinned prebuilds for Node.js 22 and 24 only, so any
other major silently fails to load the native addon with no hint that the
runtime version is the cause.

Emit the warning before the native-binding check in setupCore, so the
version is still printed on the majors where the addon cannot load and
setupCore throws. The playwright plugin gets its own call because it
registers the integration itself and bypasses setupCore.

COD-3399

@codspeed-hq

codspeed-hq Bot commented Aug 27, 2026

Copy link
Copy Markdown

Merging this PR will regress 5 benchmarks

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 9 improved benchmarks
❌ 5 regressed benchmarks
✅ 224 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory long body 1.2 KB 1.8 KB -34.75%
WallTime fibo darwin 7.8 ms 9.1 ms -14.57%
WallTime switch 1 72 ns 84 ns -14.29%
WallTime switch 2 84 ns 96 ns -12.5%
WallTime switch 1 84 ns 96 ns -12.5%
Memory test sync baz 100 25,080 B 656 B ×38
Memory short body 784 B 656 B +19.51%
Memory short body 784 B 656 B +19.51%
WallTime switch 2 96 ns 84 ns +14.29%
WallTime test_iterative_fibo_10 108 ns 96 ns +12.5%
WallTime test sync baz 100 228 ns 204 ns +11.76%
WallTime test sync baz 10 120 ns 108 ns +11.11%
Memory long body 1.3 KB 1.2 KB +10.39%
WallTime short body 2.1 µs 1.9 µs +10.32%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cod-3399-warn-when-running-codspeed-node-with-unsupported-nodejs (818217e) with main (3735985)

Open in CodSpeed

@not-matthias
not-matthias force-pushed the cod-3399-warn-when-running-codspeed-node-with-unsupported-nodejs branch from 7adf1ef to 5d4a240 Compare August 27, 2026 13:05
@not-matthias
not-matthias marked this pull request as ready for review August 27, 2026 13:07
@not-matthias

Copy link
Copy Markdown
Member Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds a one-time warning when CodSpeed runs on a Node.js major outside the ABI-pinned and tested Node.js 22 and 24 set. The warning runs before core native-binding validation and is also integrated into Playwright’s independent setup path.

  • Adds shared supported-version detection and warning helpers to @codspeed/core.
  • Calls the warning from the standard core and Playwright setup paths.
  • Adds integration coverage for supported and unsupported Node.js majors.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, compatibility, or security issues identified.

The warning is reached through both supported integration setup models, is deduplicated per process, and preserves the existing native-binding failure behavior while adding the requested diagnostic.

Important Files Changed

Filename Overview
packages/core/src/nodeVersion.ts Adds supported-major detection and process-wide warning deduplication without an identified correctness issue.
packages/core/src/index.ts Exposes the version helpers and emits the warning before native-binding validation as intended.
packages/playwright-plugin/src/index.ts Adds the warning to Playwright’s independent integration setup path.
packages/core/tests/nodeVersion.integ.test.ts Covers warning generation for the supported and representative unsupported Node.js majors.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Runner integration starts] --> B{Uses setupCore?}
  B -- Yes --> C[Warn once if Node major unsupported]
  C --> D[Check native binding]
  B -- Playwright --> E[ensureIntegrationSetup]
  E --> F[Warn once if Node major unsupported]
  F --> G[Register integration and environment]
Loading

Reviews (1): Last reviewed commit: "feat(core): warn when running on an unte..." | Re-trigger Greptile

@not-matthias
not-matthias force-pushed the cod-3399-warn-when-running-codspeed-node-with-unsupported-nodejs branch from 9fb3388 to 818217e Compare August 27, 2026 14:20
The plugins ship ABI-pinned prebuilds for Node.js 22 and 24 only, so any
other major silently fails to load the native addon with no hint that the
runtime version is the cause.

Emit the warning before the native-binding check in setupCore, so the
version is still printed on the majors where the addon cannot load and
setupCore throws. The playwright plugin gets its own call because it
registers the integration itself and bypasses setupCore.

COD-3399
console.warn only reaches the raw job log, where it is buried in the test
runner output and easy to miss. Route it through warnCi, which uses the
surface each provider offers: a workflow-command annotation on GitHub
Actions, so it shows up in the checks and merge request UI, and yellow on
GitLab CI, mirroring how the runner renders its own warnings there.

COD-3399
@not-matthias
not-matthias force-pushed the cod-3399-warn-when-running-codspeed-node-with-unsupported-nodejs branch from 818217e to 6e78041 Compare August 27, 2026 14:36
@not-matthias
not-matthias merged commit 6e78041 into main Aug 27, 2026
@not-matthias
not-matthias deleted the cod-3399-warn-when-running-codspeed-node-with-unsupported-nodejs branch August 27, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants