Skip to content

Commit fdf48f6

Browse files
authored
Merge branch 'main' into docs/env-var-secrets-and-vercel-sync
2 parents 09ca544 + 881288c commit fdf48f6

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
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+
Add server-side deprecation gate for deploys from v3 CLI versions (gated by `DEPRECATE_V3_CLI_DEPLOYS_ENABLED`). v4 CLI deploys are unaffected.

apps/webapp/app/env.server.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,12 @@ const EnvironmentSchema = z
348348
.int()
349349
.default(60 * 1000 * 15), // 15 minutes
350350

351+
// When enabled, reject deploys made by v3 CLI versions (i.e. payloads that
352+
// omit the `type` field). v4 CLI versions always send `type` ("MANAGED" or "V1"),
353+
// so they are unaffected. Defaults to off so detection can run in
354+
// log-only mode before enforcement.
355+
DEPRECATE_V3_CLI_DEPLOYS_ENABLED: z.string().default("0"),
356+
351357
OBJECT_STORE_BASE_URL: z.string().optional(),
352358
OBJECT_STORE_BUCKET: z.string().optional(),
353359
OBJECT_STORE_ACCESS_KEY_ID: z.string().optional(),

apps/webapp/app/v3/services/initializeDeployment.server.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,28 @@ export class InitializeDeploymentService extends BaseService {
5959
};
6060
}
6161

62+
// v4 CLI versions always send `payload.type` ("MANAGED" or "V1"). v3 CLI
63+
// versions never do, so the absence of `type` is a reliable signal that
64+
// the request came from a 3.x CLI. Detection always runs (so we can
65+
// observe how many deploys are still using v3), enforcement is gated
66+
// behind DEPRECATE_V3_CLI_DEPLOYS_ENABLED so it can be rolled out safely.
67+
if (!payload.type) {
68+
const enforced = env.DEPRECATE_V3_CLI_DEPLOYS_ENABLED === "1";
69+
70+
logger.warn("Detected deploy from deprecated v3 CLI", {
71+
environmentId: environment.id,
72+
projectId: environment.projectId,
73+
organizationId: environment.project.organizationId,
74+
enforced,
75+
});
76+
77+
if (enforced) {
78+
throw new ServiceValidationError(
79+
"The trigger.dev CLI v3 is no longer supported for deployments. Please upgrade your project to v4: https://trigger.dev/docs/migrating-from-v3"
80+
);
81+
}
82+
}
83+
6284
if (payload.type === "UNMANAGED") {
6385
throw new ServiceValidationError("UNMANAGED deployments are not supported");
6486
}

0 commit comments

Comments
 (0)