From fcbf0ea771a22f9886cfdd96902a55097aacae64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Thu, 28 Nov 2024 17:33:25 +0100 Subject: [PATCH] ci: Report test-workflows errors to Sentry (no-changelog) (#11944) --- .github/workflows/test-workflows.yml | 4 +++- packages/cli/src/commands/execute-batch.ts | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-workflows.yml b/.github/workflows/test-workflows.yml index 2bb91dd065..ec9de8dedc 100644 --- a/.github/workflows/test-workflows.yml +++ b/.github/workflows/test-workflows.yml @@ -74,6 +74,8 @@ jobs: N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}} SKIP_STATISTICS_EVENTS: true DB_SQLITE_POOL_SIZE: 4 + N8N_SENTRY_DSN: ${{secrets.CI_SENTRY_DSN}} + # - # name: Export credentials # if: always() @@ -93,7 +95,7 @@ jobs: - name: Notify Slack on failure uses: act10ns/slack@v2.0.0 - if: failure() + if: failure() && github.ref == 'refs/heads/master' with: status: ${{ job.status }} channel: '#alerts-build' diff --git a/packages/cli/src/commands/execute-batch.ts b/packages/cli/src/commands/execute-batch.ts index fbbecd2cbb..a70717c40b 100644 --- a/packages/cli/src/commands/execute-batch.ts +++ b/packages/cli/src/commands/execute-batch.ts @@ -4,7 +4,7 @@ import fs from 'fs'; import { diff } from 'json-diff'; import pick from 'lodash/pick'; import type { IRun, ITaskData, IWorkflowExecutionDataProcess } from 'n8n-workflow'; -import { ApplicationError, jsonParse } from 'n8n-workflow'; +import { ApplicationError, jsonParse, ErrorReporterProxy } from 'n8n-workflow'; import os from 'os'; import { sep } from 'path'; import { Container } from 'typedi'; @@ -822,6 +822,11 @@ export class ExecuteBatch extends BaseCommand { } } } catch (e) { + ErrorReporterProxy.error(e, { + extra: { + workflowId: workflowData.id, + }, + }); executionResult.error = `Workflow failed to execute: ${(e as Error).message}`; executionResult.executionStatus = 'error'; }