Skip to content

feat(v8): Bump minimum Node Version to 14 #10527

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

Merged
merged 4 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/flaky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body:
id: job-name
attributes:
label: Name of Job
placeholder: Build & Test / Nextjs (Node 10) Tests
placeholder: Build & Test / Nextjs (Node 14) Tests
description: name of job as reported in the status report
validations:
required: true
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [8, 10, 12, 14, 16, 18, 20, 21]
node: [14, 16, 18, 20, 21]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v4
Expand All @@ -540,9 +540,7 @@ jobs:
- name: Run tests
env:
NODE_VERSION: ${{ matrix.node }}
run: |
[[ $NODE_VERSION == 8 ]] && yarn add --dev --ignore-engines --ignore-scripts --ignore-workspace-root-check [email protected]
yarn test-ci-node
run: yarn test-ci-node
- name: Compute test coverage
uses: codecov/codecov-action@v4
with:
Expand Down Expand Up @@ -585,7 +583,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12, 14, 16, 18, 20, 21]
node: [14, 16, 18, 20, 21]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v4
Expand Down Expand Up @@ -874,7 +872,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12, 14, 16, 18, 20, 21]
node: [14, 16, 18, 20, 21]
typescript:
- false
include:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { conditionalTest } from '../../../utils';
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';

conditionalTest({ min: 14 })('express tracing experimental', () => {
describe('express tracing experimental', () => {
afterAll(() => {
cleanupChildProcesses();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { conditionalTest } from '../../../utils';
import { createRunner } from '../../../utils/runner';

conditionalTest({ min: 14 })('GraphQL/Apollo Tests', () => {
describe('GraphQL/Apollo Tests', () => {
test('CJS - should instrument GraphQL queries used from Apollo Server.', done => {
const EXPECTED_TRANSACTION = {
transaction: 'Test Transaction',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { conditionalTest } from '../../../utils';
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';

jest.setTimeout(20000);

conditionalTest({ min: 14 })('hapi auto-instrumentation', () => {
describe('hapi auto-instrumentation', () => {
afterAll(async () => {
cleanupChildProcesses();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { MongoMemoryServer } from 'mongodb-memory-server-global';

import { conditionalTest } from '../../../utils';
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';

jest.setTimeout(20000);

conditionalTest({ min: 14 })('MongoDB experimental Test', () => {
describe('MongoDB experimental Test', () => {
let mongoServer: MongoMemoryServer;

beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { MongoMemoryServer } from 'mongodb-memory-server-global';

import { conditionalTest } from '../../../utils';
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';

jest.setTimeout(20000);

conditionalTest({ min: 14 })('Mongoose experimental Test', () => {
describe('Mongoose experimental Test', () => {
let mongoServer: MongoMemoryServer;

beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { conditionalTest } from '../../../utils';
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';

conditionalTest({ min: 14 })('mysql auto instrumentation', () => {
describe('mysql auto instrumentation', () => {
afterAll(() => {
cleanupChildProcesses();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { conditionalTest } from '../../../utils';
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';

conditionalTest({ min: 14 })('mysql2 auto instrumentation', () => {
describe('mysql2 auto instrumentation', () => {
afterAll(() => {
cleanupChildProcesses();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { conditionalTest } from '../../../utils';
import { createRunner } from '../../../utils/runner';

conditionalTest({ min: 14 })('postgres auto instrumentation', () => {
describe('postgres auto instrumentation', () => {
test('should auto-instrument `pg` package', done => {
const EXPECTED_TRANSACTION = {
transaction: 'Test Transaction',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils';
import { TestEnv, assertSentryTransaction } from '../../../utils';

// Node 10 is not supported by `graphql-js`
// Ref: https://github.com/graphql/graphql-js/blob/main/package.json
conditionalTest({ min: 12 })('GraphQL/Apollo Tests', () => {
describe('GraphQL/Apollo Tests', () => {
test('should instrument GraphQL and Apollo Server.', async () => {
const env = await TestEnv.init(__dirname);
const envelope = await env.getEnvelopeRequest({ envelopeType: 'transaction' });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { MongoMemoryServer } from 'mongodb-memory-server-global';

import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../../utils';
import { TestEnv, assertSentryTransaction } from '../../../../utils';

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

conditionalTest({ min: 12 })('MongoDB Test', () => {
describe('MongoDB Test', () => {
let mongoServer: MongoMemoryServer;

beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils';
import { TestEnv, assertSentryTransaction } from '../../../utils';

conditionalTest({ min: 12 })('Prisma ORM Integration', () => {
describe('Prisma ORM Integration', () => {
test('should instrument Prisma client for tracing.', async () => {
const env = await TestEnv.init(__dirname);
const envelope = await env.getEnvelopeRequest({ envelopeType: 'transaction' });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils';
import { TestEnv, assertSentryTransaction } from '../../../utils';

// Node 10 is not supported by `graphql-js`
// Ref: https://github.com/graphql/graphql-js/blob/main/package.json
conditionalTest({ min: 12 })('GraphQL/Apollo Tests', () => {
describe('GraphQL/Apollo Tests', () => {
test('should instrument GraphQL and Apollo Server.', async () => {
const env = await TestEnv.init(__dirname);
const envelope = await env.getEnvelopeRequest({ envelopeType: 'transaction' });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { MongoMemoryServer } from 'mongodb-memory-server-global';

import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../../utils';
import { TestEnv, assertSentryTransaction } from '../../../../utils';

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

conditionalTest({ min: 12 })('MongoDB Test', () => {
describe('MongoDB Test', () => {
let mongoServer: MongoMemoryServer;

beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TestEnv, assertSentryTransaction, conditionalTest } from '../../../utils';
import { TestEnv, assertSentryTransaction } from '../../../utils';

conditionalTest({ min: 12 })('Prisma ORM Integration', () => {
describe('Prisma ORM Integration', () => {
test('should instrument Prisma client for tracing.', async () => {
const env = await TestEnv.init(__dirname);
const envelope = await env.getEnvelopeRequest({ envelopeType: 'transaction' });
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=14"
},
"main": "build/bundles/sentry-angular.umd.js",
"module": "build/fesm2015/sentry-angular.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=14"
},
"files": [
"cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=14"
},
"files": [
"cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=14"
},
"files": [
"cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"sentry"
],
"engines": {
"node": ">=8"
"node": ">=14"
},
"files": [
"src"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"sentry"
],
"engines": {
"node": ">=8"
"node": ">=14"
},
"files": [
"src"
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"gatsby-plugin"
],
"engines": {
"node": ">=8"
"node": ">=14"
},
"files": [
"cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=14"
},
"files": [
"cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=14"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=14"
},
"main": "build/cjs/index.server.js",
"module": "build/esm/index.server.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import { NextTestEnv } from './utils/helpers';
// `res.send` multiple times in one request handler.
// https://github.com/getsentry/sentry-javascript/issues/6670
it.skip('should not break API routes on Vercel if people call res.json or res.send multiple times in one request handler', async () => {
if (process.env.NODE_MAJOR === '10') {
console.log('not running doubleEndMethodOnVercel test on Node 10');
return;
}
const env = await NextTestEnv.init();
const url = `${env.url}/api/doubleEndMethodOnVercel`;
const response = await env.getAPIResponse(url);
Expand Down
2 changes: 1 addition & 1 deletion packages/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
## Usage

To use this SDK, call `init(options)` as early as possible in the main entry module. This will initialize the SDK and
hook into the environment. Note that you can turn off almost all side effects using the respective options.
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.

```javascript
// CJS syntax
Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=14"
},
"files": [
"cjs",
Expand Down
3 changes: 1 addition & 2 deletions packages/node/test/async/hooks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import {
} from '@sentry/core';

import { setHooksAsyncContextStrategy } from '../../src/async/hooks';
import { conditionalTest } from '../utils';

conditionalTest({ min: 12 })('setHooksAsyncContextStrategy()', () => {
describe('setHooksAsyncContextStrategy()', () => {
beforeEach(() => {
const hub = new Hub();
// eslint-disable-next-line deprecation/deprecation
Expand Down
8 changes: 1 addition & 7 deletions packages/node/test/integrations/http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,17 +682,11 @@ describe('default protocols', () => {
it('makes https request over http proxy', async () => {
const key = 'catcatchers';
const p = captureBreadcrumb(key);
let nockProtocol = 'https';

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

// TODO (v8): No longer needed once we drop Node 8 support
if (NODE_VERSION.major < 9) {
nockProtocol = 'http';
}

nock(`${nockProtocol}://${key}.ingest.sentry.io`).get('/api/123122332/store/').reply(200);
nock(`https://${key}.ingest.sentry.io`).get('/api/123122332/store/').reply(200);

https.get({
host: `${key}.ingest.sentry.io`,
Expand Down
11 changes: 5 additions & 6 deletions packages/node/test/integrations/undici.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as http from 'http';
import { Transaction, getActiveSpan, getClient, getCurrentScope, setCurrentClient, startSpan } from '@sentry/core';
import { spanToTraceHeader } from '@sentry/core';
import { Hub, makeMain, runWithAsyncContext } from '@sentry/core';
import type { fetch as FetchType } from 'undici';
import { fetch } from 'undici';

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

let hub: Hub;
let fetch: typeof FetchType;

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

Expand Down
5 changes: 0 additions & 5 deletions packages/node/test/manual/webpack-async-context/npm-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ if (Number(process.versions.node.split('.')[0]) >= 18) {
process.exit(0);
}

// Webpack test does not work in Node 8 and below.
if (Number(process.versions.node.split('.')[0]) <= 8) {
process.exit(0);
}

// biome-ignore format: Follow-up for prettier
webpack(
{
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=14"
},
"files": [
"cjs",
Expand Down
Loading