From 18e68ae8edd046244f6cc56e77120cce50f6f493 Mon Sep 17 00:00:00 2001 From: Agents Agent Date: Mon, 6 Jul 2026 10:45:38 +0000 Subject: [PATCH 1/2] refactor: validate render-drift targets with kubeconform, not byte equality The render-drift action compared each freshly rendered adapter file against its committed counterpart with cmp, so any formatting, key-order, or comment difference registered as drift even when the Kubernetes objects were identical. Committed targets are now validated with kubeconform, reporting drift only on genuine schema violations rather than byte-level noise. --- actions/deploy-config-render-drift/run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/deploy-config-render-drift/run.sh b/actions/deploy-config-render-drift/run.sh index 1939602..f058131 100644 --- a/actions/deploy-config-render-drift/run.sh +++ b/actions/deploy-config-render-drift/run.sh @@ -180,11 +180,11 @@ main() { continue fi - if cmp -s "${rendered_path}" "${committed_path}"; then + if kubeconform --strict "${committed_path}" 2>/dev/null; then printf 'MATCH %s=%s\n' "${adapter}" "${TARGET_PATHS[$target_index]}" else printf 'DIFF %s=%s\n' "${adapter}" "${TARGET_PATHS[$target_index]}" - annotation error "deploy-config-schema render ${adapter} drifted from ${TARGET_PATHS[$target_index]}" + annotation error "Schema validation failed for ${committed_path}" drift_found=1 fi done From cffbef57c75c1163f122f7086dfd5b655dcbff05 Mon Sep 17 00:00:00 2001 From: Agents Agent Date: Mon, 6 Jul 2026 10:58:23 +0000 Subject: [PATCH 2/2] fix: use semantic YAML comparison for render-drift, not schema validation kubeconform validates that the committed target is well-formed Kubernetes YAML; it does not compare the target against the freshly rendered output, so genuine drift went undetected. The action now compares canonicalised YAML (key order, formatting, and comments normalised) so real content drift is reported while cosmetic differences are not. --- actions/deploy-config-render-drift/run.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/actions/deploy-config-render-drift/run.sh b/actions/deploy-config-render-drift/run.sh index f058131..f8eac7b 100644 --- a/actions/deploy-config-render-drift/run.sh +++ b/actions/deploy-config-render-drift/run.sh @@ -180,11 +180,16 @@ main() { continue fi - if kubeconform --strict "${committed_path}" 2>/dev/null; then + # Functional drift check: compare canonicalised YAML so formatting, key + # order, and comments do not register as drift, but real content changes + # do. This replaces exact byte matching without losing drift detection. + if diff -q \ + <(yq -P 'sort_keys(..)' "${rendered_path}") \ + <(yq -P 'sort_keys(..)' "${committed_path}") >/dev/null 2>&1; then printf 'MATCH %s=%s\n' "${adapter}" "${TARGET_PATHS[$target_index]}" else printf 'DIFF %s=%s\n' "${adapter}" "${TARGET_PATHS[$target_index]}" - annotation error "Schema validation failed for ${committed_path}" + annotation error "deploy-config-schema render ${adapter} drifted from ${TARGET_PATHS[$target_index]} (semantic YAML comparison)" drift_found=1 fi done