diff --git a/.changeset/nine-countries-beg.md b/.changeset/nine-countries-beg.md new file mode 100644 index 00000000000..a566a7e9f06 --- /dev/null +++ b/.changeset/nine-countries-beg.md @@ -0,0 +1,5 @@ +--- +'vercel': major +--- + +Disables promotion of preview deployments diff --git a/packages/cli/src/commands/promote/request-promote.ts b/packages/cli/src/commands/promote/request-promote.ts index 49503a49b60..54ab8dee737 100644 --- a/packages/cli/src/commands/promote/request-promote.ts +++ b/packages/cli/src/commands/promote/request-promote.ts @@ -32,15 +32,9 @@ export default async function requestPromote({ output: client.output, }); - if (deployment.target !== 'production') { - output.warn( - 'Promoting a preview deployment to production is deprecated and will be removed in the next major release. This behavior will be removed entirely on 2024-05-03.' - ); - } - if (deployment.target !== 'production' && !yes) { const question = - 'This deployment does not target production, therefore promotion will not apply production environment variables. Are you sure you want to continue?'; + 'This deployment is not a production deployment and cannot be directly promoted. A new deployment will be built using your production environment. Are you sure you want to continue?'; const answer = await confirm(client, question, false); if (!answer) { output.error('Canceled'); @@ -49,7 +43,7 @@ export default async function requestPromote({ } // request the promotion - await client.fetch(`/v9/projects/${project.id}/promote/${deployment.id}`, { + await client.fetch(`/v10/projects/${project.id}/promote/${deployment.id}`, { body: {}, // required json: false, method: 'POST', diff --git a/packages/cli/test/unit/commands/promote.test.ts b/packages/cli/test/unit/commands/promote.test.ts index 0957be548a6..c92a5adf0c1 100644 --- a/packages/cli/test/unit/commands/promote.test.ts +++ b/packages/cli/test/unit/commands/promote.test.ts @@ -115,7 +115,9 @@ describe('promote', () => { `Fetching deployment "${previousDeployment.url}" in ${previousDeployment.creator?.username}` ); await expect(client.stderr).toOutput( - '? This deployment does not target production, therefore promotion will not apply\n production environment variables. Are you sure you want to continue?' + '? This deployment is not a production deployment and cannot be directly \n' + + 'promoted. A new deployment will be built using your production environment. Are \n' + + 'you sure you want to continue? (y/N)' ); // say "no" to the prompt @@ -138,7 +140,9 @@ describe('promote', () => { `Fetching deployment "${previousDeployment.url}" in ${previousDeployment.creator?.username}` ); await expect(client.stderr).toOutput( - '? This deployment does not target production, therefore promotion will not apply\n production environment variables. Are you sure you want to continue?' + '? This deployment is not a production deployment and cannot be directly \n' + + 'promoted. A new deployment will be built using your production environment. Are \n' + + 'you sure you want to continue? (y/N)' ); // say "yes" to the prompt