Skip to content

Commit 19aa804

Browse files
committed
Merge remote-tracking branch 'origin/main' into full-width-tables
2 parents 87c7eb9 + 332854b commit 19aa804

File tree

118 files changed

+4043
-631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+4043
-631
lines changed

.changeset/brave-forks-compare.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/brown-laws-rest.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/cuddly-pugs-begin.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/eight-turtles-itch.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.changeset/good-ligers-sit.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

apps/kubernetes-provider/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ provider.listen();
661661

662662
const taskMonitor = new TaskMonitor({
663663
runtimeEnv: RUNTIME_ENV,
664+
namespace: KUBERNETES_NAMESPACE,
664665
onIndexFailure: async (deploymentId, details) => {
665666
logger.log("Indexing failed", { deploymentId, details });
666667

apps/kubernetes-provider/src/taskMonitor.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ export class TaskMonitor {
160160

161161
let reason = rawReason || "Unknown error";
162162
let logs = rawLogs || "";
163-
let overrideCompletion = false;
163+
164+
/** This will only override existing task errors. It will not crash the run. */
165+
let onlyOverrideExistingError = exitCode === EXIT_CODE_CHILD_NONZERO;
166+
164167
let errorCode: TaskRunInternalError["code"] = TaskRunErrorCodes.POD_UNKNOWN_ERROR;
165168

166169
switch (rawReason) {
@@ -185,10 +188,8 @@ export class TaskMonitor {
185188
}
186189
break;
187190
case "OOMKilled":
188-
overrideCompletion = true;
189-
reason = `${
190-
exitCode === EXIT_CODE_CHILD_NONZERO ? "Child process" : "Parent process"
191-
} ran out of memory! Try choosing a machine preset with more memory for this task.`;
191+
reason =
192+
"[TaskMonitor] Your task ran out of memory. Try increasing the machine specs. If this doesn't fix it there might be a memory leak.";
192193
errorCode = TaskRunErrorCodes.TASK_PROCESS_OOM_KILLED;
193194
break;
194195
default:
@@ -199,7 +200,7 @@ export class TaskMonitor {
199200
exitCode,
200201
reason,
201202
logs,
202-
overrideCompletion,
203+
overrideCompletion: onlyOverrideExistingError,
203204
errorCode,
204205
} satisfies FailureDetails;
205206

apps/webapp/app/components/runs/v3/SpanEvents.tsx

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import { EnvelopeIcon } from "@heroicons/react/20/solid";
12
import {
23
exceptionEventEnhancer,
34
isExceptionSpanEvent,
45
type ExceptionEventProperties,
56
type SpanEvent as OtelSpanEvent,
67
} from "@trigger.dev/core/v3";
78
import { CodeBlock } from "~/components/code/CodeBlock";
9+
import { Feedback } from "~/components/Feedback";
10+
import { Button } from "~/components/primitives/Buttons";
811
import { Callout } from "~/components/primitives/Callout";
912
import { DateTimeAccurate } from "~/components/primitives/DateTime";
1013
import { Header2, Header3 } from "~/components/primitives/Headers";
@@ -75,11 +78,26 @@ export function SpanEventError({
7578
titleClassName="text-rose-500"
7679
/>
7780
{enhancedException.message && <Callout variant="error">{enhancedException.message}</Callout>}
78-
{enhancedException.link && (
79-
<Callout variant="docs" to={enhancedException.link.href}>
80-
{enhancedException.link.name}
81-
</Callout>
82-
)}
81+
{enhancedException.link &&
82+
(enhancedException.link.magic === "CONTACT_FORM" ? (
83+
<Feedback
84+
button={
85+
<Button
86+
variant="tertiary/medium"
87+
LeadingIcon={EnvelopeIcon}
88+
leadingIconClassName="text-blue-400"
89+
fullWidth
90+
textAlignLeft
91+
>
92+
{enhancedException.link.name}
93+
</Button>
94+
}
95+
/>
96+
) : (
97+
<Callout variant="docs" to={enhancedException.link.href}>
98+
{enhancedException.link.name}
99+
</Callout>
100+
))}
83101
{enhancedException.stacktrace && (
84102
<CodeBlock
85103
showCopyButton={false}

apps/webapp/app/env.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const EnvironmentSchema = z.object({
3131
REMIX_APP_PORT: z.string().optional(),
3232
LOGIN_ORIGIN: z.string().default("http://localhost:3030"),
3333
APP_ORIGIN: z.string().default("http://localhost:3030"),
34+
API_ORIGIN: z.string().optional(),
3435
ELECTRIC_ORIGIN: z.string().default("http://localhost:3060"),
3536
APP_ENV: z.string().default(process.env.NODE_ENV),
3637
SERVICE_NAME: z.string().default("trigger.dev webapp"),

apps/webapp/app/models/taskRun.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
TaskRunFailedExecutionResult,
44
TaskRunSuccessfulExecutionResult,
55
} from "@trigger.dev/core/v3";
6-
import { TaskRunError } from "@trigger.dev/core/v3";
6+
import { TaskRunError, TaskRunErrorCodes } from "@trigger.dev/core/v3";
77

88
import type {
99
TaskRun,
@@ -62,7 +62,7 @@ export function executionResultForTaskRun(
6262
id: taskRun.friendlyId,
6363
error: {
6464
type: "INTERNAL_ERROR",
65-
code: "TASK_RUN_CANCELLED",
65+
code: TaskRunErrorCodes.TASK_RUN_CANCELLED,
6666
},
6767
} satisfies TaskRunFailedExecutionResult;
6868
}
@@ -94,7 +94,7 @@ export function executionResultForTaskRun(
9494
id: taskRun.friendlyId,
9595
error: {
9696
type: "INTERNAL_ERROR",
97-
code: "CONFIGURED_INCORRECTLY",
97+
code: TaskRunErrorCodes.CONFIGURED_INCORRECTLY,
9898
},
9999
} satisfies TaskRunFailedExecutionResult;
100100
}

0 commit comments

Comments
 (0)