Commit 7d3bf22
committed
fix(recipe): carry the selection through copy, query, and the API schema
Four more review findings, all reproduced before fixing. Each is the same
defect in a different place: the recipe acts on a selection it no longer
records.
RecipeResult.DeepCopy allocated a fresh RecipeConfiguration and cloned only
Slurm, dropping RuntimeInventory rather than aliasing it. Client.AdoptRecipe
always deep-copies, so an adopted recipe kept the install: false override while
losing the configuration explaining it. Every pointer under
RecipeConfiguration now has a clause, and the test asserts a real copy rather
than a shared pointer.
Query hydration projected only Configuration.Slurm, so
`aicr query --selector configuration.runtimeInventory.mode` returned NOT_FOUND
and hydrated output omitted the decision the recipe records. Verified through
the built CLI: the selector now returns the mode.
The OpenAPI ConfiguredRecipeConfiguration schema declared
`additionalProperties: false` with `required: [slurm]`, so a conforming client
could not submit a generated runtime-inventory recipe to POST /v2/bundle -- and
a recipe carrying only that selection failed the required check as well. Added
the shape to both the strict schema and the permissive base, and replaced
`required: [slurm]` with `minProperties: 1`, since either section may now
appear alone.
The PR body said `Fixes: #2271`, which would have closed the epic on merge.
#2310 and #2311 are open and no stock overlay is added here, so it is now
`Part of #2271` with the remaining work named.
Part of #2271
Signed-off-by: Mark Chmarny <mark@chmarny.com>1 parent 02130c4 commit 7d3bf22
4 files changed
Lines changed: 98 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2622 | 2622 | | |
2623 | 2623 | | |
2624 | 2624 | | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
2625 | 2632 | | |
2626 | 2633 | | |
2627 | 2634 | | |
| |||
2812 | 2819 | | |
2813 | 2820 | | |
2814 | 2821 | | |
2815 | | - | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
2816 | 2826 | | |
2817 | 2827 | | |
2818 | 2828 | | |
| |||
2828 | 2838 | | |
2829 | 2839 | | |
2830 | 2840 | | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
2831 | 2849 | | |
2832 | 2850 | | |
2833 | 2851 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1181 | 1181 | | |
1182 | 1182 | | |
1183 | 1183 | | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1184 | 1192 | | |
1185 | 1193 | | |
1186 | 1194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
0 commit comments