Skip to content

Commit cc9615d

Browse files
committed
Revert "Squashed commit of the following:"
This reverts commit b837b5a.
1 parent c976813 commit cc9615d

File tree

756 files changed

+1436
-4620
lines changed

Some content is hidden

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

756 files changed

+1436
-4620
lines changed

.changeset/config.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,27 @@
77
}
88
],
99
"commit": false,
10-
"fixed": [["@trigger.dev/*", "trigger.dev"]],
10+
"fixed": [
11+
[
12+
"@trigger.dev/*",
13+
"trigger.dev"
14+
]
15+
],
1116
"linked": [],
1217
"access": "public",
1318
"baseBranch": "main",
1419
"updateInternalDependencies": "patch",
15-
"ignore": ["webapp", "proxy", "coordinator", "docker-provider", "kubernetes-provider"],
20+
"ignore": [
21+
"webapp",
22+
"emails",
23+
"proxy",
24+
"@trigger.dev/database",
25+
"coordinator",
26+
"docker-provider",
27+
"kubernetes-provider",
28+
"@trigger.dev/otlp-importer"
29+
],
1630
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
1731
"onlyUpdatePeerDependentsWhenOutOfRange": true
1832
}
19-
}
33+
}

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ jobs:
2727
- name: 📥 Download deps
2828
run: pnpm install --frozen-lockfile
2929

30-
- name: 📀 Generate Prisma Client
31-
run: pnpm run generate
32-
3330
- name: 🧪 Run Unit Tests
3431
run: pnpm run test

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "internal-packages/otlp-importer/protos"]
2-
path = internal-packages/otlp-importer/protos
1+
[submodule "packages/otlp-importer/protos"]
2+
path = packages/otlp-importer/protos
33
url = https://github.com/open-telemetry/opentelemetry-proto.git

apps/webapp/app/assets/icons/TimedOutIcon.tsx

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

apps/webapp/app/components/primitives/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ export function SelectPopover({
613613
"z-50 flex flex-col overflow-clip rounded border border-charcoal-700 bg-background-bright shadow-md outline-none animate-in fade-in-40",
614614
"min-w-[max(180px,calc(var(--popover-anchor-width)+0.5rem))]",
615615
"max-w-[min(480px,var(--popover-available-width))]",
616-
"max-h-[min(520px,var(--popover-available-height))]",
616+
"max-h-[min(480px,var(--popover-available-height))]",
617617
"origin-[var(--popover-transform-origin)]",
618618
className
619619
)}

apps/webapp/app/components/primitives/TreeView/TreeView.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,9 @@ export function useTree<TData, TFilterValue>({
235235
getItemKey: (index) => state.visibleNodeIds[index],
236236
getScrollElement: () => parentRef.current,
237237
estimateSize: (index: number) => {
238-
const treeItem = tree[index];
239-
if (!treeItem) return 0;
240238
return estimatedRowHeight({
241-
node: treeItem,
242-
state: state.nodes[treeItem.id],
239+
node: tree[index],
240+
state: state.nodes[tree[index].id],
243241
index,
244242
});
245243
},

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,6 @@ export function RunInspector({
324324
</Property.Value>
325325
</Property.Item>
326326
)}
327-
<Property.Item>
328-
<Property.Label>Max duration</Property.Label>
329-
<Property.Value>
330-
{run.maxDurationInSeconds ? `${run.maxDurationInSeconds}s` : "–"}
331-
</Property.Value>
332-
</Property.Item>
333327
<Property.Item>
334328
<Property.Label>Run invocation cost</Property.Label>
335329
<Property.Value>

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ import {
88
NoSymbolIcon,
99
PauseCircleIcon,
1010
RectangleStackIcon,
11-
StopIcon,
1211
TrashIcon,
1312
XCircleIcon,
1413
} from "@heroicons/react/20/solid";
1514
import { TaskRunStatus } from "@trigger.dev/database";
1615
import assertNever from "assert-never";
1716
import { SnowflakeIcon } from "lucide-react";
18-
import { TimedOutIcon } from "~/assets/icons/TimedOutIcon";
1917
import { Spinner } from "~/components/primitives/Spinner";
2018
import { cn } from "~/utils/cn";
2119

@@ -29,7 +27,6 @@ export const allTaskRunStatuses = [
2927
"COMPLETED_SUCCESSFULLY",
3028
"CANCELED",
3129
"COMPLETED_WITH_ERRORS",
32-
"TIMED_OUT",
3330
"CRASHED",
3431
"PAUSED",
3532
"INTERRUPTED",
@@ -47,7 +44,6 @@ export const filterableTaskRunStatuses = [
4744
"COMPLETED_SUCCESSFULLY",
4845
"CANCELED",
4946
"COMPLETED_WITH_ERRORS",
50-
"TIMED_OUT",
5147
"CRASHED",
5248
"INTERRUPTED",
5349
"SYSTEM_FAILURE",
@@ -69,7 +65,6 @@ const taskRunStatusDescriptions: Record<TaskRunStatus, string> = {
6965
PAUSED: "Task has been paused by the user",
7066
CRASHED: "Task has crashed and won't be retried",
7167
EXPIRED: "Task has surpassed its ttl and won't be executed",
72-
TIMED_OUT: "Task has failed because it exceeded its maxDuration",
7368
};
7469

7570
export const QUEUED_STATUSES = [
@@ -145,8 +140,6 @@ export function TaskRunStatusIcon({
145140
return <FireIcon className={cn(runStatusClassNameColor(status), className)} />;
146141
case "EXPIRED":
147142
return <TrashIcon className={cn(runStatusClassNameColor(status), className)} />;
148-
case "TIMED_OUT":
149-
return <TimedOutIcon className={cn(runStatusClassNameColor(status), className)} />;
150143

151144
default: {
152145
assertNever(status);
@@ -181,8 +174,6 @@ export function runStatusClassNameColor(status: TaskRunStatus): string {
181174
return "text-error";
182175
case "CRASHED":
183176
return "text-error";
184-
case "TIMED_OUT":
185-
return "text-error";
186177
default: {
187178
assertNever(status);
188179
}
@@ -219,8 +210,6 @@ export function runStatusTitle(status: TaskRunStatus): string {
219210
return "Crashed";
220211
case "EXPIRED":
221212
return "Expired";
222-
case "TIMED_OUT":
223-
return "Timed out";
224213
default: {
225214
assertNever(status);
226215
}

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

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ import { BeakerIcon, BookOpenIcon, CheckIcon } from "@heroicons/react/24/solid";
99
import { useLocation } from "@remix-run/react";
1010
import { formatDuration, formatDurationMilliseconds } from "@trigger.dev/core/v3";
1111
import { useCallback, useRef } from "react";
12-
import { Badge } from "~/components/primitives/Badge";
1312
import { Button, LinkButton } from "~/components/primitives/Buttons";
1413
import { Checkbox } from "~/components/primitives/Checkbox";
1514
import { Dialog, DialogTrigger } from "~/components/primitives/Dialog";
1615
import { Header3 } from "~/components/primitives/Headers";
1716
import { useSelectedItems } from "~/components/primitives/SelectedItemsProvider";
18-
import { SimpleTooltip } from "~/components/primitives/Tooltip";
1917
import { useEnvironments } from "~/hooks/useEnvironments";
2018
import { useFeatures } from "~/hooks/useFeatures";
2119
import { useOrganization } from "~/hooks/useOrganizations";
@@ -41,12 +39,9 @@ import {
4139
import { CancelRunDialog } from "./CancelRunDialog";
4240
import { LiveTimer } from "./LiveTimer";
4341
import { ReplayRunDialog } from "./ReplayRunDialog";
42+
import { TaskRunStatusCombo } from "./TaskRunStatus";
4443
import { RunTag } from "./RunTag";
45-
import {
46-
descriptionForTaskRunStatus,
47-
filterableTaskRunStatuses,
48-
TaskRunStatusCombo,
49-
} from "./TaskRunStatus";
44+
import { Badge } from "~/components/primitives/Badge";
5045

5146
type RunsTableProps = {
5247
total: number;
@@ -131,27 +126,7 @@ export function TaskRunsTable({
131126
<TableHeaderCell>Env</TableHeaderCell>
132127
<TableHeaderCell>Task</TableHeaderCell>
133128
<TableHeaderCell>Version</TableHeaderCell>
134-
<TableHeaderCell
135-
tooltip={
136-
<div className="flex flex-col divide-y divide-grid-dimmed">
137-
{filterableTaskRunStatuses.map((status) => (
138-
<div
139-
key={status}
140-
className="grid grid-cols-[8rem_1fr] gap-x-2 py-2 first:pt-1 last:pb-1"
141-
>
142-
<div className="mb-0.5 flex items-center gap-1.5 whitespace-nowrap">
143-
<TaskRunStatusCombo status={status} />
144-
</div>
145-
<Paragraph variant="extra-small" className="!text-wrap text-text-dimmed">
146-
{descriptionForTaskRunStatus(status)}
147-
</Paragraph>
148-
</div>
149-
))}
150-
</div>
151-
}
152-
>
153-
Status
154-
</TableHeaderCell>
129+
<TableHeaderCell>Status</TableHeaderCell>
155130
<TableHeaderCell>Started</TableHeaderCell>
156131
<TableHeaderCell
157132
colSpan={3}
@@ -312,11 +287,7 @@ export function TaskRunsTable({
312287
</TableCell>
313288
<TableCell to={path}>{run.version ?? "–"}</TableCell>
314289
<TableCell to={path}>
315-
<SimpleTooltip
316-
content={descriptionForTaskRunStatus(run.status)}
317-
disableHoverableContent
318-
button={<TaskRunStatusCombo status={run.status} />}
319-
/>
290+
<TaskRunStatusCombo status={run.status} />
320291
</TableCell>
321292
<TableCell to={path}>
322293
{run.startedAt ? <DateTime date={run.startedAt} /> : "–"}

apps/webapp/app/database-types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const TaskRunStatus = {
4242
CRASHED: "CRASHED",
4343
DELAYED: "DELAYED",
4444
EXPIRED: "EXPIRED",
45-
TIMED_OUT: "TIMED_OUT",
4645
} as const satisfies Record<TaskRunStatusType, TaskRunStatusType>;
4746

4847
export const JobRunStatus = {

apps/webapp/app/db.server.ts

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,77 @@
1-
import {
2-
Prisma,
3-
PrismaClient,
4-
PrismaClientOrTransaction,
5-
PrismaReplicaClient,
6-
PrismaTransactionClient,
7-
PrismaTransactionOptions,
8-
} from "@trigger.dev/database";
1+
import { Prisma, PrismaClient } from "@trigger.dev/database";
92
import invariant from "tiny-invariant";
103
import { z } from "zod";
114
import { env } from "./env.server";
125
import { logger } from "./services/logger.server";
136
import { isValidDatabaseUrl } from "./utils/db";
147
import { singleton } from "./utils/singleton";
15-
import { $transaction as transac } from "@trigger.dev/database";
168

17-
export type {
18-
PrismaTransactionClient,
19-
PrismaClientOrTransaction,
20-
PrismaTransactionOptions,
21-
PrismaReplicaClient,
9+
export type PrismaTransactionClient = Omit<
10+
PrismaClient,
11+
"$connect" | "$disconnect" | "$on" | "$transaction" | "$use" | "$extends"
12+
>;
13+
14+
export type PrismaClientOrTransaction = PrismaClient | PrismaTransactionClient;
15+
16+
function isTransactionClient(prisma: PrismaClientOrTransaction): prisma is PrismaTransactionClient {
17+
return !("$transaction" in prisma);
18+
}
19+
20+
function isPrismaKnownError(error: unknown): error is Prisma.PrismaClientKnownRequestError {
21+
return (
22+
typeof error === "object" && error !== null && "code" in error && typeof error.code === "string"
23+
);
24+
}
25+
26+
export type PrismaTransactionOptions = {
27+
/** The maximum amount of time (in ms) Prisma Client will wait to acquire a transaction from the database. The default value is 2000ms. */
28+
maxWait?: number;
29+
30+
/** The maximum amount of time (in ms) the interactive transaction can run before being canceled and rolled back. The default value is 5000ms. */
31+
timeout?: number;
32+
33+
/** Sets the transaction isolation level. By default this is set to the value currently configured in your database. */
34+
isolationLevel?: Prisma.TransactionIsolationLevel;
35+
36+
swallowPrismaErrors?: boolean;
2237
};
2338

2439
export async function $transaction<R>(
2540
prisma: PrismaClientOrTransaction,
2641
fn: (prisma: PrismaTransactionClient) => Promise<R>,
2742
options?: PrismaTransactionOptions
2843
): Promise<R | undefined> {
29-
return transac(
30-
prisma,
31-
fn,
32-
(error) => {
44+
if (isTransactionClient(prisma)) {
45+
return fn(prisma);
46+
}
47+
48+
try {
49+
return await (prisma as PrismaClient).$transaction(fn, options);
50+
} catch (error) {
51+
if (isPrismaKnownError(error)) {
3352
logger.error("prisma.$transaction error", {
3453
code: error.code,
3554
meta: error.meta,
3655
stack: error.stack,
3756
message: error.message,
3857
name: error.name,
3958
});
40-
},
41-
options
42-
);
59+
60+
if (options?.swallowPrismaErrors) {
61+
return;
62+
}
63+
}
64+
65+
throw error;
66+
}
4367
}
4468

4569
export { Prisma };
4670

4771
export const prisma = singleton("prisma", getClient);
4872

73+
export type PrismaReplicaClient = Omit<PrismaClient, "$transaction">;
74+
4975
export const $replica: PrismaReplicaClient = singleton(
5076
"replica",
5177
() => getReplicaClient() ?? prisma

apps/webapp/app/env.server.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ const EnvironmentSchema = z.object({
213213
TASK_PAYLOAD_OFFLOAD_THRESHOLD: z.coerce.number().int().default(524_288), // 512KB
214214
TASK_PAYLOAD_MAXIMUM_SIZE: z.coerce.number().int().default(3_145_728), // 3MB
215215
TASK_RUN_METADATA_MAXIMUM_SIZE: z.coerce.number().int().default(4_096), // 4KB
216-
217-
MAXIMUM_DEV_QUEUE_SIZE: z.coerce.number().int().optional(),
218-
MAXIMUM_DEPLOYED_QUEUE_SIZE: z.coerce.number().int().optional(),
219216
});
220217

221218
export type Environment = z.infer<typeof EnvironmentSchema>;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ export function batchTaskRunItemStatusForRunStatus(
119119
case TaskRunStatus.SYSTEM_FAILURE:
120120
case TaskRunStatus.CRASHED:
121121
case TaskRunStatus.EXPIRED:
122-
case TaskRunStatus.TIMED_OUT:
123122
return BatchTaskRunItemStatus.FAILED;
124123
case TaskRunStatus.PENDING:
125124
case TaskRunStatus.WAITING_FOR_DEPLOY:

0 commit comments

Comments
 (0)