diff --git a/apps/webapp/app/services/runs/deliverRunSubscription.server.ts b/apps/webapp/app/services/runs/deliverRunSubscription.server.ts index 682b37fec..0d25f321c 100644 --- a/apps/webapp/app/services/runs/deliverRunSubscription.server.ts +++ b/apps/webapp/app/services/runs/deliverRunSubscription.server.ts @@ -178,6 +178,7 @@ export class DeliverRunSubscriptionService { startedAt: run.startedAt, updatedAt: run.updatedAt, completedAt: run.completedAt, + isTest: run.isTest, executionDurationInMs: run.executionDuration, executionCount: run.executionCount, job: { diff --git a/apps/webapp/app/services/runs/performRunExecutionV3.server.ts b/apps/webapp/app/services/runs/performRunExecutionV3.server.ts index 377a5414b..a9f836058 100644 --- a/apps/webapp/app/services/runs/performRunExecutionV3.server.ts +++ b/apps/webapp/app/services/runs/performRunExecutionV3.server.ts @@ -327,7 +327,7 @@ export class PerformRunExecutionV3Service { }); } - if (headers.success && headers.data["x-trigger-run-metadata"]) { + if (headers.success && headers.data["x-trigger-run-metadata"] && !run.internal) { logger.debug("Endpoint responded with run metadata", { metadata: headers.data["x-trigger-run-metadata"], }); diff --git a/docs/sdk/run-notification.mdx b/docs/sdk/run-notification.mdx index bcb7a964b..ae5d66fb7 100644 --- a/docs/sdk/run-notification.mdx +++ b/docs/sdk/run-notification.mdx @@ -40,6 +40,9 @@ This document describes the payload of a Run's completion webhook. When the Run started + + Whether the Run was a test Run + The duration of the Run in milliseconds diff --git a/packages/core/src/schemas/runs.ts b/packages/core/src/schemas/runs.ts index 6b33c0e75..e62c1331b 100644 --- a/packages/core/src/schemas/runs.ts +++ b/packages/core/src/schemas/runs.ts @@ -134,6 +134,8 @@ export type RunNotificationRunMetadata = { updatedAt: Date; /** When the run was completed */ completedAt: Date; + /** If the run was a test or not */ + isTest: boolean; executionDurationInMs: number; executionCount: number; @@ -150,6 +152,8 @@ type RunNotificationCommon = { updatedAt: Date; /** When the run was completed */ completedAt: Date; + /** If the run was a test or not */ + isTest: boolean; executionDurationInMs: number; executionCount: number; diff --git a/references/job-catalog/src/supabase.ts b/references/job-catalog/src/supabase.ts index b640a142c..cad18e622 100644 --- a/references/job-catalog/src/supabase.ts +++ b/references/job-catalog/src/supabase.ts @@ -30,6 +30,14 @@ export const client = new TriggerClient({ ioLogLocalEnabled: true, }); +client.on("runSucceeeded", async (notification) => { + console.log("[client] Run succeeded", notification); +}); + +client.on("runFailed", async (notification) => { + console.log("[client] Run failed", notification); +}); + createExpressServer(client); client.defineJob({