ci(engines): widen engines.node to >=18 in CI to keep Node 18/20 jobs running#9145
Conversation
|
Overall package sizeSelf size: 6.43 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9145 +/- ##
==========================================
- Coverage 93.73% 93.71% -0.03%
==========================================
Files 892 892
Lines 51236 51238 +2
Branches 11924 11923 -1
==========================================
- Hits 48025 48016 -9
- Misses 3211 3222 +11 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… running engines.node is bumped to >=22 to match the supported runtime range. The runtime guard (packages/dd-trace/src/guardrails/index.js) and the withVersions test helper both read engines.node and bail when the running major is below it, so on Node 18/20 every suite would silently skip (withVersions returns early, the init guard short-circuits, mocha reports 0 passing). CI widens engines.node back to >=18 at the action level (right after actions/setup-node) via scripts/ci/widen-engines-for-ci.js, so Node 18/20 jobs keep exercising real tests. The on-disk package.json that ships is unchanged (engines.node stays >=22). Co-authored-by: Cursor <cursoragent@cursor.com>
The widen step lives in the shared node/setup action, so it ran on every CI job, including integration-guardrails-unsupported, which installs Node 0.8 through 14 on purpose to verify the runtime guard aborts. Two problems: the script used a node:-prefixed require (unsupported before Node 14.18) so it crashed and failed those jobs, and even had it run, rewriting engines.node there would undermine a test that relies on the shipped >=22. Gate the step in the action so it only runs when the installed major is 18 or 20 (the supported majors the >=22 bump newly excludes). Every other version, including the unsupported matrix, keeps the shipped >=22 and the script is never parsed by a runtime too old to run it. Co-authored-by: Cursor <cursoragent@cursor.com>
…s.node Commit 1a79e10 (prepare to drop Node 18/20) changed the `oldest` version alias to read the minimum major out of package.json engines.node. With engines.node now bumped to >=22, `oldest` resolved to Node 22, which dropped Node 18 from the matrix and shifted the child_process job's legs to {22,20,24,26}. The resulting leg order (Node 22 first, then 20) destabilized the Bluebird global-Promise tests on the Node 20 leg, which pass on master's {18,20,24,26}. Pin `oldest` back to a literal 18 so CI keeps testing the oldest version we still exercise, decoupled from the shipped engines floor. This restores the matrix and leg order to match master; the widen step still restores >=18 on the 18/20 legs. Co-authored-by: Cursor <cursoragent@cursor.com>
97be674 to
b13d145
Compare
BenchmarksBenchmark execution time: 2026-06-30 18:13:53 Comparing candidate commit 14ae973 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2253 metrics, 33 unstable metrics.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14ae9730b6
ℹ️ 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".
… running (#9145) * ci(engines): widen engines.node to >=18 in CI to keep Node 18/20 jobs running engines.node is bumped to >=22 to match the supported runtime range. The runtime guard (packages/dd-trace/src/guardrails/index.js) and the withVersions test helper both read engines.node and bail when the running major is below it, so on Node 18/20 every suite would silently skip (withVersions returns early, the init guard short-circuits, mocha reports 0 passing). CI widens engines.node back to >=18 at the action level (right after actions/setup-node) via scripts/ci/widen-engines-for-ci.js, so Node 18/20 jobs keep exercising real tests. The on-disk package.json that ships is unchanged (engines.node stays >=22). Co-authored-by: Cursor <cursoragent@cursor.com> * ci(engines): only widen engines.node on Node 18/20 jobs The widen step lives in the shared node/setup action, so it ran on every CI job, including integration-guardrails-unsupported, which installs Node 0.8 through 14 on purpose to verify the runtime guard aborts. Two problems: the script used a node:-prefixed require (unsupported before Node 14.18) so it crashed and failed those jobs, and even had it run, rewriting engines.node there would undermine a test that relies on the shipped >=22. Gate the step in the action so it only runs when the installed major is 18 or 20 (the supported majors the >=22 bump newly excludes). Every other version, including the unsupported matrix, keeps the shipped >=22 and the script is never parsed by a runtime too old to run it. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(node): pin oldest alias to Node 18 instead of deriving from engines.node Commit 1a79e10 (prepare to drop Node 18/20) changed the `oldest` version alias to read the minimum major out of package.json engines.node. With engines.node now bumped to >=22, `oldest` resolved to Node 22, which dropped Node 18 from the matrix and shifted the child_process job's legs to {22,20,24,26}. The resulting leg order (Node 22 first, then 20) destabilized the Bluebird global-Promise tests on the Node 20 leg, which pass on master's {18,20,24,26}. Pin `oldest` back to a literal 18 so CI keeps testing the oldest version we still exercise, decoupled from the shipped engines floor. This restores the matrix and leg order to match master; the widen step still restores >=18 on the 18/20 legs. Co-authored-by: Cursor <cursoragent@cursor.com> * add early return --------- Co-authored-by: Cursor <cursoragent@cursor.com>
… running (#9145) * ci(engines): widen engines.node to >=18 in CI to keep Node 18/20 jobs running engines.node is bumped to >=22 to match the supported runtime range. The runtime guard (packages/dd-trace/src/guardrails/index.js) and the withVersions test helper both read engines.node and bail when the running major is below it, so on Node 18/20 every suite would silently skip (withVersions returns early, the init guard short-circuits, mocha reports 0 passing). CI widens engines.node back to >=18 at the action level (right after actions/setup-node) via scripts/ci/widen-engines-for-ci.js, so Node 18/20 jobs keep exercising real tests. The on-disk package.json that ships is unchanged (engines.node stays >=22). Co-authored-by: Cursor <cursoragent@cursor.com> * ci(engines): only widen engines.node on Node 18/20 jobs The widen step lives in the shared node/setup action, so it ran on every CI job, including integration-guardrails-unsupported, which installs Node 0.8 through 14 on purpose to verify the runtime guard aborts. Two problems: the script used a node:-prefixed require (unsupported before Node 14.18) so it crashed and failed those jobs, and even had it run, rewriting engines.node there would undermine a test that relies on the shipped >=22. Gate the step in the action so it only runs when the installed major is 18 or 20 (the supported majors the >=22 bump newly excludes). Every other version, including the unsupported matrix, keeps the shipped >=22 and the script is never parsed by a runtime too old to run it. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(node): pin oldest alias to Node 18 instead of deriving from engines.node Commit 1a79e10 (prepare to drop Node 18/20) changed the `oldest` version alias to read the minimum major out of package.json engines.node. With engines.node now bumped to >=22, `oldest` resolved to Node 22, which dropped Node 18 from the matrix and shifted the child_process job's legs to {22,20,24,26}. The resulting leg order (Node 22 first, then 20) destabilized the Bluebird global-Promise tests on the Node 20 leg, which pass on master's {18,20,24,26}. Pin `oldest` back to a literal 18 so CI keeps testing the oldest version we still exercise, decoupled from the shipped engines floor. This restores the matrix and leg order to match master; the widen step still restores >=18 on the 18/20 legs. Co-authored-by: Cursor <cursoragent@cursor.com> * add early return --------- Co-authored-by: Cursor <cursoragent@cursor.com>
… running (#9145) * ci(engines): widen engines.node to >=18 in CI to keep Node 18/20 jobs running engines.node is bumped to >=22 to match the supported runtime range. The runtime guard (packages/dd-trace/src/guardrails/index.js) and the withVersions test helper both read engines.node and bail when the running major is below it, so on Node 18/20 every suite would silently skip (withVersions returns early, the init guard short-circuits, mocha reports 0 passing). CI widens engines.node back to >=18 at the action level (right after actions/setup-node) via scripts/ci/widen-engines-for-ci.js, so Node 18/20 jobs keep exercising real tests. The on-disk package.json that ships is unchanged (engines.node stays >=22). Co-authored-by: Cursor <cursoragent@cursor.com> * ci(engines): only widen engines.node on Node 18/20 jobs The widen step lives in the shared node/setup action, so it ran on every CI job, including integration-guardrails-unsupported, which installs Node 0.8 through 14 on purpose to verify the runtime guard aborts. Two problems: the script used a node:-prefixed require (unsupported before Node 14.18) so it crashed and failed those jobs, and even had it run, rewriting engines.node there would undermine a test that relies on the shipped >=22. Gate the step in the action so it only runs when the installed major is 18 or 20 (the supported majors the >=22 bump newly excludes). Every other version, including the unsupported matrix, keeps the shipped >=22 and the script is never parsed by a runtime too old to run it. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(node): pin oldest alias to Node 18 instead of deriving from engines.node Commit 1a79e10 (prepare to drop Node 18/20) changed the `oldest` version alias to read the minimum major out of package.json engines.node. With engines.node now bumped to >=22, `oldest` resolved to Node 22, which dropped Node 18 from the matrix and shifted the child_process job's legs to {22,20,24,26}. The resulting leg order (Node 22 first, then 20) destabilized the Bluebird global-Promise tests on the Node 20 leg, which pass on master's {18,20,24,26}. Pin `oldest` back to a literal 18 so CI keeps testing the oldest version we still exercise, decoupled from the shipped engines floor. This restores the matrix and leg order to match master; the widen step still restores >=18 on the 18/20 legs. Co-authored-by: Cursor <cursoragent@cursor.com> * add early return --------- Co-authored-by: Cursor <cursoragent@cursor.com>
What does this PR do?
Bumps the shipped
package.json#engines.nodefrom>=18to>=22, while keeping CI exercising real tests on Node 18 and 20 (rather than letting them silently skip). Concretely:package.json#engines.nodeto>=22(nodeMaxMajorunchanged at27). This is the value that ships.scripts/ci/widen-engines-for-ci.js, which readspackage.json, setsengines.nodeto>=18, writes it back, and logs the before/after..github/actions/node/setup/action.ymlas a new step right afteractions/setup-node. The step is gated to Node majors 18 and 20: on those legs it widensengines.nodeto>=18; on every other version it leaves the shipped>=22untouched and never even invokes the script.oldestversion alias in the same action back to a literal Node 18, instead of deriving the minimum major fromengines.node.Motivation
With
engines.nodebumped to>=22, the runtime guard inpackages/dd-trace/src/guardrails/index.jsand thewithVersionstest helper both readengines.nodeand bail when the running major is below it. On Node 18/20 that means every suite would silently skip:withVersionsreturns early, theinit.jsguard short-circuits, and mocha reports 0 passing — green CI that exercised nothing.Widening
engines.nodeto>=18at the action level keeps the Node 18/20 jobs exercising real tests. The widen step is the only new CI logic — there are no per-spec or per-helper workarounds. The on-diskpackage.jsonthat ships is unchanged:engines.nodestays>=22; the widening only happens in the CI checkout at runtime.Two follow-up fixes were needed so the rest of CI keeps working with the bumped floor:
Gate the widen step to Node 18/20. The step lives in the shared
node/setupaction, so it ran on every job — includingintegration-guardrails-unsupported, which installs ancient Node (0.8–14) on purpose to verify the guard aborts. The script used anode:-prefixed require (unsupported before Node 14.18) and crashed there; even without the crash, rewritingengines.nodeon those runtimes would undermine that job. Gating to majors 18/20 fixes both, and means the script is only ever parsed by a runtime new enough to run it. The unsupported matrix keeps seeing the shipped>=22.Pin the
oldestalias to Node 18. A prior commit (prepare infrastructure for dropping Node 18/20 in v6, ci: prepare infrastructure for dropping Node.js 18/20 in v6 #9033) had changed theoldestalias to derive the minimum major fromengines.node. Onceengines.nodebecame>=22,oldestresolved to Node 22, which dropped Node 18 from the matrix and shifted thechild_processjob's legs to{22, 20, 24, 26}. That leg order (Node 22 first, then 20) destabilized the Bluebird global-Promisetests on the Node 20 leg, which pass on master's{18, 20, 24, 26}. Pinningoldestback to a literal 18 restores the matrix and leg order to match master; the widen step still restores>=18on the 18/20 legs.Additional Notes
CI on the latest commit: the previously red
child_process,instrumentation-child_process, and allintegration-guardrails/integration-guardrails-unsupported/unit-guardrailsjobs are green. (ThePerformance and correctness testsfailure is unrelated to this change and is being handled separately.)Verified locally with engines widened to
>=18:./node_modules/.bin/mocha --timeout 30000 packages/dd-trace/test/plugins/with-versions.spec.js→ 2 passing./node_modules/.bin/mocha --timeout 60000 packages/dd-trace/test/profiling/exporters/agent.spec.js→ 7 passingNo production code (
packages/*/src/) is touched.Made with Cursor