Skip to content

Commit bcc330d

Browse files
committed
Merge remote-tracking branch 'origin/main' into docs/vercel-sync-env-vars
2 parents 4224813 + 6313db6 commit bcc330d

File tree

115 files changed

+4607
-1052
lines changed

Some content is hidden

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

115 files changed

+4607
-1052
lines changed

.changeset/brave-forks-compare.md

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

.changeset/good-ligers-sit.md

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

.github/workflows/unit-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ jobs:
3838
SESSION_SECRET: "secret"
3939
MAGIC_LINK_SECRET: "secret"
4040
ENCRYPTION_KEY: "secret"
41-
41+
42+
- name: 🧪 Run Package Unit Tests
43+
run: pnpm run test --filter "@trigger.dev/*"
4244

4345
- name: 🧪 Run Internal Unit Tests
4446
run: pnpm run test --filter "@internal/*"

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/proxy/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"private": true,
55
"scripts": {
66
"deploy": "wrangler deploy",
7-
"dev": "wrangler dev"
7+
"dev": "wrangler dev",
8+
"dry-run:staging": "wrangler deploy --dry-run --outdir=dist --env staging"
89
},
910
"devDependencies": {
1011
"@cloudflare/workers-types": "^4.20240512.0",

apps/proxy/src/index.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ export interface Env {
1717

1818
export default {
1919
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
20-
if (!env.REWRITE_HOSTNAME) throw new Error("Missing REWRITE_HOSTNAME");
21-
console.log("url", request.url);
22-
2320
if (!queueingIsEnabled(env)) {
2421
console.log("Missing AWS credentials. Passing through to the origin.");
25-
return redirectToOrigin(request, env);
22+
return fetch(request);
2623
}
2724

2825
const url = new URL(request.url);
@@ -42,25 +39,10 @@ export default {
4239
}
4340

4441
//the same request but with the hostname (and port) changed
45-
return redirectToOrigin(request, env);
42+
return fetch(request);
4643
},
4744
};
4845

49-
function redirectToOrigin(request: Request, env: Env) {
50-
const newUrl = new URL(request.url);
51-
newUrl.hostname = env.REWRITE_HOSTNAME;
52-
newUrl.port = env.REWRITE_PORT || newUrl.port;
53-
54-
const requestInit: RequestInit = {
55-
method: request.method,
56-
headers: request.headers,
57-
body: request.body,
58-
};
59-
60-
console.log("rewritten url", newUrl.toString());
61-
return fetch(newUrl.toString(), requestInit);
62-
}
63-
6446
function queueingIsEnabled(env: Env) {
6547
return (
6648
env.AWS_SQS_ACCESS_KEY_ID &&

apps/webapp/app/components/ErrorDisplay.tsx

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import { HomeIcon } from "@heroicons/react/20/solid";
12
import { isRouteErrorResponse, useRouteError } from "@remix-run/react";
2-
import { LinkButton } from "./primitives/Buttons";
3-
import { Header1, Header3 } from "./primitives/Headers";
3+
import { motion } from "framer-motion";
44
import { friendlyErrorDisplay } from "~/utils/httpErrors";
5+
import { LinkButton } from "./primitives/Buttons";
6+
import { Header1 } from "./primitives/Headers";
7+
import { Paragraph } from "./primitives/Paragraph";
58

69
type ErrorDisplayOptions = {
710
button?: {
@@ -39,12 +42,32 @@ type DisplayOptionsProps = {
3942

4043
export function ErrorDisplay({ title, message, button }: DisplayOptionsProps) {
4144
return (
42-
<div className="p-4">
43-
<Header1 className="mb-4 border-b border-charcoal-800 pb-4">{title}</Header1>
44-
{message && <Header3>{message}</Header3>}
45-
<LinkButton to={button ? button.to : "/"} variant="primary/medium" className="mt-8">
46-
{button ? button.title : "Home"}
47-
</LinkButton>
45+
<div className="relative flex min-h-screen flex-col items-center justify-center bg-[#16181C]">
46+
<div className="z-10 mt-[30vh] flex flex-col items-center gap-8">
47+
<Header1>{title}</Header1>
48+
{message && <Paragraph>{message}</Paragraph>}
49+
<LinkButton
50+
to={button ? button.to : "/"}
51+
shortcut={{ modifiers: ["meta"], key: "g" }}
52+
variant="primary/medium"
53+
LeadingIcon={HomeIcon}
54+
>
55+
{button ? button.title : "Go to homepage"}
56+
</LinkButton>
57+
</div>
58+
<div className="pointer-events-none absolute bottom-4 right-4 z-10 h-[70px] w-[200px] bg-[rgb(24,26,30)]" />
59+
<motion.div
60+
className="pointer-events-none absolute inset-0 overflow-hidden"
61+
initial={{ opacity: 0 }}
62+
animate={{ opacity: 1 }}
63+
transition={{ delay: 0.5, duration: 2, ease: "easeOut" }}
64+
>
65+
<iframe
66+
src="https://my.spline.design/untitled-a6f70b5ebc46bdb2dcc0f21d5397e8ac/"
67+
className="pointer-events-none absolute inset-0 h-full w-full object-cover"
68+
style={{ border: "none" }}
69+
/>
70+
</motion.div>
4871
</div>
4972
);
5073
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
} from "~/utils/pathBuilder";
4141
import { TraceSpan } from "~/utils/taskEvent";
4242
import { SpanLink } from "~/v3/eventRepository.server";
43-
import { isFinalRunStatus } from "~/v3/taskStatus";
43+
import { isFailedRunStatus, isFinalRunStatus } from "~/v3/taskStatus";
4444
import { RunTimelineEvent, RunTimelineLine } from "./InspectorTimeline";
4545
import { RunTag } from "./RunTag";
4646
import { TaskRunStatusCombo } from "./TaskRunStatus";
@@ -479,6 +479,7 @@ function RunTimeline({ run }: { run: RawRun }) {
479479
const updatedAt = new Date(run.updatedAt);
480480

481481
const isFinished = isFinalRunStatus(run.status);
482+
const isError = isFailedRunStatus(run.status);
482483

483484
return (
484485
<div className="min-w-fit max-w-80">
@@ -535,7 +536,7 @@ function RunTimeline({ run }: { run: RawRun }) {
535536
<RunTimelineEvent
536537
title="Finished"
537538
subtitle={<DateTimeAccurate date={updatedAt} />}
538-
state="complete"
539+
state={isError ? "error" : "complete"}
539540
/>
540541
</>
541542
) : (

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}

0 commit comments

Comments
 (0)