From a9773e14eebba649bf7135559bd0f5e79e085e16 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 14:40:09 +0000 Subject: [PATCH] fix: normalize AWF image-tag digests in wasm golden script Agent-Logs-Url: https://github.com/github/gh-aw/sessions/82d3b69f-472f-4570-9198-2c8ff9e98ecb Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- scripts/test-wasm-golden.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/test-wasm-golden.mjs b/scripts/test-wasm-golden.mjs index 242f51c7cf5..523e4003f41 100644 --- a/scripts/test-wasm-golden.mjs +++ b/scripts/test-wasm-golden.mjs @@ -149,13 +149,23 @@ function normalizeContainerPins(content) { return content.replace(/@sha256:[0-9a-f]{64}/g, ""); } +// ── Normalize AWF --image-tag digest suffixes ───────────────────────── +// Strips ",name=sha256:<64 hex chars>" fragments appended to --image-tag values +// so output compares equal when runtime image digests are present in one path but not another. +// Mirrors normalizeOutput() in pkg/workflow/wasm_golden_test.go. +function normalizeAWFImageTagDigests(content) { + return content.replace(/,[a-z-]+=sha256:[0-9a-f]{64}/g, ""); +} + // ── Normalize output ────────────────────────────────────────────────── // Applies all normalizations needed for stable golden comparison. // Combines heredoc delimiter and container pin normalizations so that // new normalization steps only need to be added in one place. // Mirrors normalizeOutput() in pkg/workflow/wasm_golden_test.go. function normalize(content) { - return normalizeContainerPins(normalizeHeredocDelimiters(content)); + return normalizeAWFImageTagDigests( + normalizeContainerPins(normalizeHeredocDelimiters(content)) + ); } // ── Load golden file ─────────────────────────────────────────────────