-
Notifications
You must be signed in to change notification settings - Fork 359
Stabilize wasm golden comparison by normalizing AWF --image-tag digest suffixes
#27872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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, ""); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| return content.replace(/,[a-z-]+=sha256:[0-9a-f]{64}/g, ""); | |
| const imageTagDigestSuffix = /,[a-z-]+=sha256:[0-9a-f]{64}/g; | |
| return content | |
| .split("\n") | |
| .map((line) => { | |
| if (line.includes("--image-tag") || line.includes("image-tag:")) { | |
| return line.replace(imageTagDigestSuffix, ""); | |
| } | |
| return line; | |
| }) | |
| .join("\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex key pattern
[,a-z-]+may be too restrictive for AWF--image-tagkeys (e.g., if they can include digits). If a key likefoo2=sha256:...appears, it won’t be normalized and the original flakiness can persist. Consider broadening the key character class (e.g., include0-9) to match all valid tag keys used by AWF.