Skip to content

Commit 1114335

Browse files
authored
direct: plan: add new "empty" rule to replace empty{slice,map,struct} (#4491)
## Changes New "empty" reason in plan triggers when old/new & remote values are all either nil or zero or empty slice/map. ## Why Ignoring differences like nil vs "" and nil vs 0 reduces drift when backend has preferred representation. For example, model_serving_endpoints.description is converted from nil to "" by backend. jobs.timeout_seconds has a default 0. This supports removing server_side_default rule which currently marks this changes as "skip". #4490 ## Tests Existing tests.
1 parent 057f1b6 commit 1114335

File tree

55 files changed

+289
-293
lines changed

Some content is hidden

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

55 files changed

+289
-293
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
"changes": {
157157
"email_notifications": {
158158
"action": "skip",
159-
"reason": "empty_struct",
159+
"reason": "empty",
160160
"remote": {}
161161
},
162162
"environments[0].spec.dependencies[0]": {
@@ -167,7 +167,7 @@
167167
},
168168
"tasks[task_key='ServerlessTestTask'].email_notifications": {
169169
"action": "skip",
170-
"reason": "empty_struct",
170+
"reason": "empty",
171171
"remote": {}
172172
},
173173
"tasks[task_key='ServerlessTestTask'].run_if": {
@@ -177,12 +177,12 @@
177177
},
178178
"tasks[task_key='ServerlessTestTask'].timeout_seconds": {
179179
"action": "skip",
180-
"reason": "server_side_default",
180+
"reason": "empty",
181181
"remote": 0
182182
},
183183
"tasks[task_key='TestTask'].email_notifications": {
184184
"action": "skip",
185-
"reason": "empty_struct",
185+
"reason": "empty",
186186
"remote": {}
187187
},
188188
"tasks[task_key='TestTask'].for_each_task.task.libraries[0].whl": {
@@ -204,17 +204,17 @@
204204
},
205205
"tasks[task_key='TestTask'].timeout_seconds": {
206206
"action": "skip",
207-
"reason": "server_side_default",
207+
"reason": "empty",
208208
"remote": 0
209209
},
210210
"timeout_seconds": {
211211
"action": "skip",
212-
"reason": "server_side_default",
212+
"reason": "empty",
213213
"remote": 0
214214
},
215215
"webhook_notifications": {
216216
"action": "skip",
217-
"reason": "empty_struct",
217+
"reason": "empty",
218218
"remote": {}
219219
}
220220
}

acceptance/bundle/deploy/readplan/basic/out.plan_skip.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929
"changes": {
3030
"email_notifications": {
3131
"action": "skip",
32-
"reason": "empty_struct",
32+
"reason": "empty",
3333
"remote": {}
3434
},
3535
"timeout_seconds": {
3636
"action": "skip",
37-
"reason": "server_side_default",
37+
"reason": "empty",
3838
"remote": 0
3939
},
4040
"webhook_notifications": {
4141
"action": "skip",
42-
"reason": "empty_struct",
42+
"reason": "empty",
4343
"remote": {}
4444
}
4545
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"changes": {
6565
"email_notifications": {
6666
"action": "skip",
67-
"reason": "empty_struct",
67+
"reason": "empty",
6868
"remote": {}
6969
},
7070
"name": {
@@ -75,7 +75,7 @@
7575
},
7676
"tasks[task_key='main'].email_notifications": {
7777
"action": "skip",
78-
"reason": "empty_struct",
78+
"reason": "empty",
7979
"remote": {}
8080
},
8181
"tasks[task_key='main'].notebook_task.source": {
@@ -90,17 +90,17 @@
9090
},
9191
"tasks[task_key='main'].timeout_seconds": {
9292
"action": "skip",
93-
"reason": "server_side_default",
93+
"reason": "empty",
9494
"remote": 0
9595
},
9696
"timeout_seconds": {
9797
"action": "skip",
98-
"reason": "server_side_default",
98+
"reason": "empty",
9999
"remote": 0
100100
},
101101
"webhook_notifications": {
102102
"action": "skip",
103-
"reason": "empty_struct",
103+
"reason": "empty",
104104
"remote": {}
105105
}
106106
}

acceptance/bundle/migrate/default-python/out.plan_after_deploy.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@
226226
"changes": {
227227
"email_notifications": {
228228
"action": "skip",
229-
"reason": "empty_struct",
229+
"reason": "empty",
230230
"remote": {}
231231
},
232232
"tasks[task_key='notebook_task'].email_notifications": {
233233
"action": "skip",
234-
"reason": "empty_struct",
234+
"reason": "empty",
235235
"remote": {}
236236
},
237237
"tasks[task_key='notebook_task'].libraries[0].whl": {
@@ -252,12 +252,12 @@
252252
},
253253
"tasks[task_key='notebook_task'].timeout_seconds": {
254254
"action": "skip",
255-
"reason": "server_side_default",
255+
"reason": "empty",
256256
"remote": 0
257257
},
258258
"tasks[task_key='python_wheel_task'].email_notifications": {
259259
"action": "skip",
260-
"reason": "empty_struct",
260+
"reason": "empty",
261261
"remote": {}
262262
},
263263
"tasks[task_key='python_wheel_task'].libraries[0].whl": {
@@ -273,12 +273,12 @@
273273
},
274274
"tasks[task_key='python_wheel_task'].timeout_seconds": {
275275
"action": "skip",
276-
"reason": "server_side_default",
276+
"reason": "empty",
277277
"remote": 0
278278
},
279279
"tasks[task_key='refresh_pipeline'].email_notifications": {
280280
"action": "skip",
281-
"reason": "empty_struct",
281+
"reason": "empty",
282282
"remote": {}
283283
},
284284
"tasks[task_key='refresh_pipeline'].run_if": {
@@ -288,17 +288,17 @@
288288
},
289289
"tasks[task_key='refresh_pipeline'].timeout_seconds": {
290290
"action": "skip",
291-
"reason": "server_side_default",
291+
"reason": "empty",
292292
"remote": 0
293293
},
294294
"timeout_seconds": {
295295
"action": "skip",
296-
"reason": "server_side_default",
296+
"reason": "empty",
297297
"remote": 0
298298
},
299299
"webhook_notifications": {
300300
"action": "skip",
301-
"reason": "empty_struct",
301+
"reason": "empty",
302302
"remote": {}
303303
}
304304
}

acceptance/bundle/migrate/default-python/out.plan_after_migration.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@
226226
"changes": {
227227
"email_notifications": {
228228
"action": "skip",
229-
"reason": "empty_struct",
229+
"reason": "empty",
230230
"remote": {}
231231
},
232232
"tasks[task_key='notebook_task'].email_notifications": {
233233
"action": "skip",
234-
"reason": "empty_struct",
234+
"reason": "empty",
235235
"remote": {}
236236
},
237237
"tasks[task_key='notebook_task'].libraries[0].whl": {
@@ -252,12 +252,12 @@
252252
},
253253
"tasks[task_key='notebook_task'].timeout_seconds": {
254254
"action": "skip",
255-
"reason": "server_side_default",
255+
"reason": "empty",
256256
"remote": 0
257257
},
258258
"tasks[task_key='python_wheel_task'].email_notifications": {
259259
"action": "skip",
260-
"reason": "empty_struct",
260+
"reason": "empty",
261261
"remote": {}
262262
},
263263
"tasks[task_key='python_wheel_task'].libraries[0].whl": {
@@ -273,12 +273,12 @@
273273
},
274274
"tasks[task_key='python_wheel_task'].timeout_seconds": {
275275
"action": "skip",
276-
"reason": "server_side_default",
276+
"reason": "empty",
277277
"remote": 0
278278
},
279279
"tasks[task_key='refresh_pipeline'].email_notifications": {
280280
"action": "skip",
281-
"reason": "empty_struct",
281+
"reason": "empty",
282282
"remote": {}
283283
},
284284
"tasks[task_key='refresh_pipeline'].run_if": {
@@ -288,17 +288,17 @@
288288
},
289289
"tasks[task_key='refresh_pipeline'].timeout_seconds": {
290290
"action": "skip",
291-
"reason": "server_side_default",
291+
"reason": "empty",
292292
"remote": 0
293293
},
294294
"timeout_seconds": {
295295
"action": "skip",
296-
"reason": "server_side_default",
296+
"reason": "empty",
297297
"remote": 0
298298
},
299299
"webhook_notifications": {
300300
"action": "skip",
301-
"reason": "empty_struct",
301+
"reason": "empty",
302302
"remote": {}
303303
}
304304
}

acceptance/bundle/migrate/default-python/output.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ Building python_artifact...
7676
{
7777
"email_notifications": {
7878
"action": "skip",
79-
"reason": "empty_struct",
79+
"reason": "empty",
8080
"remote": {}
8181
},
8282
"tasks[task_key='notebook_task'].email_notifications": {
8383
"action": "skip",
84-
"reason": "empty_struct",
84+
"reason": "empty",
8585
"remote": {}
8686
},
8787
"tasks[task_key='notebook_task'].libraries[0].whl": {
@@ -102,12 +102,12 @@ Building python_artifact...
102102
},
103103
"tasks[task_key='notebook_task'].timeout_seconds": {
104104
"action": "skip",
105-
"reason": "server_side_default",
105+
"reason": "empty",
106106
"remote": 0
107107
},
108108
"tasks[task_key='python_wheel_task'].email_notifications": {
109109
"action": "skip",
110-
"reason": "empty_struct",
110+
"reason": "empty",
111111
"remote": {}
112112
},
113113
"tasks[task_key='python_wheel_task'].libraries[0].whl": {
@@ -123,12 +123,12 @@ Building python_artifact...
123123
},
124124
"tasks[task_key='python_wheel_task'].timeout_seconds": {
125125
"action": "skip",
126-
"reason": "server_side_default",
126+
"reason": "empty",
127127
"remote": 0
128128
},
129129
"tasks[task_key='refresh_pipeline'].email_notifications": {
130130
"action": "skip",
131-
"reason": "empty_struct",
131+
"reason": "empty",
132132
"remote": {}
133133
},
134134
"tasks[task_key='refresh_pipeline'].run_if": {
@@ -138,17 +138,17 @@ Building python_artifact...
138138
},
139139
"tasks[task_key='refresh_pipeline'].timeout_seconds": {
140140
"action": "skip",
141-
"reason": "server_side_default",
141+
"reason": "empty",
142142
"remote": 0
143143
},
144144
"timeout_seconds": {
145145
"action": "skip",
146-
"reason": "server_side_default",
146+
"reason": "empty",
147147
"remote": 0
148148
},
149149
"webhook_notifications": {
150150
"action": "skip",
151-
"reason": "empty_struct",
151+
"reason": "empty",
152152
"remote": {}
153153
}
154154
}
@@ -195,12 +195,12 @@ Building python_artifact...
195195
{
196196
"email_notifications": {
197197
"action": "skip",
198-
"reason": "empty_struct",
198+
"reason": "empty",
199199
"remote": {}
200200
},
201201
"tasks[task_key='notebook_task'].email_notifications": {
202202
"action": "skip",
203-
"reason": "empty_struct",
203+
"reason": "empty",
204204
"remote": {}
205205
},
206206
"tasks[task_key='notebook_task'].libraries[0].whl": {
@@ -221,12 +221,12 @@ Building python_artifact...
221221
},
222222
"tasks[task_key='notebook_task'].timeout_seconds": {
223223
"action": "skip",
224-
"reason": "server_side_default",
224+
"reason": "empty",
225225
"remote": 0
226226
},
227227
"tasks[task_key='python_wheel_task'].email_notifications": {
228228
"action": "skip",
229-
"reason": "empty_struct",
229+
"reason": "empty",
230230
"remote": {}
231231
},
232232
"tasks[task_key='python_wheel_task'].libraries[0].whl": {
@@ -242,12 +242,12 @@ Building python_artifact...
242242
},
243243
"tasks[task_key='python_wheel_task'].timeout_seconds": {
244244
"action": "skip",
245-
"reason": "server_side_default",
245+
"reason": "empty",
246246
"remote": 0
247247
},
248248
"tasks[task_key='refresh_pipeline'].email_notifications": {
249249
"action": "skip",
250-
"reason": "empty_struct",
250+
"reason": "empty",
251251
"remote": {}
252252
},
253253
"tasks[task_key='refresh_pipeline'].run_if": {
@@ -257,17 +257,17 @@ Building python_artifact...
257257
},
258258
"tasks[task_key='refresh_pipeline'].timeout_seconds": {
259259
"action": "skip",
260-
"reason": "server_side_default",
260+
"reason": "empty",
261261
"remote": 0
262262
},
263263
"timeout_seconds": {
264264
"action": "skip",
265-
"reason": "server_side_default",
265+
"reason": "empty",
266266
"remote": 0
267267
},
268268
"webhook_notifications": {
269269
"action": "skip",
270-
"reason": "empty_struct",
270+
"reason": "empty",
271271
"remote": {}
272272
}
273273
}

0 commit comments

Comments
 (0)