fix(core): Ensure sentry releases follow semver (no-changelog) (#13907)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-03-14 17:48:34 +01:00
committed by GitHub
parent eec325127c
commit 86b791167a
4 changed files with 17 additions and 21 deletions

View File

@@ -5,6 +5,12 @@ import type { ErrorReporter } from 'n8n-core';
import { TaskRunnerSentry } from '../task-runner-sentry';
describe('TaskRunnerSentry', () => {
const commonConfig = {
n8nVersion: '1.0.0',
environment: 'local',
deploymentName: 'test',
};
afterEach(() => {
jest.resetAllMocks();
});
@@ -12,10 +18,8 @@ describe('TaskRunnerSentry', () => {
describe('filterOutUserCodeErrors', () => {
const sentry = new TaskRunnerSentry(
{
...commonConfig,
dsn: 'https://sentry.io/123',
n8nVersion: '1.0.0',
environment: 'local',
deploymentName: 'test',
},
mock(),
);
@@ -103,10 +107,8 @@ describe('TaskRunnerSentry', () => {
it('should not configure sentry if dsn is not set', async () => {
const sentry = new TaskRunnerSentry(
{
...commonConfig,
dsn: '',
n8nVersion: '1.0.0',
environment: 'local',
deploymentName: 'test',
},
mockErrorReporter,
);
@@ -119,10 +121,8 @@ describe('TaskRunnerSentry', () => {
it('should configure sentry if dsn is set', async () => {
const sentry = new TaskRunnerSentry(
{
...commonConfig,
dsn: 'https://sentry.io/123',
n8nVersion: '1.0.0',
environment: 'local',
deploymentName: 'test',
},
mockErrorReporter,
);
@@ -132,7 +132,7 @@ describe('TaskRunnerSentry', () => {
expect(mockErrorReporter.init).toHaveBeenCalledWith({
dsn: 'https://sentry.io/123',
beforeSendFilter: sentry.filterOutUserCodeErrors,
release: '1.0.0',
release: 'n8n@1.0.0',
environment: 'local',
serverName: 'test',
serverType: 'task_runner',
@@ -146,10 +146,8 @@ describe('TaskRunnerSentry', () => {
it('should not shutdown sentry if dsn is not set', async () => {
const sentry = new TaskRunnerSentry(
{
...commonConfig,
dsn: '',
n8nVersion: '1.0.0',
environment: 'local',
deploymentName: 'test',
},
mockErrorReporter,
);
@@ -162,10 +160,8 @@ describe('TaskRunnerSentry', () => {
it('should shutdown sentry if dsn is set', async () => {
const sentry = new TaskRunnerSentry(
{
...commonConfig,
dsn: 'https://sentry.io/123',
n8nVersion: '1.0.0',
environment: 'local',
deploymentName: 'test',
},
mockErrorReporter,
);

View File

@@ -22,7 +22,7 @@ export class TaskRunnerSentry {
await this.errorReporter.init({
serverType: 'task_runner',
dsn,
release: n8nVersion,
release: `n8n@${n8nVersion}`,
environment,
serverName: deploymentName,
beforeSendFilter: this.filterOutUserCodeErrors,