Skip to content

Commit 09e8dd8

Browse files
authored
feat(v8): Bump minimum Node Version to 14 (#10527)
ref #9827 Drops support for node 8, 10, 12. Does not change Next.js tests, as we can look at that in #9838
1 parent c23715a commit 09e8dd8

File tree

52 files changed

+81
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+81
-233
lines changed

.github/ISSUE_TEMPLATE/flaky.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ body:
1818
id: job-name
1919
attributes:
2020
label: Name of Job
21-
placeholder: Build & Test / Nextjs (Node 10) Tests
21+
placeholder: Build & Test / Nextjs (Node 14) Tests
2222
description: name of job as reported in the status report
2323
validations:
2424
required: true

.github/workflows/build.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ jobs:
523523
strategy:
524524
fail-fast: false
525525
matrix:
526-
node: [8, 10, 12, 14, 16, 18, 20, 21]
526+
node: [14, 16, 18, 20, 21]
527527
steps:
528528
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
529529
uses: actions/checkout@v4
@@ -540,9 +540,7 @@ jobs:
540540
- name: Run tests
541541
env:
542542
NODE_VERSION: ${{ matrix.node }}
543-
run: |
544-
[[ $NODE_VERSION == 8 ]] && yarn add --dev --ignore-engines --ignore-scripts --ignore-workspace-root-check [email protected]
545-
yarn test-ci-node
543+
run: yarn test-ci-node
546544
- name: Compute test coverage
547545
uses: codecov/codecov-action@v4
548546
with:
@@ -874,7 +872,7 @@ jobs:
874872
strategy:
875873
fail-fast: false
876874
matrix:
877-
node: [10, 12, 14, 16, 18, 20, 21]
875+
node: [14, 16, 18, 20, 21]
878876
typescript:
879877
- false
880878
include:

dev-packages/node-integration-tests/suites/express/tracing-experimental/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { conditionalTest } from '../../../utils';
21
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
32

4-
conditionalTest({ min: 14 })('express tracing experimental', () => {
3+
describe('express tracing experimental', () => {
54
afterAll(() => {
65
cleanupChildProcesses();
76
});

dev-packages/node-integration-tests/suites/tracing-experimental/apollo-graphql/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { conditionalTest } from '../../../utils';
21
import { createRunner } from '../../../utils/runner';
32

4-
conditionalTest({ min: 14 })('GraphQL/Apollo Tests', () => {
3+
describe('GraphQL/Apollo Tests', () => {
54
test('CJS - should instrument GraphQL queries used from Apollo Server.', done => {
65
const EXPECTED_TRANSACTION = {
76
transaction: 'Test Transaction',

dev-packages/node-integration-tests/suites/tracing-experimental/hapi/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { conditionalTest } from '../../../utils';
21
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
32

43
jest.setTimeout(20000);
54

6-
conditionalTest({ min: 14 })('hapi auto-instrumentation', () => {
5+
describe('hapi auto-instrumentation', () => {
76
afterAll(async () => {
87
cleanupChildProcesses();
98
});

dev-packages/node-integration-tests/suites/tracing-experimental/mongodb/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { MongoMemoryServer } from 'mongodb-memory-server-global';
22

3-
import { conditionalTest } from '../../../utils';
43
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
54

65
jest.setTimeout(20000);
76

8-
conditionalTest({ min: 14 })('MongoDB experimental Test', () => {
7+
describe('MongoDB experimental Test', () => {
98
let mongoServer: MongoMemoryServer;
109

1110
beforeAll(async () => {

dev-packages/node-integration-tests/suites/tracing-experimental/mongoose/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { MongoMemoryServer } from 'mongodb-memory-server-global';
22

3-
import { conditionalTest } from '../../../utils';
43
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
54

65
jest.setTimeout(20000);
76

8-
conditionalTest({ min: 14 })('Mongoose experimental Test', () => {
7+
describe('Mongoose experimental Test', () => {
98
let mongoServer: MongoMemoryServer;
109

1110
beforeAll(async () => {

dev-packages/node-integration-tests/suites/tracing-experimental/mysql/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { conditionalTest } from '../../../utils';
21
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
32

4-
conditionalTest({ min: 14 })('mysql auto instrumentation', () => {
3+
describe('mysql auto instrumentation', () => {
54
afterAll(() => {
65
cleanupChildProcesses();
76
});

dev-packages/node-integration-tests/suites/tracing-experimental/mysql2/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { conditionalTest } from '../../../utils';
21
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
32

4-
conditionalTest({ min: 14 })('mysql2 auto instrumentation', () => {
3+
describe('mysql2 auto instrumentation', () => {
54
afterAll(() => {
65
cleanupChildProcesses();
76
});

dev-packages/node-integration-tests/suites/tracing-experimental/postgres/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { conditionalTest } from '../../../utils';
21
import { createRunner } from '../../../utils/runner';
32

4-
conditionalTest({ min: 14 })('postgres auto instrumentation', () => {
3+
describe('postgres auto instrumentation', () => {
54
test('should auto-instrument `pg` package', done => {
65
const EXPECTED_TRANSACTION = {
76
transaction: 'Test Transaction',

dev-packages/node-integration-tests/suites/tracing-new/apollo-graphql/test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils';
1+
import { TestEnv, assertSentryTransaction } from '../../../utils';
22

3-
// Node 10 is not supported by `graphql-js`
4-
// Ref: https://github.com/graphql/graphql-js/blob/main/package.json
5-
conditionalTest({ min: 12 })('GraphQL/Apollo Tests', () => {
3+
describe('GraphQL/Apollo Tests', () => {
64
test('should instrument GraphQL and Apollo Server.', async () => {
75
const env = await TestEnv.init(__dirname);
86
const envelope = await env.getEnvelopeRequest({ envelopeType: 'transaction' });

dev-packages/node-integration-tests/suites/tracing-new/auto-instrument/mongodb/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { MongoMemoryServer } from 'mongodb-memory-server-global';
22

3-
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../../utils';
3+
import { TestEnv, assertSentryTransaction } from '../../../../utils';
44

55
// This test can take longer.
66
jest.setTimeout(15000);
77

8-
conditionalTest({ min: 12 })('MongoDB Test', () => {
8+
describe('MongoDB Test', () => {
99
let mongoServer: MongoMemoryServer;
1010

1111
beforeAll(async () => {

dev-packages/node-integration-tests/suites/tracing-new/prisma-orm/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils';
1+
import { TestEnv, assertSentryTransaction } from '../../../utils';
22

3-
conditionalTest({ min: 12 })('Prisma ORM Integration', () => {
3+
describe('Prisma ORM Integration', () => {
44
test('should instrument Prisma client for tracing.', async () => {
55
const env = await TestEnv.init(__dirname);
66
const envelope = await env.getEnvelopeRequest({ envelopeType: 'transaction' });

dev-packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils';
1+
import { TestEnv, assertSentryTransaction } from '../../../utils';
22

3-
// Node 10 is not supported by `graphql-js`
4-
// Ref: https://github.com/graphql/graphql-js/blob/main/package.json
5-
conditionalTest({ min: 12 })('GraphQL/Apollo Tests', () => {
3+
describe('GraphQL/Apollo Tests', () => {
64
test('should instrument GraphQL and Apollo Server.', async () => {
75
const env = await TestEnv.init(__dirname);
86
const envelope = await env.getEnvelopeRequest({ envelopeType: 'transaction' });

dev-packages/node-integration-tests/suites/tracing/auto-instrument/mongodb/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { MongoMemoryServer } from 'mongodb-memory-server-global';
22

3-
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../../utils';
3+
import { TestEnv, assertSentryTransaction } from '../../../../utils';
44

55
// This test can take longer.
66
jest.setTimeout(15000);
77

8-
conditionalTest({ min: 12 })('MongoDB Test', () => {
8+
describe('MongoDB Test', () => {
99
let mongoServer: MongoMemoryServer;
1010

1111
beforeAll(async () => {

dev-packages/node-integration-tests/suites/tracing/prisma-orm/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils';
1+
import { TestEnv, assertSentryTransaction } from '../../../utils';
22

3-
conditionalTest({ min: 12 })('Prisma ORM Integration', () => {
3+
describe('Prisma ORM Integration', () => {
44
test('should instrument Prisma client for tracing.', async () => {
55
const env = await TestEnv.init(__dirname);
66
const envelope = await env.getEnvelopeRequest({ envelopeType: 'transaction' });

packages/angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {
10-
"node": ">=8"
10+
"node": ">=14"
1111
},
1212
"main": "build/bundles/sentry-angular.umd.js",
1313
"module": "build/fesm2015/sentry-angular.js",

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {
10-
"node": ">=8"
10+
"node": ">=14"
1111
},
1212
"files": [
1313
"cjs",

packages/bun/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {
10-
"node": ">=8"
10+
"node": ">=14"
1111
},
1212
"files": [
1313
"cjs",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {
10-
"node": ">=8"
10+
"node": ">=14"
1111
},
1212
"files": [
1313
"cjs",

packages/eslint-config-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"sentry"
1313
],
1414
"engines": {
15-
"node": ">=8"
15+
"node": ">=14"
1616
},
1717
"files": [
1818
"src"

packages/eslint-plugin-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"sentry"
1313
],
1414
"engines": {
15-
"node": ">=8"
15+
"node": ">=14"
1616
},
1717
"files": [
1818
"src"

packages/gatsby/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"gatsby-plugin"
1212
],
1313
"engines": {
14-
"node": ">=8"
14+
"node": ">=14"
1515
},
1616
"files": [
1717
"cjs",

packages/hub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {
10-
"node": ">=8"
10+
"node": ">=14"
1111
},
1212
"files": [
1313
"cjs",

packages/integrations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {
10-
"node": ">=8"
10+
"node": ">=14"
1111
},
1212
"publishConfig": {
1313
"access": "public"

packages/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {
10-
"node": ">=8"
10+
"node": ">=14"
1111
},
1212
"main": "build/cjs/index.server.js",
1313
"module": "build/esm/index.server.js",

packages/nextjs/test/integration/test/server/doubleEndMethodOnVercel.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import { NextTestEnv } from './utils/helpers';
44
// `res.send` multiple times in one request handler.
55
// https://github.com/getsentry/sentry-javascript/issues/6670
66
it.skip('should not break API routes on Vercel if people call res.json or res.send multiple times in one request handler', async () => {
7-
if (process.env.NODE_MAJOR === '10') {
8-
console.log('not running doubleEndMethodOnVercel test on Node 10');
9-
return;
10-
}
117
const env = await NextTestEnv.init();
128
const url = `${env.url}/api/doubleEndMethodOnVercel`;
139
const response = await env.getAPIResponse(url);

packages/node/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
## Usage
1919

2020
To use this SDK, call `init(options)` as early as possible in the main entry module. This will initialize the SDK and
21-
hook into the environment. Note that you can turn off almost all side effects using the respective options.
21+
hook into the environment. Note that you can turn off almost all side effects using the respective options. Minimum supported Node version is Node 14.
2222

2323
```javascript
2424
// CJS syntax

packages/node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {
10-
"node": ">=8"
10+
"node": ">=14"
1111
},
1212
"files": [
1313
"cjs",

packages/node/test/async/hooks.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import {
1010
} from '@sentry/core';
1111

1212
import { setHooksAsyncContextStrategy } from '../../src/async/hooks';
13-
import { conditionalTest } from '../utils';
1413

15-
conditionalTest({ min: 12 })('setHooksAsyncContextStrategy()', () => {
14+
describe('setHooksAsyncContextStrategy()', () => {
1615
beforeEach(() => {
1716
const hub = new Hub();
1817
// eslint-disable-next-line deprecation/deprecation

packages/node/test/integrations/http.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -682,17 +682,11 @@ describe('default protocols', () => {
682682
it('makes https request over http proxy', async () => {
683683
const key = 'catcatchers';
684684
const p = captureBreadcrumb(key);
685-
let nockProtocol = 'https';
686685

687686
const proxy = 'http://some.url:3128';
688687
const agent = new HttpsProxyAgent(proxy);
689688

690-
// TODO (v8): No longer needed once we drop Node 8 support
691-
if (NODE_VERSION.major < 9) {
692-
nockProtocol = 'http';
693-
}
694-
695-
nock(`${nockProtocol}://${key}.ingest.sentry.io`).get('/api/123122332/store/').reply(200);
689+
nock(`https://${key}.ingest.sentry.io`).get('/api/123122332/store/').reply(200);
696690

697691
https.get({
698692
host: `${key}.ingest.sentry.io`,

packages/node/test/integrations/undici.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as http from 'http';
22
import { Transaction, getActiveSpan, getClient, getCurrentScope, setCurrentClient, startSpan } from '@sentry/core';
33
import { spanToTraceHeader } from '@sentry/core';
44
import { Hub, makeMain, runWithAsyncContext } from '@sentry/core';
5-
import type { fetch as FetchType } from 'undici';
5+
import { fetch } from 'undici';
66

77
import { NodeClient } from '../../src/client';
88
import type { Undici, UndiciOptions } from '../../src/integrations/undici';
@@ -13,17 +13,16 @@ import { conditionalTest } from '../utils';
1313
const SENTRY_DSN = 'https://[email protected]/0';
1414

1515
let hub: Hub;
16-
let fetch: typeof FetchType;
1716

1817
beforeAll(async () => {
1918
try {
2019
await setupTestServer();
21-
// need to conditionally require `undici` because it's not available in Node 10
22-
// eslint-disable-next-line @typescript-eslint/no-var-requires
23-
fetch = require('undici').fetch;
2420
} catch (e) {
2521
// eslint-disable-next-line no-console
26-
console.warn('Undici integration tests are skipped because undici is not installed.');
22+
const error = new Error('Undici integration tests are skipped because test server could not be set up.');
23+
// This needs lib es2022 and newer so marking as any
24+
(error as any).cause = e;
25+
throw e;
2726
}
2827
});
2928

packages/node/test/manual/webpack-async-context/npm-build.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ if (Number(process.versions.node.split('.')[0]) >= 18) {
77
process.exit(0);
88
}
99

10-
// Webpack test does not work in Node 8 and below.
11-
if (Number(process.versions.node.split('.')[0]) <= 8) {
12-
process.exit(0);
13-
}
14-
1510
// biome-ignore format: Follow-up for prettier
1611
webpack(
1712
{

packages/opentelemetry-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {
10-
"node": ">=8"
10+
"node": ">=14"
1111
},
1212
"files": [
1313
"cjs",

packages/profiling-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"sentry-prune-profiler-binaries": "scripts/prune-profiler-binaries.js"
2020
},
2121
"engines": {
22-
"node": ">=8.0.0"
22+
"node": ">=14"
2323
},
2424
"publishConfig": {
2525
"access": "public"

0 commit comments

Comments
 (0)