Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: run annotations#3241
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
Uh oh!
There was an error while loading. Please reload this page.
feat: run annotations #3241
Changes from all commits
32d77ce7b9d2bb4150bc585d456e032bfae1fdc5e31020f0aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@trigger.dev/redis-worker": patch | ||
| "@trigger.dev/sdk": patch | ||
| "trigger.dev": patch | ||
| "@trigger.dev/core": patch | ||
| --- | ||
| Adapted the CLI API client to propagate the trigger source via http headers. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -17,6 +17,7 @@ import { | ||
| import { ServiceValidationError } from "~/v3/services/baseService.server"; | ||
| import { BatchProcessingStrategy } from "~/v3/services/batchTriggerV3.server"; | ||
| import { OutOfEntitlementError } from "~/v3/services/triggerTask.server"; | ||
| import { sanitizeTriggerSource } from "~/utils/triggerSource"; | ||
| import { HeadersSchema } from "./api.v1.tasks.$taskId.trigger"; | ||
| import { determineRealtimeStreamsVersion } from "~/services/realtime/v1StreamsGlobal.server"; | ||
| import { extractJwtSigningSecretKey } from "~/services/realtime/jwtAuth.server"; | ||
| @@ -62,6 +63,7 @@ const { action, loader } = createActionApiRoute( | ||
| "batch-processing-strategy": batchProcessingStrategy, | ||
| "x-trigger-request-idempotency-key": requestIdempotencyKey, | ||
| "x-trigger-realtime-streams-version": realtimeStreamsVersion, | ||
| "x-trigger-source": triggerSourceHeader, | ||
| traceparent, | ||
myftija marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| tracestate, | ||
| } = headers; | ||
| @@ -127,6 +129,8 @@ const { action, loader } = createActionApiRoute( | ||
| realtimeStreamsVersion: determineRealtimeStreamsVersion( | ||
| realtimeStreamsVersion ?? undefined | ||
| ), | ||
| triggerSource: isFromWorker ? "sdk" : sanitizeTriggerSource(triggerSourceHeader) ?? "api", | ||
| triggerAction: "trigger", | ||
| }); | ||
| const $responseHeaders = await responseHeaders( | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const ALLOWED_TRIGGER_SOURCES = new Set(["sdk", "cli", "mcp"]); | ||
| /** Validates a client-provided trigger source header against the allowlist. */ | ||
| export function sanitizeTriggerSource(value: string | null | undefined): string | undefined { | ||
| if (value && ALLOWED_TRIGGER_SOURCES.has(value)) { | ||
| return value; | ||
| } | ||
| return undefined; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- AlterTable | ||
| ALTER TABLE "public"."TaskRun" ADD COLUMN "annotations" JSONB; |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.