Skip to content

Commit d576243

Browse files
authored
Include old & new values for changes in the plan (#4072)
## Why Useful for debugging. Could also be useful for resource implementation given that we pass PlanEntry to DoUpdate() now. Note, "new" value is redundant because it comes from remote_state or new_state that is already included in the plan. But it could be still difficult for 3rd party tools to parse this out as it requires to support semantics of structpath (which includes things like `tasks[task_key='mytask']`). On the other hand, "old" value is not redundant as we don't include prior state in the plan at the moment.
1 parent a832cc5 commit d576243

File tree

41 files changed

+239
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+239
-77
lines changed

acceptance/bundle/artifacts/whl_dynamic/out.plan_update.direct.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,19 @@
148148
"changes": {
149149
"local": {
150150
"environments[0].spec.dependencies[0]": {
151-
"action": "update"
151+
"action": "update",
152+
"old": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][2]-py3-none-any.whl",
153+
"new": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl"
152154
},
153155
"tasks[task_key='TestTask'].for_each_task.task.libraries[0].whl": {
154-
"action": "update"
156+
"action": "update",
157+
"old": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][2]-py3-none-any.whl",
158+
"new": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl"
155159
},
156160
"tasks[task_key='TestTask'].libraries[0].whl": {
157-
"action": "update"
161+
"action": "update",
162+
"old": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][2]-py3-none-any.whl",
163+
"new": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl"
158164
}
159165
},
160166
"remote": {

acceptance/bundle/migrate/basic/out.plan_update.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@
5959
"changes": {
6060
"local": {
6161
"name": {
62-
"action": "update"
62+
"action": "update",
63+
"old": "Test Migration Job",
64+
"new": "Test Migrated Job"
6365
}
6466
},
6567
"remote": {
@@ -173,10 +175,14 @@
173175
"changes": {
174176
"local": {
175177
"name": {
176-
"action": "update"
178+
"action": "update",
179+
"old": "Test Migration Pipeline",
180+
"new": "Test Migrated Pipeline"
177181
},
178182
"tags['myjob_name']": {
179-
"action": "update"
183+
"action": "update",
184+
"old": "Test Migration Job",
185+
"new": "Test Migrated Job"
180186
}
181187
},
182188
"remote": {

acceptance/bundle/migrate/dashboards/out.plan_after_migrate.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
"changes": {
1919
"local": {
2020
"etag": {
21-
"action": "skip"
21+
"action": "skip",
22+
"old": "[NUMID]"
2223
}
2324
},
2425
"remote": {
2526
"serialized_dashboard": {
26-
"action": "skip"
27+
"action": "skip",
28+
"old": "{\"pages\":[{\"name\":\"02724bf2\",\"displayName\":\"Dashboard test bundle-deploy-dashboard\"}]}\n",
29+
"new": "{\"pages\":[{\"displayName\":\"Dashboard test bundle-deploy-dashboard\",\"name\":\"02724bf2\",\"pageType\":\"PAGE_TYPE_CANVAS\"}]}\n"
2730
}
2831
}
2932
}

acceptance/bundle/migrate/runas/out.plan.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
"changes": {
3434
"remote": {
3535
"run_as": {
36-
"action": "skip"
36+
"action": "skip",
37+
"old": {
38+
"service_principal_name": "[UUID]"
39+
}
3740
}
3841
}
3942
}

acceptance/bundle/resource_deps/id_chain/out.plan_update.direct.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
"changes": {
4545
"local": {
4646
"description": {
47-
"action": "update"
47+
"action": "update",
48+
"old": "aa_desc",
49+
"new": "aa_new_desc"
4850
}
4951
},
5052
"remote": {
@@ -113,7 +115,9 @@
113115
"changes": {
114116
"local": {
115117
"description": {
116-
"action": "update"
118+
"action": "update",
119+
"old": "prefix [NUMID]",
120+
"new": "new_prefix [NUMID]"
117121
}
118122
},
119123
"remote": {
@@ -182,7 +186,9 @@
182186
"changes": {
183187
"local": {
184188
"description": {
185-
"action": "update"
189+
"action": "update",
190+
"old": "prefix [NUMID]",
191+
"new": "new_prefix [NUMID]"
186192
}
187193
},
188194
"remote": {
@@ -251,7 +257,9 @@
251257
"changes": {
252258
"local": {
253259
"description": {
254-
"action": "update"
260+
"action": "update",
261+
"old": "prefix [NUMID]",
262+
"new": "new_prefix [NUMID]"
255263
}
256264
},
257265
"remote": {
@@ -320,7 +328,9 @@
320328
"changes": {
321329
"local": {
322330
"description": {
323-
"action": "update"
331+
"action": "update",
332+
"old": "prefix [NUMID]",
333+
"new": "new_prefix [NUMID]"
324334
}
325335
},
326336
"remote": {

acceptance/bundle/resource_deps/jobs_update_remote/out.plan_update.direct.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@
130130
"reason": "server_side_default"
131131
},
132132
"trigger.periodic.unit": {
133-
"action": "update"
133+
"action": "update",
134+
"old": "DAYS",
135+
"new": "HOURS"
134136
},
135137
"webhook_notifications": {
136138
"action": "skip",

acceptance/bundle/resource_deps/pipelines_recreate/out.plan_update.direct.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
"changes": {
5454
"local": {
5555
"description": {
56-
"action": "update"
56+
"action": "update",
57+
"old": "depends on foo id [FOO_ID]",
58+
"new": "depends on foo id ${resources.pipelines.foo.id}"
5759
}
5860
},
5961
"remote": {
@@ -89,7 +91,9 @@
8991
"changes": {
9092
"local": {
9193
"catalog": {
92-
"action": "recreate"
94+
"action": "recreate",
95+
"old": "mycatalog",
96+
"new": "mynewcatalog"
9397
}
9498
}
9599
}

acceptance/bundle/resources/clusters/deploy/update-and-resize-autoscale/out.plan_.direct.json

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,15 @@
4141
"changes": {
4242
"local": {
4343
"autoscale": {
44-
"action": "update"
44+
"action": "update",
45+
"new": {
46+
"max_workers": 4,
47+
"min_workers": 2
48+
}
4549
},
4650
"num_workers": {
47-
"action": "update"
51+
"action": "update",
52+
"old": 2
4853
}
4954
}
5055
}
@@ -81,10 +86,14 @@
8186
"changes": {
8287
"local": {
8388
"autoscale.max_workers": {
84-
"action": "update"
89+
"action": "update",
90+
"old": 4,
91+
"new": 5
8592
},
8693
"autoscale.min_workers": {
87-
"action": "update"
94+
"action": "update",
95+
"old": 2,
96+
"new": 3
8897
}
8998
}
9099
}
@@ -122,10 +131,14 @@
122131
"changes": {
123132
"local": {
124133
"autoscale.max_workers": {
125-
"action": "resize"
134+
"action": "resize",
135+
"old": 5,
136+
"new": 6
126137
},
127138
"autoscale.min_workers": {
128-
"action": "resize"
139+
"action": "resize",
140+
"old": 3,
141+
"new": 4
129142
}
130143
}
131144
}
@@ -160,10 +173,15 @@
160173
"changes": {
161174
"local": {
162175
"autoscale": {
163-
"action": "resize"
176+
"action": "resize",
177+
"old": {
178+
"max_workers": 6,
179+
"min_workers": 4
180+
}
164181
},
165182
"num_workers": {
166-
"action": "resize"
183+
"action": "resize",
184+
"new": 3
167185
}
168186
}
169187
}

acceptance/bundle/resources/clusters/deploy/update-and-resize/out.plan_.direct.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
"changes": {
4848
"local": {
4949
"num_workers": {
50-
"action": "update"
50+
"action": "update",
51+
"old": 2,
52+
"new": 3
5153
}
5254
}
5355
}
@@ -85,7 +87,9 @@
8587
"changes": {
8688
"local": {
8789
"num_workers": {
88-
"action": "resize"
90+
"action": "resize",
91+
"old": 3,
92+
"new": 4
8993
}
9094
}
9195
}
@@ -123,10 +127,14 @@
123127
"changes": {
124128
"local": {
125129
"num_workers": {
126-
"action": "resize"
130+
"action": "resize",
131+
"old": 4,
132+
"new": 5
127133
},
128134
"spark_conf['spark.executor.memory']": {
129-
"action": "update"
135+
"action": "update",
136+
"old": "2g",
137+
"new": "4g"
130138
}
131139
}
132140
}

acceptance/bundle/resources/dashboards/delete-trashed-out-of-band/out.plan.direct.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"changes": {
1515
"local": {
1616
"etag": {
17-
"action": "skip"
17+
"action": "skip",
18+
"old": [ETAG]
1819
}
1920
}
2021
}

0 commit comments

Comments
 (0)