diff --git a/apps/webapp/app/routes/api.v1.deployments.ts b/apps/webapp/app/routes/api.v1.deployments.ts index 98bd151af..5be291bae 100644 --- a/apps/webapp/app/routes/api.v1.deployments.ts +++ b/apps/webapp/app/routes/api.v1.deployments.ts @@ -60,7 +60,6 @@ export async function action({ request, params }: ActionFunctionArgs) { .externalBuildData as InitializeDeploymentResponseBody["externalBuildData"], eventStream: result.eventStream, canceledDeployments: result.canceledDeployments, - ...(result.buildEnvVarsStored ? { buildEnvVarsStored: true } : {}), } : { isPromoted: result.isPromoted }), }; diff --git a/apps/webapp/app/v3/services/initializeDeployment.server.ts b/apps/webapp/app/v3/services/initializeDeployment.server.ts index 3b8db11e6..4ff618db3 100644 --- a/apps/webapp/app/v3/services/initializeDeployment.server.ts +++ b/apps/webapp/app/v3/services/initializeDeployment.server.ts @@ -45,7 +45,6 @@ export type InitializeDeploymentResult = imageRef: string; eventStream?: DeploymentEventStream; canceledDeployments?: SupersededDeployment[]; - buildEnvVarsStored?: boolean; } | { outcome: "existing"; @@ -105,7 +104,6 @@ export class InitializeDeploymentService extends BaseService { outcome: "created", deployment: existingDeployment, imageRef: existingDeployment.imageReference ?? "", - buildEnvVarsStored: false, }; } @@ -445,7 +443,6 @@ export class InitializeDeploymentService extends BaseService { imageRef: deployment.imageReference ?? "", eventStream, canceledDeployments, - buildEnvVarsStored: encryptedBuildEnvVars !== undefined, }; }); } diff --git a/packages/cli-v3/src/apiClient.ts b/packages/cli-v3/src/apiClient.ts index 6211c1ad0..8b9fd56eb 100644 --- a/packages/cli-v3/src/apiClient.ts +++ b/packages/cli-v3/src/apiClient.ts @@ -690,19 +690,6 @@ export class CliApiClient { ); } - // 204 on success, no body - async cancelDeployment(deploymentId: string, reason?: string) { - if (!this.accessToken) { - throw new Error("cancelDeployment: No access token"); - } - - return fetch(`${this.apiURL}/api/v1/deployments/${deploymentId}/cancel`, { - method: "POST", - headers: this.getHeaders(), - body: JSON.stringify({ reason }), - }); - } - async getDeploymentBuildEnvVars(deploymentId: string) { if (!this.accessToken) { throw new Error("getDeploymentBuildEnvVars: No access token"); diff --git a/packages/cli-v3/src/commands/deploy.ts b/packages/cli-v3/src/commands/deploy.ts index 8067bf7c5..5ee7e99c2 100644 --- a/packages/cli-v3/src/commands/deploy.ts +++ b/packages/cli-v3/src/commands/deploy.ts @@ -105,10 +105,6 @@ type DeployCommandOptions = z.infer; type Deployment = InitializeDeploymentResponseBody; -// Pre-checks of the server-enforced limits, to fail before uploading anything -const BUILD_ENV_VARS_MAX_BYTES = 128 * 1024; -const BUILD_ENV_VARS_MAX_KEYS = 200; - export function configureDeployCommand(program: Command) { return ( commonOptions( @@ -1364,21 +1360,6 @@ async function handleNativeBuildServerDeploy({ ) ); - const buildEnvVarCount = Object.keys(bundleBuildEnvVars).length; - const buildEnvVarBytes = Buffer.byteLength(JSON.stringify(bundleBuildEnvVars), "utf8"); - - if (buildEnvVarCount > BUILD_ENV_VARS_MAX_KEYS) { - throw new Error( - `Your build uses too many build environment variables: ${buildEnvVarCount} (max ${BUILD_ENV_VARS_MAX_KEYS}).` - ); - } - - if (buildEnvVarBytes > BUILD_ENV_VARS_MAX_BYTES) { - throw new Error( - `Your build environment variables are too large: ${buildEnvVarBytes} bytes (max ${BUILD_ENV_VARS_MAX_BYTES}). Reduce the size of the env var values used by your build.` - ); - } - if (options.dryRun) { logger.info(`Dry run complete. View the built bundle at ${destination.path}`); return; @@ -1567,36 +1548,6 @@ async function handleNativeBuildServerDeploy({ return; } - // No ack for sent build env vars means an older server stripped them; fail fast. - // After the outcome=existing return: a reused deployment builds nothing. - if ( - options.localBundle && - bundleBuildEnvVars && - Object.keys(bundleBuildEnvVars).length > 0 && - !deployment.buildEnvVarsStored - ) { - // Best-effort cancel so the deployment does not linger until the queue timeout - const [cancelError] = await tryCatch( - apiClient.cancelDeployment(deployment.id, "Build environment variables were not stored") - ); - if (cancelError) { - logger.debug("Failed to cancel deployment after missing build env vars ack", { - deploymentId: deployment.id, - error: cancelError, - }); - } - - $deploymentSpinner.stop("Failed to initialize deployment"); - log.error( - chalk.bold( - chalkError( - "This server does not support --local-bundle deploys with build environment variables yet. Deploy without --local-bundle instead." - ) - ) - ); - throw new OutroCommandError(`Deployment failed`); - } - const exposedDeploymentLink = isLinksSupported ? cliLink(chalk.bold(rawDeploymentLink), rawDeploymentLink) : chalk.bold(rawDeploymentLink); diff --git a/packages/core/src/v3/schemas/api.ts b/packages/core/src/v3/schemas/api.ts index 5e4b820aa..a90430953 100644 --- a/packages/core/src/v3/schemas/api.ts +++ b/packages/core/src/v3/schemas/api.ts @@ -758,8 +758,6 @@ export const InitializeDeploymentResponseBody = z.object({ }), }) .optional(), - // Ack that buildEnvVars were stored; absence on an older server is a client-side hard error - buildEnvVarsStored: z.boolean().optional(), }); export type InitializeDeploymentResponseBody = z.infer;