Commit d97cf5a
committed
fix(deployment): gate {Condition: X} named-condition reference on conditionResolver presence
The `{Condition: <name>}` named-condition reference branch in
`resolveValue` fired for every property, not just inside a condition
definition. A resource/output property whose value was exactly a
single-key `{ "Condition": "<string>" }` object was silently coerced to a
boolean via `resolveConditionReference` — and in normal property context
(no `conditionResolver`, name absent from `context.conditions`) that
returns `false`, corrupting the property.
The reference form is only reachable during `evaluateConditions`, the
sole code path that threads a `conditionResolver` hook onto the context.
Gate the branch on `context.conditionResolver` being present so a
resource property literally named `Condition` is never coerced to false;
it now falls through and resolves as an ordinary object, exactly as
before the #840 change. The single-key + `typeof string` guards remain
as defense in depth. Composite-condition behavior is unaffected (it
always runs with `conditionResolver` set).
Adds a unit test pinning that a single-key `{ Condition: "Foo" }`
property resolved in normal context stays a plain object and is not
`false` (review fix).1 parent 49a6f53 commit d97cf5a
2 files changed
Lines changed: 34 additions & 3 deletions
File tree
- src/deployment
- tests/unit/deployment
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
532 | | - | |
533 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
534 | 543 | | |
| 544 | + | |
535 | 545 | | |
536 | 546 | | |
537 | 547 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1943 | 1943 | | |
1944 | 1944 | | |
1945 | 1945 | | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
1946 | 1967 | | |
0 commit comments