Files
Martin Vogel 5cdbe9b0b6 fix(deploy): taint Helm changes of and/or, later conditions, sortAlpha, parse errors
Review round 4 of #2677 (user decisions: R4-1..R4-4, R4-6, R4-7, R4-9;
R4-5 measured and left out). Every case ends in an UNKNOWN image, never a
wrong one.

Changes not run exactly (helm_template.c):
- A deep merge into a values map is not exact when a change was made at or
  below its path (a set storing a map there): every values map a set or a
  merge changes keeps its path, and such a merge leaves the images after it
  UNKNOWN.
- and / or at an operand whose truth is not known -- UNKNOWN, or a map a
  change made unknown -- leave the images after them UNKNOWN when an
  operand after it may change maps.
- In an if / with an UNKNOWN condition skips, the else-if / else-with
  conditions after it are looked at too: a change there taints, an
  assignment there makes its variable UNKNOWN.
- sortAlpha sorts a []string in place: it counts as a change (a list is
  never poisoned, so it taints). No other Sprig list function changes its
  argument in place.
- A template, a define body or a scanned template file the grammar does not
  parse may hide a change: its images are UNKNOWN.

Work (helm_template.c):
- A capture's keys leave the key set one by one; the set is no longer
  cleared by walking its whole capacity after each capture.
- Template files are found by a hash of their path, and an include of a
  name that is no define is answered once per render.

Known limit, documented (README): each template file renders on its own,
while Helm renders a chart's files with one shared .Values. Running them in
Helm's order is the planned follow-up; the coarse rule across files cost 83
more correct images on the 20 infra corpora and was left out.

On the 20 infra corpora: Image edges identical to round 4 (0 lost, 0
added), no budget trip.

Tests: R4-1..R4-4 and R4-9 fail on 3401def5 by their assertions (each sub
case too); R4-6 and R4-7 are correctness controls, their cost measured
outside the suite.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-19 23:42:36 +02:00
..
2026-10-11 16:57:48 +02:00