Expand description
Wiring layer between crate::values (Phase 1) and the diff /
apply pipeline.
Responsibilities:
- Resolve the per-env values file path from config (
values_fileoverride or defaultvalues/<env>.yaml). - Build the per-resource flat lookup table from the structured
ValuesFileper RFC §2.2 namespace rules. - Aggregate placeholder failures across resources so the caller can abort with a single grouped report (RFC §2.4 / §3 Q7).
Structs§
- Preflight
Args - Bundle of inputs the pre-flight needs from the entry layer. Kept as a struct (rather than 10 positional args) to keep clippy happy and to make future additions (e.g. a new kind that grows placeholders) non-breaking at call sites.
- Resolution
Failure - One resource’s worth of placeholder failures, ready to be folded into a top-level error message.
Functions§
- compute_
values_ input_ hashes - Compute per-resource “consumed values” hashes for plan-lock integrity checking (RFC §4 Phase 6).
- format_
failures - Format aggregated failures into a single human-readable error.
Adds the “values file missing” hint when
values_loaded == falseso the operator immediately knows where to look. - load_
values_ for_ env - Load the per-env values file, tolerating absence.
- preflight_
values - Walk every selected kind’s local files and validate that all
__BRAZESYNC.*__placeholders resolve against the loaded values file. Returns the loadedValuesFile(orNoneif absent and no placeholders are used) on success; on any failure across any kind, aborts with an aggregatedformat_failureserror. - resolve_
content_ block_ in_ place - Resolve every
__BRAZESYNC.*__incb.contentagainstvalues. content_block bodies are single-field, so alllid/cb_id/customnamespaces live at the resource root (RFC §2.2). - resolve_
email_ template_ in_ place - Resolve placeholders across every Liquid-bearing field of
et. Each field has its own per-fieldlid/cb_idnamespace;customis resource-scoped (RFC §2.2). Failures are aggregated per field so a single email_template can surface multipleResolutionFailures. - values_
file_ path - Where to look for the per-env values file.
values_fileconfig override wins; otherwise defaultvalues/<env>.yaml.