ci: prepare infrastructure for dropping Node.js 18/20 in v6#9033
Conversation
- Update engines field to only specify minimum version; move upper bound cap (Node <27) into guardrails so it no longer conflicts between release lines - Derive the `oldest` alias dynamically from engines.node so v5 and v6 resolve the correct minimum without YAML changes (from #9032) - Emit a `supported` output from the node setup action and skip test steps on unsupported versions, allowing explicit version numbers to remain in the matrix for range-coupled jobs (aerospike, confluentinc-kafka-javascript, prisma) - Replace couchbase node-version 18 include with `oldest` so it automatically tracks the minimum supported version - Update .nvmrc to Node 22 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🎉 All green!🧪 All tests passed 🔗 Commit SHA: b7f0570 | Docs | Datadog PR Page | Give us feedback! |
Overall package sizeSelf size: 6.35 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.2.0 | 104.26 kB | 843.44 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
The engines.node field no longer includes an upper bound, and the upper bound is now hardcoded in guardrails. Update tests accordingly: - Fix format assertion regex to /^>=\d+$/ - Remove "too recent" context (upper bound can no longer be simulated via engines.node) - Update "too old" context to use min-only format - Update expected log messages to reflect the new engines string format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BenchmarksBenchmark execution time: 2026-06-25 22:17:45 Comparing candidate commit b7f0570 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1952 metrics, 13 unstable metrics.
|
…ersions - oldest: use awk to parse engines.node from package.json so it works before actions/setup-node runs (no node in PATH in some containers) - supported-check: guard with [ -f package.json ] for sparse checkouts that don't include the root package.json (e.g. all-green job) - supported-check: use node -e instead of node -p, which wasn't available until Node 0.9.4 (guardrails job tests down to Node 0.8) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds nodeMaxMajor to package.json as the shared source of truth for the Node.js upper bound. Both the guardrails and the init integration tests read from it, avoiding the hardcoded 27. Restores the removed "too recent" test context which now manipulates nodeMaxMajor instead of the engines field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…of YAML Add a semver check at the top of withVersions() that returns early when the current Node.js version is outside the supported range (engines.node / nodeMaxMajor). This replaces the YAML-level `if: steps.node.outputs.supported != 'false'` guards on the aerospike, confluentinc-kafka-javascript, and prisma jobs, and removes the `supported` output from the node setup actions entirely. The skip now applies consistently in both CI and local runs without repeating the logic across multiple workflow files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The in-range context sets engines.node to '>=0' to bypass the lower bound, but left nodeMaxMajor at 27. Any Node version >=27 would still abort. Set nodeMaxMajor to 1000 to preserve the original >=0 <1000 behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1045d1c56f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The abort path (NODE_MAJOR >= nodeMaxMajor) was only exercised by integration tests, leaving the changed supportedRange lines uncovered in the unit test coverage report. Add a proxyquire-based unit test that simulates a too-recent Node version to cover those lines. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Read nodeMaxMajor from package.json in generate-supported-integrations so built-in integrations (dns, http, net) keep their upper bound after engines.node was stripped of the <N comparator - Respect DD_INJECT_FORCE in withVersions() so jobs that intentionally run on EOL Node (couchbase, oracledb) are not silently skipped Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Istanbul only emits a single DA entry at the opening line of a multi-line telemetry() call, so the result_reason property string concatenation was never recorded in the lcov. Extracting it into a var statement gives Istanbul a separately-tracked line to instrument. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
packages/dd-trace/test/guardrails/index.spec.js duplicated existing integration coverage. init.spec.js's "when node version is too recent" context already exercises the incompatible-runtime bailout — plus the telemetry, debug logs, and DD_INJECT_FORCE override that the unit test stubbed to no-ops — by setting pkg.nodeMaxMajor = NODE_MAJOR. The unit test was added in #9033 only to satisfy a Codecov patch-coverage flag on lines that PR added to the bailout block (integration tests run in sandboxes and don't count toward nyc). It relied on proxyquire intercepting an in-function require() of package.json, which is environment-dependent: it failed on the v5.110.0 release proposal on Node 26 even though the real bailout — verified by the passing init.spec.js integration test on that same run — works correctly. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
packages/dd-trace/test/guardrails/index.spec.js duplicated existing integration coverage. init.spec.js's "when node version is too recent" context already exercises the incompatible-runtime bailout — plus the telemetry, debug logs, and DD_INJECT_FORCE override that the unit test stubbed to no-ops — by setting pkg.nodeMaxMajor = NODE_MAJOR. The unit test was added in #9033 only to satisfy a Codecov patch-coverage flag on lines that PR added to the bailout block (integration tests run in sandboxes and don't count toward nyc). It relied on proxyquire intercepting an in-function require() of package.json, which is environment-dependent: it failed on the v5.110.0 release proposal on Node 26 even though the real bailout — verified by the passing init.spec.js integration test on that same run — works correctly. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
packages/dd-trace/test/guardrails/index.spec.js duplicated existing integration coverage. init.spec.js's "when node version is too recent" context already exercises the incompatible-runtime bailout — plus the telemetry, debug logs, and DD_INJECT_FORCE override that the unit test stubbed to no-ops — by setting pkg.nodeMaxMajor = NODE_MAJOR. The unit test was added in #9033 only to satisfy a Codecov patch-coverage flag on lines that PR added to the bailout block (integration tests run in sandboxes and don't count toward nyc). It relied on proxyquire intercepting an in-function require() of package.json, which is environment-dependent: it failed on the v5.110.0 release proposal on Node 26 even though the real bailout — verified by the passing init.spec.js integration test on that same run — works correctly. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What does this PR do?
Prepares the CI and runtime infrastructure so that dropping Node.js 18 and 20 support in v6 only requires a one-line change to
engines.nodeinpackage.json.engines.node: changed to only specify the minimum version (>=18); the upper bound is moved into guardrails as a hardcoded constant (27), so it no longer creates conflicts between release lines<27) is now hardcoded in the guard rather than read frompackage.jsonoldestalias: now derived dynamically fromengines.node(integrates #9032), so v5 and v6 resolve the correct minimum Node version without any YAML changessupportedoutput: the node setup action now emits asupportedoutput (true/false) comparing the installed Node version againstengines.node; jobs with explicit version numbers in their matrix (aerospike, confluentinc-kafka-javascript, prisma) use this to skip test steps on unsupported versions while keeping the version/range coupling intactnode-version: 18include witholdestso it automatically tracks the minimum supported version across release lines.nvmrc: updated to Node 22Motivation
When v6 drops Node 18/20 support, the goal is to make that a single
package.jsonchange with no YAML divergence between the v5 and v6 release branches.Additional Notes
The skip mechanism (via
supportedoutput) only applies to jobs that tie specific Node versions to specific library version ranges. Jobs using composite plugin actions (.github/actions/plugins/test, etc.) are unaffected — they already use aliases internally.Generated by Claude Code