Skip to content

Commit 9b09751

Browse files
dario-piotrowiczpenalosaCarmenPopoviciu
authored
add information about dashboard configuration differences on deploys (#10314)
* remove duplicated --outfile deploy test block * add information about dashboard configuration differences on deploys --------- Co-authored-by: Somhairle MacLeòid <[email protected]> Co-authored-by: Carmen Popoviciu <[email protected]>
1 parent f5e9fca commit 9b09751

File tree

22 files changed

+994
-301
lines changed

22 files changed

+994
-301
lines changed

.changeset/solid-sloths-drop.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"wrangler": minor
3+
---
4+
5+
Show possible local vs. dashboard diff information on deploys
6+
7+
When re-deploying a Worker using `wrangler deploy`, if the configuration has been modified in the Cloudflare dashboard, the local configuration will overwrite the remote one. This can lead to unexpected results for users. To address this, currently `wrangler deploy` warns users about potential configuration overrides (without presenting them) and prompts them to confirm whether they want to proceed.
8+
9+
The changes here improve the above flow in the following way:
10+
11+
- If the local changes only add new configurations (without modifying or removing existing ones), the deployment proceeds automatically without warnings or prompts, as these changes are non-destructive and safe.
12+
- If the local changes modify or remove existing configurations, `wrangler deploy` now displays a git-like diff showing the differences between the dashboard and local configurations. This allows users to review and understand the impact of their changes before confirming the deployment.

fixtures/get-platform-proxy/tests/get-platform-proxy.env.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe("getPlatformProxy - env", () => {
9898
"..",
9999
"custom-toml",
100100
"path",
101-
"test-toml"
101+
"test.toml"
102102
),
103103
});
104104
try {

packages/wrangler/src/__tests__/cloudchamber/apply.test.ts

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ describe("cloudchamber apply", () => {
198198
│ ...
199199
200200
│ instance_type = \\"dev\\"
201-
202201
│ [containers.constraints]
203202
│ - tier = 3
204203
│ + tier = 2
@@ -588,27 +587,21 @@ describe("cloudchamber apply", () => {
588587
│ ...
589588
590589
│ value = \\"value\\"
591-
592590
│ [[containers.configuration.labels]]
593591
│ + name = \\"name-1\\"
594592
│ + value = \\"value-1\\"
595-
│ +
596593
│ + [[containers.configuration.labels]]
597-
│ +
598594
│ name = \\"name-2\\"
599595
│ value = \\"value-2\\"
600596
601597
│ ...
602598
603599
│ type = \\"env\\"
604-
605600
│ [[containers.configuration.secrets]]
606601
│ - name = \\"MY_SECRET_1\\"
607602
│ - secret = \\"SECRET_NAME_1\\"
608603
│ - type = \\"env\\"
609-
│ -
610604
│ - [[containers.configuration.secrets]]
611-
│ -
612605
│ name = \\"MY_SECRET_2\\"
613606
│ secret = \\"SECRET_NAME_2\\"
614607
│ type = \\"env\\"
@@ -1004,11 +997,8 @@ describe("cloudchamber apply", () => {
1004997
1005998
│ image = \\"docker.io/beep:boop\\"
1006999
│ instance_type = \\"dev\\"
1007-
10081000
│ + [containers.configuration.observability.logs]
10091001
│ + enabled = true
1010-
│ +
1011-
│ +
10121002
│ [containers.constraints]
10131003
│ tier = 1
10141004
@@ -1074,11 +1064,8 @@ describe("cloudchamber apply", () => {
10741064
10751065
│ image = \\"docker.io/beep:boop\\"
10761066
│ instance_type = \\"dev\\"
1077-
10781067
│ + [containers.configuration.observability.logs]
10791068
│ + enabled = true
1080-
│ +
1081-
│ +
10821069
│ [containers.constraints]
10831070
│ tier = 1
10841071
@@ -1148,11 +1135,9 @@ describe("cloudchamber apply", () => {
11481135
├ EDIT my-container-app
11491136
11501137
│ instance_type = \\"dev\\"
1151-
11521138
│ [containers.configuration.observability.logs]
11531139
│ - enabled = true
11541140
│ + enabled = false
1155-
11561141
│ [containers.constraints]
11571142
│ tier = 1
11581143
@@ -1222,11 +1207,9 @@ describe("cloudchamber apply", () => {
12221207
├ EDIT my-container-app
12231208
12241209
│ instance_type = \\"dev\\"
1225-
12261210
│ [containers.configuration.observability.logs]
12271211
│ - enabled = true
12281212
│ + enabled = false
1229-
12301213
│ [containers.constraints]
12311214
│ tier = 1
12321215
@@ -1295,11 +1278,9 @@ describe("cloudchamber apply", () => {
12951278
├ EDIT my-container-app
12961279
12971280
│ instance_type = \\"dev\\"
1298-
12991281
│ [containers.configuration.observability.logs]
13001282
│ - enabled = true
13011283
│ + enabled = false
1302-
13031284
│ [containers.constraints]
13041285
│ tier = 1
13051286
@@ -1371,11 +1352,9 @@ describe("cloudchamber apply", () => {
13711352
├ EDIT my-container-app
13721353
13731354
│ instance_type = \\"dev\\"
1374-
13751355
│ [containers.configuration.observability.logs]
13761356
│ - enabled = true
13771357
│ + enabled = false
1378-
13791358
│ [containers.constraints]
13801359
│ tier = 1
13811360
@@ -1726,12 +1705,10 @@ describe("cloudchamber apply", () => {
17261705
│ + instances = 4
17271706
│ name = \\"my-container-app\\"
17281707
│ scheduling_policy = \\"regional\\"
1729-
17301708
│ [containers.configuration]
17311709
│ image = \\"docker.io/beep:boop\\"
17321710
│ - instance_type = \\"dev\\"
17331711
│ + instance_type = \\"standard\\"
1734-
17351712
│ [containers.constraints]
17361713
│ - tier = 3
17371714
│ + tier = 2
@@ -1807,21 +1784,17 @@ describe("cloudchamber apply", () => {
18071784
│ + instances = 4
18081785
│ name = \\"my-container-app\\"
18091786
│ scheduling_policy = \\"regional\\"
1810-
18111787
│ [containers.configuration]
18121788
│ image = \\"docker.io/beep:boop\\"
18131789
│ memory = \\"256MB\\"
18141790
│ - memory_mib = 256
18151791
│ + memory_mib = 1_024
1816-
18171792
│ - vcpu = 0.0625
18181793
│ + vcpu = 1
1819-
18201794
│ [containers.configuration.disk]
18211795
│ size = \\"2GB\\"
18221796
│ - size_mb = 2_000
18231797
│ + size_mb = 6_000
1824-
18251798
│ [containers.constraints]
18261799
│ - tier = 3
18271800
│ + tier = 2
@@ -1892,12 +1865,10 @@ describe("cloudchamber apply", () => {
18921865
│ + instances = 4
18931866
│ name = \\"my-container-app\\"
18941867
│ scheduling_policy = \\"regional\\"
1895-
18961868
│ [containers.configuration]
18971869
│ image = \\"docker.io/beep:boop\\"
18981870
│ - instance_type = \\"basic\\"
18991871
│ + instance_type = \\"dev\\"
1900-
19011872
│ [containers.constraints]
19021873
│ - tier = 3
19031874
│ + tier = 2
@@ -2026,10 +1997,9 @@ describe("cloudchamber apply", () => {
20261997
├ EDIT my-container-app
20271998
20281999
│ [containers.configuration]
2029-
│ image = \\"${registry}/some-account-id/hello:1.0\\"
2000+
│ image = \\"registry.cloudflare.com/some-account-id/hello:1.0\\"
20302001
│ - instance_type = \\"dev\\"
20312002
│ + instance_type = \\"standard\\"
2032-
20332003
│ [containers.constraints]
20342004
│ - tier = 3
20352005
│ + tier = 2

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,6 +2656,7 @@ describe("normalizeAndValidateConfig()", () => {
26562656
RESOURCES_PROVISION: true,
26572657
MULTIWORKER: false,
26582658
REMOTE_BINDINGS: false,
2659+
DEPLOY_REMOTE_DIFF_CHECK: false,
26592660
},
26602661
() =>
26612662
normalizeAndValidateConfig(
@@ -2812,6 +2813,7 @@ describe("normalizeAndValidateConfig()", () => {
28122813
RESOURCES_PROVISION: true,
28132814
MULTIWORKER: false,
28142815
REMOTE_BINDINGS: false,
2816+
DEPLOY_REMOTE_DIFF_CHECK: false,
28152817
},
28162818
() =>
28172819
normalizeAndValidateConfig(
@@ -3150,6 +3152,7 @@ describe("normalizeAndValidateConfig()", () => {
31503152
RESOURCES_PROVISION: true,
31513153
MULTIWORKER: false,
31523154
REMOTE_BINDINGS: false,
3155+
DEPLOY_REMOTE_DIFF_CHECK: false,
31533156
},
31543157
() =>
31553158
normalizeAndValidateConfig(

packages/wrangler/src/__tests__/containers/deploy.test.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,10 @@ describe("wrangler deploy with containers", () => {
587587
│ - rollout_active_grace_period = 500
588588
│ + rollout_active_grace_period = 600
589589
│ scheduling_policy = \\"default\\"
590-
591590
│ [containers.configuration]
592591
│ - image = \\"registry.cloudflare.com/some-account-id/my-container:old\\"
593592
│ + image = \\"registry.cloudflare.com/some-account-id/my-container:Galaxy\\"
594593
│ instance_type = \\"dev\\"
595-
596594
│ [containers.constraints]
597595
598596
@@ -728,12 +726,10 @@ describe("wrangler deploy with containers", () => {
728726
│ + max_instances = 10
729727
│ name = \\"my-container\\"
730728
│ scheduling_policy = \\"default\\"
731-
732729
│ [containers.configuration]
733730
│ - image = \\"registry.cloudflare.com/some-account-id/my-container:old\\"
734731
│ + image = \\"registry.cloudflare.com/some-account-id/my-container:Galaxy\\"
735732
│ instance_type = \\"dev\\"
736-
737733
│ [containers.constraints]
738734
739735
@@ -896,11 +892,8 @@ describe("wrangler deploy with containers", () => {
896892
897893
│ image = \\"docker.io/hello:world\\"
898894
│ instance_type = \\"dev\\"
899-
900895
│ + [containers.configuration.observability.logs]
901896
│ + enabled = true
902-
│ +
903-
│ +
904897
│ [containers.constraints]
905898
│ tier = 1
906899
@@ -942,11 +935,8 @@ describe("wrangler deploy with containers", () => {
942935
943936
│ image = \\"docker.io/hello:world\\"
944937
│ instance_type = \\"dev\\"
945-
946938
│ + [containers.configuration.observability.logs]
947939
│ + enabled = true
948-
│ +
949-
│ +
950940
│ [containers.constraints]
951941
│ tier = 1
952942
@@ -1000,11 +990,9 @@ describe("wrangler deploy with containers", () => {
1000990
├ EDIT my-container
1001991
1002992
│ instance_type = \\"dev\\"
1003-
1004993
│ [containers.configuration.observability.logs]
1005994
│ - enabled = true
1006995
│ + enabled = false
1007-
1008996
│ [containers.constraints]
1009997
│ tier = 1
1010998
@@ -1058,11 +1046,9 @@ describe("wrangler deploy with containers", () => {
10581046
├ EDIT my-container
10591047
10601048
│ instance_type = \\"dev\\"
1061-
10621049
│ [containers.configuration.observability.logs]
10631050
│ - enabled = true
10641051
│ + enabled = false
1065-
10661052
│ [containers.constraints]
10671053
│ tier = 1
10681054
@@ -1112,11 +1098,9 @@ describe("wrangler deploy with containers", () => {
11121098
├ EDIT my-container
11131099
11141100
│ instance_type = \\"dev\\"
1115-
11161101
│ [containers.configuration.observability.logs]
11171102
│ - enabled = true
11181103
│ + enabled = false
1119-
11201104
│ [containers.constraints]
11211105
│ tier = 1
11221106
@@ -1171,11 +1155,9 @@ describe("wrangler deploy with containers", () => {
11711155
├ EDIT my-container
11721156
11731157
│ instance_type = \\"dev\\"
1174-
11751158
│ [containers.configuration.observability.logs]
11761159
│ - enabled = true
11771160
│ + enabled = false
1178-
11791161
│ [containers.constraints]
11801162
│ tier = 1
11811163

0 commit comments

Comments
 (0)