Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .server-changes/deprecate-v3-cli-deploys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: breaking
---

Add server-side deprecation gate for deploys from v3 CLI versions (gated by `DEPRECATE_V3_CLI_DEPLOYS_ENABLED`). v4 CLI deploys are unaffected.
6 changes: 6 additions & 0 deletions apps/webapp/app/env.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ const EnvironmentSchema = z
.int()
.default(60 * 1000 * 15), // 15 minutes

// When enabled, reject deploys made by v3 CLI versions (i.e. payloads that
// omit the `type` field). v4 CLI versions always send `type` ("MANAGED" or "V1"),
// so they are unaffected. Defaults to off so detection can run in
// log-only mode before enforcement.
DEPRECATE_V3_CLI_DEPLOYS_ENABLED: z.string().default("0"),
Comment thread
ericallam marked this conversation as resolved.

OBJECT_STORE_BASE_URL: z.string().optional(),
OBJECT_STORE_BUCKET: z.string().optional(),
OBJECT_STORE_ACCESS_KEY_ID: z.string().optional(),
Expand Down
22 changes: 22 additions & 0 deletions apps/webapp/app/v3/services/initializeDeployment.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,28 @@ export class InitializeDeploymentService extends BaseService {
};
}
Comment thread
ericallam marked this conversation as resolved.

// v4 CLI versions always send `payload.type` ("MANAGED" or "V1"). v3 CLI
// versions never do, so the absence of `type` is a reliable signal that
// the request came from a 3.x CLI. Detection always runs (so we can
// observe how many deploys are still using v3), enforcement is gated
// behind DEPRECATE_V3_CLI_DEPLOYS_ENABLED so it can be rolled out safely.
if (!payload.type) {
const enforced = env.DEPRECATE_V3_CLI_DEPLOYS_ENABLED === "1";

logger.warn("Detected deploy from deprecated v3 CLI", {
environmentId: environment.id,
projectId: environment.projectId,
organizationId: environment.project.organizationId,
enforced,
});

if (enforced) {
throw new ServiceValidationError(
"The trigger.dev CLI v3 is no longer supported for deployments. Please upgrade your project to v4: https://trigger.dev/docs/migrating-from-v3"
);
}
}

if (payload.type === "UNMANAGED") {
throw new ServiceValidationError("UNMANAGED deployments are not supported");
}
Expand Down
Loading