5ba8557a51
## Summary v3 (the engine that ran the SDK v3 era, internally `RunEngineVersion.V1`) is end-of-life. Following the removal of the v3 execution apps ([#4194](https://github.com/triggerdotdev/trigger.dev/pull/4194)) and the legacy dev websocket ([#4198](https://github.com/triggerdotdev/trigger.dev/pull/4198)), this removes the remaining v3 execution stack from the server. Clients still on v3 (an old SDK or CLI that has not upgraded) keep getting a clear "upgrade to v4" response. Triggers, batch triggers, reschedules, and deploys that resolve to v3 are rejected with a graceful 4xx pointing at the migration guide, never a 5xx, so a stale client cannot affect server health. Self-hosted instances still running v3 should stay on the 4.5.x release line until they migrate. ## What is removed - The MarQS queue and its shared/dev queue consumers. - The v3 socket.io namespaces (coordinator, provider, shared-queue) and the v3 run lifecycle services (attempt, checkpoint, and batch-resume). - The graphile-worker background job system; all live jobs already run on `@trigger.dev/redis-worker`. - The `DEPRECATE_V3_ENABLED` flag: v3 is now rejected unconditionally, so the flag is gone. - Unused v3 exports from `@trigger.dev/core` (the `v3/zodNamespace` subpath and the legacy socket message catalogs) and the now-dead MarQS environment variables. ## What stays The v4 engine is untouched. The graceful v3 rejection boundary stays, `determineEngineVersion` still detects a v3 project so it can reject it, and the batch service plus batch-completion worker stay for current clients. Live queue concurrency limits and metrics now read from the v4 run engine instead of MarQS, and a brand-new dev environment now defaults to v4. ## Dependency cleanup Removes webapp dependencies left unused by this change: `seedrandom` and `semver` (only the removed v3 code used them) plus a set that was already dead, their orphaned `@types` packages, and two dead files. Adds a `knip:deps` script and a `knip.json` config so unused dependencies can be found the same way going forward.
147 lines
4.7 KiB
TypeScript
147 lines
4.7 KiB
TypeScript
import { useIsImpersonating } from "~/hooks/useOrganizations";
|
|
import { useHasAdminAccess } from "~/hooks/useUser";
|
|
import { Button } from "../primitives/Buttons";
|
|
import { Dialog, DialogContent, DialogHeader, DialogTrigger } from "../primitives/Dialog";
|
|
import { Cog6ToothIcon } from "@heroicons/react/20/solid";
|
|
import { type loader } from "~/routes/resources.taskruns.$runParam.debug";
|
|
import type { UseDataFunctionReturn } from "remix-typedjson";
|
|
import { useTypedFetcher } from "remix-typedjson";
|
|
import { useEffect } from "react";
|
|
import { Spinner } from "../primitives/Spinner";
|
|
import * as Property from "~/components/primitives/PropertyTable";
|
|
import { ClipboardField } from "../primitives/ClipboardField";
|
|
|
|
export function AdminDebugRun({ friendlyId }: { friendlyId: string }) {
|
|
const hasAdminAccess = useHasAdminAccess();
|
|
const isImpersonating = useIsImpersonating();
|
|
|
|
if (!hasAdminAccess && !isImpersonating) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<Dialog key={`debug-${friendlyId}`}>
|
|
<DialogTrigger asChild>
|
|
<Button variant="tertiary/small" LeadingIcon={Cog6ToothIcon}>
|
|
Debug run
|
|
</Button>
|
|
</DialogTrigger>
|
|
<DebugRunDialog friendlyId={friendlyId} />
|
|
</Dialog>
|
|
);
|
|
}
|
|
|
|
export function DebugRunDialog({ friendlyId }: { friendlyId: string }) {
|
|
return (
|
|
<DialogContent
|
|
key={`debug`}
|
|
className="overflow-y-auto sm:h-[80vh] sm:max-h-[80vh] sm:max-w-[50vw]"
|
|
>
|
|
<DebugRunContent friendlyId={friendlyId} />
|
|
</DialogContent>
|
|
);
|
|
}
|
|
|
|
function DebugRunContent({ friendlyId }: { friendlyId: string }) {
|
|
const fetcher = useTypedFetcher<typeof loader>();
|
|
const isLoading = fetcher.state === "loading";
|
|
|
|
useEffect(() => {
|
|
fetcher.load(`/resources/taskruns/${friendlyId}/debug`);
|
|
}, [friendlyId]);
|
|
|
|
return (
|
|
<>
|
|
<DialogHeader>Debugging run</DialogHeader>
|
|
{isLoading ? (
|
|
<div className="grid place-items-center p-6">
|
|
<Spinner />
|
|
</div>
|
|
) : fetcher.data ? (
|
|
<DebugRunData {...fetcher.data} />
|
|
) : (
|
|
<>Failed to get run debug data</>
|
|
)}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function DebugRunData(props: UseDataFunctionReturn<typeof loader>) {
|
|
if (props.engine === "V1") {
|
|
return <DebugRunDataEngineV1 run={props.run} />;
|
|
}
|
|
|
|
return <DebugRunDataEngineV2 {...props} />;
|
|
}
|
|
|
|
function DebugRunDataEngineV1({ run }: { run: UseDataFunctionReturn<typeof loader>["run"] }) {
|
|
return (
|
|
<Property.Table>
|
|
<Property.Item>
|
|
<Property.Label>ID</Property.Label>
|
|
<Property.Value className="flex items-center gap-2">
|
|
<ClipboardField value={run.id} variant="tertiary/small" iconButton />
|
|
</Property.Value>
|
|
</Property.Item>
|
|
<Property.Item>
|
|
<Property.Label>Engine</Property.Label>
|
|
<Property.Value>
|
|
Engine V1 (v3) is retired. Queue debug data is no longer available for V1 runs.
|
|
</Property.Value>
|
|
</Property.Item>
|
|
</Property.Table>
|
|
);
|
|
}
|
|
|
|
function DebugRunDataEngineV2({
|
|
run,
|
|
queueConcurrencyLimit,
|
|
queueCurrentConcurrency,
|
|
envConcurrencyLimit,
|
|
envCurrentConcurrency,
|
|
keys,
|
|
}: Extract<UseDataFunctionReturn<typeof loader>, { engine: "V2" }>) {
|
|
return (
|
|
<Property.Table>
|
|
<Property.Item>
|
|
<Property.Label>ID</Property.Label>
|
|
<Property.Value className="flex items-center gap-2">
|
|
<ClipboardField value={run.id} variant="tertiary/small" iconButton />
|
|
</Property.Value>
|
|
</Property.Item>
|
|
<Property.Item>
|
|
<Property.Label>Queue current concurrency</Property.Label>
|
|
<Property.Value className="flex items-center gap-2">
|
|
<span>{queueCurrentConcurrency ?? "0"}</span>
|
|
</Property.Value>
|
|
</Property.Item>
|
|
<Property.Item>
|
|
<Property.Label>Queue concurrency limit</Property.Label>
|
|
<Property.Value className="flex items-center gap-2">
|
|
<span>{queueConcurrencyLimit ?? "Not set"}</span>
|
|
</Property.Value>
|
|
</Property.Item>
|
|
<Property.Item>
|
|
<Property.Label>Env current concurrency</Property.Label>
|
|
<Property.Value className="flex items-center gap-2">
|
|
<span>{envCurrentConcurrency ?? "0"}</span>
|
|
</Property.Value>
|
|
</Property.Item>
|
|
<Property.Item>
|
|
<Property.Label>Env concurrency limit</Property.Label>
|
|
<Property.Value className="flex items-center gap-2">
|
|
<span>{envConcurrencyLimit ?? "Not set"}</span>
|
|
</Property.Value>
|
|
</Property.Item>
|
|
{keys.map((key) => (
|
|
<Property.Item key={key.key}>
|
|
<Property.Label>{key.label}</Property.Label>
|
|
<Property.Value className="flex items-center gap-2">
|
|
<ClipboardField value={key.key} variant="tertiary/small" iconButton />
|
|
</Property.Value>
|
|
</Property.Item>
|
|
))}
|
|
</Property.Table>
|
|
);
|
|
}
|