Commit add7ffd
authored
validate.py: flag default:true condition nodes that fail release (#38)
* validate.py: flag default:true condition nodes that fail release
A condition node that routes only via a node-level 'default: true' (no
cel_expression/expression and no else:) imports cleanly and passes server-side
validate_only, then fails at release with 'exclusive gateway ... has no
condition set and is not marked as default'. Verified live against the tenant:
the release (enable) API does not honor a node-level 'default: true' — proven on
a synthetic default-only fan-out, a mixed if/else, and the real console-exported
default_gateway_decision_* shape, all of which release-failed identically. The
valid default mechanism is an 'else:' branch on the expression-bearing condition
(which becomes the gateway's default flow); converting the shipped shape to
'else:' releases OK.
_validate_conditions previously treated 'default: true' as satisfying the
requirement (is_default), a false-negative. It now requires each condition to
carry a match expression OR an 'else:' branch. This matches the contract already
documented in yaml-schema.md.
Also converts two shipped tutorial examples that used the release-broken
'default: true' shape (intro-receive-email-trigger, intro-lookup-file-actions)
to the 'else:' form; both re-verified to release cleanly on the tenant. A third
example (network-contain-endpoint-on-detection) carries the same broken shape
including a 5-way gateway; its conversion is deferred to a supervised session
because it is a containment workflow that cannot be safely release-verified
unattended (no CI impact — no example sweep runs validate.py).
Tests: replaces the stale test that asserted default:true passes with one that
asserts it is flagged, adds a regression test for the console default_gateway_
decision_* shape, and one for the valid expression+else replacement. pylint
10.00/10, 143 test_validate cases pass, markdownlint clean.
* examples: convert network-contain default:true gateways to else: / else_if form
Completes the example fixes for the default:true release-failure. All three
gateways in network-contain-endpoint-on-detection.yaml used the release-broken
'default: true' shape:
- DeviceQuery gateway (2-way): default -> the device-query condition's 'else:'.
- UpdateVariable gateway (2-way): default -> enable_preventive's 'else:'.
- 5-way product gateway: the four product conditions now chain via 'else_if'
(epp -> quickscanpro -> data-protection -> ngsiem), with the terminal 'else:'
carrying the old default target (AddCommentToDetection2). Product type is
single-valued, so ordered else_if evaluation is equivalent to the original
exclusive gateway. enable_preventive keeps its own 'else:' (var-false path).
The default nodes were removed and dropped from their source 'next:' lists; all
three former default targets stay reachable exactly once. validate.py passes all
tiers including server-side validate_only. The else_if-chain structure was
release-proven on an inert On-demand probe (release checks gateway structure, not
expression content) and the 2-way pattern on the two tutorial examples; a live
release of this containment workflow itself was intentionally not run (its
approval-gated containment can't fire in a brief window, but enabling it could
send an approval email on a qualifying detection).1 parent 6b9c91f commit add7ffd
9 files changed
Lines changed: 268 additions & 73 deletions
File tree
- skills
- authoring
- examples
- notifications
- tutorials
- references
- scripts
- workflows/references
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
Lines changed: 15 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | | - | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| 205 | + | |
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
| |||
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
| 223 | + | |
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
| |||
232 | 236 | | |
233 | 237 | | |
234 | 238 | | |
| 239 | + | |
235 | 240 | | |
236 | 241 | | |
237 | 242 | | |
| |||
241 | 246 | | |
242 | 247 | | |
243 | 248 | | |
244 | | - | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
| |||
287 | 291 | | |
288 | 292 | | |
289 | 293 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 294 | + | |
| 295 | + | |
294 | 296 | | |
295 | 297 | | |
296 | 298 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | 299 | | |
302 | 300 | | |
303 | 301 | | |
| |||
313 | 311 | | |
314 | 312 | | |
315 | 313 | | |
| 314 | + | |
| 315 | + | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | 319 | | |
324 | 320 | | |
325 | 321 | | |
| |||
371 | 367 | | |
372 | 368 | | |
373 | 369 | | |
| 370 | + | |
374 | 371 | | |
375 | 372 | | |
376 | 373 | | |
377 | 374 | | |
378 | 375 | | |
379 | 376 | | |
| 377 | + | |
380 | 378 | | |
381 | 379 | | |
382 | 380 | | |
383 | 381 | | |
384 | 382 | | |
385 | 383 | | |
| 384 | + | |
386 | 385 | | |
387 | 386 | | |
388 | 387 | | |
389 | 388 | | |
390 | 389 | | |
391 | 390 | | |
| 391 | + | |
| 392 | + | |
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | 396 | | |
400 | 397 | | |
401 | 398 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
| 168 | + | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | 173 | | |
177 | 174 | | |
178 | 175 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
| |||
0 commit comments