Available on crate feature
catalog only.Expand description
Config-change preview (#374): build a redacted snapshot of the resolved + expanded config, and diff the current config against the last recorded one.
faucet run / replicate / schedule record a ConfigSnapshot on every
successful invocation (best-effort — see super::record_config_snapshot).
faucet plan --diff re-expands the current config, loads the last snapshot,
and renders a semantic, per-row diff (rows created / changed / removed,
and within each changed row the exact fields that differ).
Two properties make this trustworthy where a raw YAML text-diff is not:
- Resolved, not textual. The snapshot is built from the expanded nodes
(post
extends/vars/${env:}interpolation and matrix fan-out), so a one-line${vars.x}edit that fans out across many rows shows up as the real per-row effect, and two textually-different files that resolve to the same movement show no diff. - Secret-safe. Every secret-sourced value is replaced with a stable
<secret:sha256:…>token before storage (seeredact_value). No secret material is ever persisted, and a rotated secret surfaces as a changed hash (“secret rotated”) rather than printing either value.
Structs§
- Diff
Summary - Roll-up counts,
terraform plan-style. - Field
Change - One field-level change within a changed row.
- RowDiff
- One row’s entry in the diff.
- Snapshot
Diff - The full config diff, serialized verbatim by
--json.
Enums§
- RowStatus
- Per-row status in a config diff,
terraform plan-style.
Functions§
- build_
snapshot - Build a redacted snapshot from the resolved + expanded nodes.
pipelineandon_errorare passed in (viaresolve_name/on_error_str) so every call site keys snapshots identically;clockis the record time (passed in so callers stay deterministic in tests). - diff
- Diff
currentagainst the last recorded snapshot (previous). With no previous snapshot every row isNew(first-run, liketerraform planon fresh state). - on_
error_ str - The
execution.on_errorpolicy as a stable string ("stop"/"continue"). - record_
if_ ok - Build + record the config snapshot for a run that finished cleanly, when a
catalog is configured. Best-effort — never fails the run (mirrors
super::record). This is the single placerun/replicate/schedulefunnel through, so the record logic is exercised by one test rather than three untested call sites. - redact_
value - Recursively replace every secret-sourced string in
valuewith a stable<secret:sha256:…>token. Non-secret strings pass through verbatim, so real config changes (paths, table names, page sizes) stay visible in the diff. - render_
human - Render the diff as human-readable text (the default
plan --diffoutput). - resolve_
name - The canonical pipeline name used to key snapshots — identical logic to the
run/replicate/scheduleobservability label, so the record side and theplan --diffside always agree on the key: the explicitname:, else the config file stem, else"pipeline".