Skip to content

Commit 0631c83

Browse files
authored
chore: retire legacy v3 dev websocket + delete legacy self-hosting docs (#4198)
Follow-up to #4194 (v3 execution app + core-helper removal). The v3 (engine V1) is end-of-lifed and enforced off in prod, so this removes a self-contained slice of the remaining dead v3 code while **keeping every user-facing deprecation message** - a user still on v3 must still be told to upgrade. ## Legacy dev websocket `app/v3/handleWebsockets.server.ts` backs the `/ws` transport used **only** by the legacy v3 `trigger dev` CLI (v4 dev uses a different transport). It's now authenticate-then-close with `V3_DEV_DEPRECATION_MESSAGE`, so an old CLI is still told what to do - only the legacy `AuthenticatedSocketConnection` / `DevQueueConsumer` execution behind it (which can no longer run) is removed. - Deleted `app/v3/authenticatedSocketConnection.server.ts` (its only consumer). - `engineDeprecation.server.ts` and the deprecation message constants are untouched. ## Docs Deleted the intentionally-legacy "Docker (legacy)" self-hosting page (`open-source-self-hosting.mdx`) and redirected `/open-source-self-hosting` (+ the existing `/v3/open-source-self-hosting` alias) to `/self-hosting/overview`; repointed the two inbound links. The current `self-hosting/*` docs already describe the v4 (single supervisor) setup. ## Deliberately out of scope Despite the branch name, this PR does **not** touch MarQS or the socket.io coordinator/provider namespaces. Investigation found MarQS is entangled with **live v2** queue/metrics/concurrency/project-cleanup code (`runQueue`, `queueSizeLimits`, `taskRunConcurrencyTracker`, `EnvironmentQueuePresenter`, `registerProjectMetrics`, `deleteProject`), so it needs a per-file reviewed pass, not a bulk delete. That remainder stays on TRI-11883. refs TRI-11883
1 parent a3dca98 commit 0631c83

7 files changed

Lines changed: 24 additions & 774 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: breaking
4+
---
5+
6+
Removed support for the end-of-life v3 `trigger dev` CLI. Starting a dev session with an old v3 CLI now returns an upgrade message instead of connecting - upgrade to the v4 CLI to continue using `trigger dev`.

apps/webapp/app/v3/authenticatedSocketConnection.server.ts

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

apps/webapp/app/v3/handleWebsockets.server.ts

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,15 @@ import { WebSocketServer, type WebSocket } from "ws";
33
import { authenticateApiKey } from "~/services/apiAuth.server";
44
import { logger } from "~/services/logger.server";
55
import { singleton } from "../utils/singleton";
6-
import { AuthenticatedSocketConnection } from "./authenticatedSocketConnection.server";
7-
import { Gauge } from "prom-client";
8-
import { metricsRegister } from "~/metrics.server";
9-
import { isV3Disabled, V3_DEV_DEPRECATION_MESSAGE } from "./engineDeprecation.server";
6+
import { V3_DEV_DEPRECATION_MESSAGE } from "./engineDeprecation.server";
107

118
export const wss = singleton("wss", initalizeWebSocketServer);
129

13-
let authenticatedConnections: Map<string, AuthenticatedSocketConnection>;
14-
1510
function initalizeWebSocketServer() {
1611
const server = new WebSocketServer({ noServer: true });
1712

1813
server.on("connection", handleWebSocketConnection);
1914

20-
authenticatedConnections = new Map();
21-
22-
new Gauge({
23-
name: "dev_authenticated_connections",
24-
help: "Number of authenticated dev connections",
25-
collect() {
26-
this.set(authenticatedConnections.size);
27-
},
28-
registers: [metricsRegister],
29-
});
30-
3115
return server;
3216
}
3317

@@ -59,35 +43,14 @@ async function handleWebSocketConnection(ws: WebSocket, req: IncomingMessage) {
5943

6044
const authenticatedEnv = authenticationResult.environment;
6145

62-
// This legacy websocket is only used by the v3 `trigger dev` CLI (v4 uses a
63-
// different dev transport). When the v3 shutdown is on, close it with a
64-
// graceful reason instead of letting the CLI sit connected with no work.
65-
if (isV3Disabled()) {
66-
logger.warn("Rejected deprecated v3 dev CLI websocket connection", {
67-
environmentId: authenticatedEnv.id,
68-
projectId: authenticatedEnv.projectId,
69-
organizationId: authenticatedEnv.organizationId,
70-
});
71-
ws.close(1008, V3_DEV_DEPRECATION_MESSAGE);
72-
return;
73-
}
74-
75-
const authenticatedConnection = new AuthenticatedSocketConnection(
76-
ws,
77-
authenticatedEnv,
78-
req.headers["x-forwarded-for"] ?? req.socket.remoteAddress ?? "unknown"
79-
);
80-
81-
authenticatedConnections.set(authenticatedConnection.id, authenticatedConnection);
82-
83-
authenticatedConnection.onClose.attachOnce((closeEvent) => {
84-
logger.debug("Websocket closed", {
85-
closeEvent,
86-
authenticatedConnectionId: authenticatedConnection.id,
87-
});
88-
89-
authenticatedConnections.delete(authenticatedConnection.id);
46+
// This websocket is only used by the legacy v3 `trigger dev` CLI (v4 uses a
47+
// different dev transport). The v3 engine is end-of-lifed, so there is no
48+
// longer any work to run here — close with the graceful upgrade message so
49+
// an old CLI is told what to do instead of sitting connected.
50+
logger.warn("Rejected deprecated v3 dev CLI websocket connection", {
51+
environmentId: authenticatedEnv.id,
52+
projectId: authenticatedEnv.projectId,
53+
organizationId: authenticatedEnv.organizationId,
9054
});
91-
92-
await authenticatedConnection.initialize();
55+
ws.close(1008, V3_DEV_DEPRECATION_MESSAGE);
9356
}

docs/docs.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@
286286
{
287287
"group": "Environment variables",
288288
"pages": ["self-hosting/env/webapp", "self-hosting/env/supervisor"]
289-
},
290-
"open-source-self-hosting"
289+
}
291290
]
292291
},
293292
{
@@ -736,9 +735,13 @@
736735
"source": "/v3/upgrading-from-v2",
737736
"destination": "/guides/use-cases/upgrading-from-v2"
738737
},
738+
{
739+
"source": "/open-source-self-hosting",
740+
"destination": "/self-hosting/overview"
741+
},
739742
{
740743
"source": "/v3/open-source-self-hosting",
741-
"destination": "/open-source-self-hosting"
744+
"destination": "/self-hosting/overview"
742745
},
743746
{
744747
"source": "/v3/:slug*",

docs/github-repo.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ url: "https://github.com/triggerdotdev/trigger.dev"
55

66
Trigger.dev is [Open Source on GitHub](https://github.com/triggerdotdev/trigger.dev). You can contribute to the project by submitting issues, pull requests, or simply by using it and providing feedback.
77

8-
You can also [self-host](/open-source-self-hosting) the project if you want to run it on your own infrastructure.
8+
You can also [self-host](/self-hosting/overview) the project if you want to run it on your own infrastructure.

0 commit comments

Comments
 (0)