Skip to content

Commit abe49d8

Browse files
Remove the wrangler deploy's --x-remote-diff-check experimental flag (#11416)
* Remove the `wrangler deploy`'s `--x-remote-diff-check` experimental flag * Update changeset Co-authored-by: Edmund Hung <edmund@cloudflare.com> --------- Co-authored-by: Edmund Hung <edmund@cloudflare.com>
1 parent e4ddbc2 commit abe49d8

File tree

10 files changed

+49
-71
lines changed

10 files changed

+49
-71
lines changed

.changeset/chilly-feet-shout.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": minor
3+
---
4+
5+
Remove the `wrangler deploy`'s `--x-remote-diff-check` experimental flag
6+
7+
The remote diffing feature has been enabled by default for a while and its functionality is stable, as a result the experimental flag (only available for option-out of the feature right now) has been removed.

packages/wrangler/src/__tests__/config/configuration.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,7 +2925,6 @@ describe("normalizeAndValidateConfig()", () => {
29252925
{
29262926
RESOURCES_PROVISION: true,
29272927
MULTIWORKER: false,
2928-
DEPLOY_REMOTE_DIFF_CHECK: false,
29292928
AUTOCREATE_RESOURCES: false,
29302929
},
29312930
() =>
@@ -3077,7 +3076,6 @@ describe("normalizeAndValidateConfig()", () => {
30773076
{
30783077
RESOURCES_PROVISION: true,
30793078
MULTIWORKER: false,
3080-
DEPLOY_REMOTE_DIFF_CHECK: false,
30813079
AUTOCREATE_RESOURCES: false,
30823080
},
30833081
() =>
@@ -3414,7 +3412,6 @@ describe("normalizeAndValidateConfig()", () => {
34143412
{
34153413
RESOURCES_PROVISION: true,
34163414
MULTIWORKER: false,
3417-
DEPLOY_REMOTE_DIFF_CHECK: false,
34183415
AUTOCREATE_RESOURCES: false,
34193416
},
34203417
() =>

packages/wrangler/src/api/dev.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ export async function unstable_dev(
231231
// TODO: can we make this work?
232232
MULTIWORKER: false,
233233
RESOURCES_PROVISION: false,
234-
DEPLOY_REMOTE_DIFF_CHECK: false,
235234
AUTOCREATE_RESOURCES: false,
236235
},
237236
() => startDev(devOptions)

packages/wrangler/src/core/register-yargs-command.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ function createHandler(def: CommandDefinition, commandName: string) {
162162
: {
163163
MULTIWORKER: false,
164164
RESOURCES_PROVISION: args.experimentalProvision ?? false,
165-
DEPLOY_REMOTE_DIFF_CHECK: false,
166165
AUTOCREATE_RESOURCES: args.experimentalAutoCreate,
167166
};
168167

packages/wrangler/src/deploy/deploy.ts

Lines changed: 42 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -402,66 +402,54 @@ export default async function deploy(props: Props): Promise<{
402402
tags = script.tags ?? tags;
403403

404404
if (script.last_deployed_from === "dash") {
405-
let configDiff: ReturnType<typeof getRemoteConfigDiff> | undefined;
406-
if (getFlag("DEPLOY_REMOTE_DIFF_CHECK")) {
407-
const remoteWorkerConfig = await downloadWorkerConfig(
408-
name,
409-
serviceMetaData.default_environment.environment,
410-
entry.file,
411-
accountId
412-
);
405+
const remoteWorkerConfig = await downloadWorkerConfig(
406+
name,
407+
serviceMetaData.default_environment.environment,
408+
entry.file,
409+
accountId
410+
);
413411

414-
configDiff = getRemoteConfigDiff(remoteWorkerConfig, {
415-
...config,
416-
// We also want to include all the routes used for deployment
417-
routes: allDeploymentRoutes,
418-
});
419-
}
412+
const configDiff = getRemoteConfigDiff(remoteWorkerConfig, {
413+
...config,
414+
// We also want to include all the routes used for deployment
415+
routes: allDeploymentRoutes,
416+
});
420417

421-
if (configDiff) {
422-
// If there are only additive changes (or no changes at all) there should be no problem,
423-
// just using the local config (and override the remote one) should be totally fine
424-
if (!configDiff.nonDestructive) {
425-
logger.warn(
426-
"The local configuration being used (generated from your local configuration file) differs from the remote configuration of your Worker set via the Cloudflare Dashboard:" +
427-
`\n${configDiff.diff}\n\n` +
428-
"Deploying the Worker will override the remote configuration with your local one."
429-
);
430-
if (!(await deployConfirm("Would you like to continue?"))) {
418+
// If there are only additive changes (or no changes at all) there should be no problem,
419+
// just using the local config (and override the remote one) should be totally fine
420+
if (!configDiff.nonDestructive) {
421+
logger.warn(
422+
"The local configuration being used (generated from your local configuration file) differs from the remote configuration of your Worker set via the Cloudflare Dashboard:" +
423+
`\n${configDiff.diff}\n\n` +
424+
"Deploying the Worker will override the remote configuration with your local one."
425+
);
426+
if (!(await deployConfirm("Would you like to continue?"))) {
427+
if (
428+
config.userConfigPath &&
429+
/\.jsonc?$/.test(config.userConfigPath)
430+
) {
431431
if (
432-
config.userConfigPath &&
433-
/\.jsonc?$/.test(config.userConfigPath)
432+
await confirm(
433+
"Would you like to update the local config file with the remote values?",
434+
{
435+
defaultValue: true,
436+
fallbackValue: true,
437+
}
438+
)
434439
) {
435-
if (
436-
await confirm(
437-
"Would you like to update the local config file with the remote values?",
438-
{
439-
defaultValue: true,
440-
fallbackValue: true,
441-
}
442-
)
443-
) {
444-
const patchObj: RawConfig = getConfigPatch(
445-
configDiff.diff,
446-
props.env
447-
);
448-
449-
experimental_patchConfig(
450-
config.userConfigPath,
451-
patchObj,
452-
false
453-
);
454-
}
440+
const patchObj: RawConfig = getConfigPatch(
441+
configDiff.diff,
442+
props.env
443+
);
444+
445+
experimental_patchConfig(
446+
config.userConfigPath,
447+
patchObj,
448+
false
449+
);
455450
}
456-
457-
return { versionId, workerTag };
458451
}
459-
}
460-
} else {
461-
logger.warn(
462-
`You are about to publish a Workers Service that was last published via the Cloudflare Dashboard.\nEdits that have been made via the dashboard will be overridden by your local code and config.`
463-
);
464-
if (!(await deployConfirm("Would you like to continue?"))) {
452+
465453
return { versionId, workerTag };
466454
}
467455
}

packages/wrangler/src/deploy/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,6 @@ export const deployCommand = createCommand({
229229
"Rollout strategy for Containers changes. If set to immediate, it will override `rollout_percentage_steps` if configured and roll out to 100% of instances in one step. ",
230230
choices: ["immediate", "gradual"] as const,
231231
},
232-
"experimental-deploy-remote-diff-check": {
233-
describe: "Experimental: Enable The Deployment Remote Diff check",
234-
type: "boolean",
235-
hidden: true,
236-
default: true,
237-
alias: ["x-remote-diff-check"],
238-
},
239232
strict: {
240233
describe:
241234
"Enables strict mode for the deploy command, this prevents deployments to occur when there are even small potential risks.",
@@ -255,7 +248,6 @@ export const deployCommand = createCommand({
255248
overrideExperimentalFlags: (args) => ({
256249
MULTIWORKER: false,
257250
RESOURCES_PROVISION: args.experimentalProvision ?? false,
258-
DEPLOY_REMOTE_DIFF_CHECK: args.experimentalDeployRemoteDiffCheck ?? false,
259251
AUTOCREATE_RESOURCES: args.experimentalAutoCreate,
260252
}),
261253
warnIfMultipleEnvsConfiguredButNoneSpecified: true,

packages/wrangler/src/dev.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export const dev = createCommand({
3939
overrideExperimentalFlags: (args) => ({
4040
MULTIWORKER: Array.isArray(args.config),
4141
RESOURCES_PROVISION: args.experimentalProvision ?? false,
42-
DEPLOY_REMOTE_DIFF_CHECK: false,
4342
AUTOCREATE_RESOURCES: args.experimentalAutoCreate,
4443
}),
4544
},

packages/wrangler/src/experimental-flags.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { logger } from "./logger";
44
export type ExperimentalFlags = {
55
MULTIWORKER: boolean;
66
RESOURCES_PROVISION: boolean;
7-
DEPLOY_REMOTE_DIFF_CHECK: boolean;
87
AUTOCREATE_RESOURCES: boolean;
98
};
109

packages/wrangler/src/pages/dev.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,6 @@ export const pagesDevCommand = createCommand({
877877
{
878878
MULTIWORKER: Array.isArray(args.config),
879879
RESOURCES_PROVISION: false,
880-
DEPLOY_REMOTE_DIFF_CHECK: false,
881880
AUTOCREATE_RESOURCES: false,
882881
},
883882
() =>

packages/wrangler/src/versions/upload.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ export const versionsUploadCommand = createCommand({
274274
overrideExperimentalFlags: (args) => ({
275275
MULTIWORKER: false,
276276
RESOURCES_PROVISION: args.experimentalProvision ?? false,
277-
DEPLOY_REMOTE_DIFF_CHECK: false,
278277
AUTOCREATE_RESOURCES: args.experimentalAutoCreate,
279278
}),
280279
warnIfMultipleEnvsConfiguredButNoneSpecified: true,

0 commit comments

Comments
 (0)