chore(core): Upgrade backend @sentry packages to 8.42.0 (#12061)

This commit is contained in:
Tomi Turtiainen 2024-12-10 14:13:11 +02:00 committed by GitHub
parent 43009b6aa8
commit db09d0e77e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 703 additions and 106 deletions

View file

@ -35,7 +35,6 @@
}, },
"dependencies": { "dependencies": {
"@n8n/config": "workspace:*", "@n8n/config": "workspace:*",
"@sentry/integrations": "catalog:",
"@sentry/node": "catalog:", "@sentry/node": "catalog:",
"acorn": "8.14.0", "acorn": "8.14.0",
"acorn-walk": "8.3.4", "acorn-walk": "8.3.4",

View file

@ -1,6 +1,12 @@
import { RewriteFrames } from '@sentry/integrations'; import {
import { init, setTag, captureException, close } from '@sentry/node'; init,
import type { ErrorEvent, EventHint } from '@sentry/types'; setTag,
captureException,
close,
rewriteFramesIntegration,
type EventHint,
type ErrorEvent,
} from '@sentry/node';
import * as a from 'assert/strict'; import * as a from 'assert/strict';
import { createHash } from 'crypto'; import { createHash } from 'crypto';
import { ApplicationError } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow';
@ -52,7 +58,7 @@ export class ErrorReporter {
beforeSend: async (event, hint) => await this.beforeSend(event, hint), beforeSend: async (event, hint) => await this.beforeSend(event, hint),
integrations: (integrations) => [ integrations: (integrations) => [
...integrations.filter(({ name }) => ENABLED_INTEGRATIONS.includes(name)), ...integrations.filter(({ name }) => ENABLED_INTEGRATIONS.includes(name)),
new RewriteFrames({ root: process.cwd() }), rewriteFramesIntegration({ root: process.cwd() }),
], ],
}); });

View file

@ -98,7 +98,6 @@
"@n8n_io/license-sdk": "2.13.1", "@n8n_io/license-sdk": "2.13.1",
"@oclif/core": "4.0.7", "@oclif/core": "4.0.7",
"@rudderstack/rudder-sdk-node": "2.0.9", "@rudderstack/rudder-sdk-node": "2.0.9",
"@sentry/integrations": "catalog:",
"@sentry/node": "catalog:", "@sentry/node": "catalog:",
"aws4": "1.11.0", "aws4": "1.11.0",
"axios": "catalog:", "axios": "catalog:",

View file

@ -7,7 +7,6 @@ import { InternalServerError } from '@/errors/response-errors/internal-server.er
const init = jest.fn(); const init = jest.fn();
jest.mock('@sentry/integrations');
jest.mock('@sentry/node', () => ({ jest.mock('@sentry/node', () => ({
init, init,
setTag: jest.fn(), setTag: jest.fn(),

View file

@ -94,11 +94,8 @@ export abstract class AbstractServer {
const { app } = this; const { app } = this;
// Augment errors sent to Sentry // Augment errors sent to Sentry
const { const { setupExpressErrorHandler } = await import('@sentry/node');
Handlers: { requestHandler, errorHandler }, setupExpressErrorHandler(app);
} = await import('@sentry/node');
app.use(requestHandler());
app.use(errorHandler());
} }
private setupCommonMiddlewares() { private setupCommonMiddlewares() {

View file

@ -33,8 +33,7 @@ export const initErrorHandling = async () => {
const { init, captureException, setTag } = await import('@sentry/node'); const { init, captureException, setTag } = await import('@sentry/node');
const { RewriteFrames } = await import('@sentry/integrations'); const { requestDataIntegration, rewriteFramesIntegration } = await import('@sentry/node');
const { Integrations } = await import('@sentry/node');
const enabledIntegrations = [ const enabledIntegrations = [
'InboundFilters', 'InboundFilters',
@ -54,8 +53,8 @@ export const initErrorHandling = async () => {
beforeBreadcrumb: () => null, beforeBreadcrumb: () => null,
integrations: (integrations) => [ integrations: (integrations) => [
...integrations.filter(({ name }) => enabledIntegrations.includes(name)), ...integrations.filter(({ name }) => enabledIntegrations.includes(name)),
new RewriteFrames({ root: process.cwd() }), rewriteFramesIntegration({ root: process.cwd() }),
new Integrations.RequestData({ requestDataIntegration({
include: { include: {
cookies: false, cookies: false,
data: false, data: false,

View file

@ -48,7 +48,7 @@ export class MessageEventBusDestinationSentry
environment, environment,
release: N8N_VERSION, release: N8N_VERSION,
transport: Sentry.makeNodeTransport, transport: Sentry.makeNodeTransport,
integrations: Sentry.defaultIntegrations, integrations: Sentry.getDefaultIntegrations({}),
stackParser: Sentry.defaultStackParser, stackParser: Sentry.defaultStackParser,
}); });
} }

View file

@ -133,11 +133,8 @@ export class TaskRunnerServer {
// Augment errors sent to Sentry // Augment errors sent to Sentry
if (this.globalConfig.sentry.backendDsn) { if (this.globalConfig.sentry.backendDsn) {
const { const { setupExpressErrorHandler } = await import('@sentry/node');
Handlers: { requestHandler, errorHandler }, setupExpressErrorHandler(app);
} = await import('@sentry/node');
app.use(requestHandler());
app.use(errorHandler());
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -5,8 +5,7 @@ packages:
- cypress - cypress
catalog: catalog:
'@sentry/integrations': 7.87.0 '@sentry/node': 8.42.0
'@sentry/node': 7.87.0
'@types/basic-auth': ^1.1.3 '@types/basic-auth': ^1.1.3
'@types/express': ^4.17.21 '@types/express': ^4.17.21
'@types/lodash': ^4.14.195 '@types/lodash': ^4.14.195