feat: support debug in jq patches
Merged
DM
23d ago+436+436+012345678901234567890123456789-26-26-01234567890123456789
Summary
Support debug and debug(filter) in render and diff patches with readable diagnostics that identify the patch and resource.
What
- BREAKING: Go callers of
spec.ApplyPatchesmust appendspec.ApplyPatchesOptions{}; setDiffSideto label the resource version. - Include the patch type, 1-based rule number and quoted resource in each message; diff messages also identify the live or dry-apply version.
- Print strings as plain text, objects/arrays as indented JSON, and other values inline.
- If JSON indentation fails, emit a warning and compact JSON without aborting the patch.
- Emit diagnostics only with
--log-level debugor--log-level trace. - Preserve the original input and native jq
debug(filter)stream semantics. - Use each execution's logging context, including concurrent reuse of compiled patches.
Why
Both forms previously failed to compile because gojq requires applications to provide debug/0.