From 758f333e4e30d77fdc02dc910c1960534f6227e0 Mon Sep 17 00:00:00 2001 From: jslobodzian Date: Wed, 15 Jul 2026 20:16:31 -0400 Subject: [PATCH 1/2] PublishContainers.sh: revert 'oras discover' to -o json (#18033) (cherry picked from commit 0b0045270302bc3a75ba390f6630e8d007f930a8) --- .pipelines/containerSourceData/scripts/PublishContainers.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.pipelines/containerSourceData/scripts/PublishContainers.sh b/.pipelines/containerSourceData/scripts/PublishContainers.sh index c46c9f4acf0..1366f1f3d1f 100755 --- a/.pipelines/containerSourceData/scripts/PublishContainers.sh +++ b/.pipelines/containerSourceData/scripts/PublishContainers.sh @@ -133,8 +133,12 @@ function oras_attach { function oras_detach { local image_name=$1 local lifecycle_manifests + # NOTE: keep `-o json`; on the oras version installed on the publish + # agent, `--format json` does not emit the schema jq expects below and + # causes `parse error: Invalid numeric literal`. The deprecation + # warning from `-o` is harmless. if ! lifecycle_manifests=$(retry_registry_op "discover lifecycle manifests for $image_name" \ - oras discover --format json --artifact-type "application/vnd.microsoft.artifact.lifecycle" "$image_name"); then + oras discover -o json --artifact-type "application/vnd.microsoft.artifact.lifecycle" "$image_name"); then echo "+++ Warning: could not discover lifecycle manifests for $image_name; skipping detach" return fi From 287d52dba353bcefb5ff0fa86e44fc37f6152051 Mon Sep 17 00:00:00 2001 From: jslobodzian Date: Wed, 15 Jul 2026 21:00:41 -0400 Subject: [PATCH 2/2] container-publishing: fix retry helper stdout pollution + use --format json (#18034) (cherry picked from commit 616bc876812488908c203ab7ea0bbd07f0d9e653) --- .../containerSourceData/scripts/PublishContainers.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.pipelines/containerSourceData/scripts/PublishContainers.sh b/.pipelines/containerSourceData/scripts/PublishContainers.sh index 1366f1f3d1f..37299d80954 100755 --- a/.pipelines/containerSourceData/scripts/PublishContainers.sh +++ b/.pipelines/containerSourceData/scripts/PublishContainers.sh @@ -101,17 +101,17 @@ function retry_registry_op { local backoff=5 while [ $retry_count -lt $max_retries ]; do - echo "+++ $desc (attempt $((retry_count + 1))/$max_retries)" + echo "+++ $desc (attempt $((retry_count + 1))/$max_retries)" >&2 if "$@"; then return 0 fi retry_count=$((retry_count + 1)) if [ $retry_count -lt $max_retries ]; then - echo "+++ $desc failed; retrying in ${backoff}s..." + echo "+++ $desc failed; retrying in ${backoff}s..." >&2 sleep $backoff backoff=$((backoff * 2)) else - echo "+++ $desc failed after $max_retries attempts" + echo "+++ $desc failed after $max_retries attempts" >&2 return 1 fi done @@ -133,12 +133,8 @@ function oras_attach { function oras_detach { local image_name=$1 local lifecycle_manifests - # NOTE: keep `-o json`; on the oras version installed on the publish - # agent, `--format json` does not emit the schema jq expects below and - # causes `parse error: Invalid numeric literal`. The deprecation - # warning from `-o` is harmless. if ! lifecycle_manifests=$(retry_registry_op "discover lifecycle manifests for $image_name" \ - oras discover -o json --artifact-type "application/vnd.microsoft.artifact.lifecycle" "$image_name"); then + oras discover --format json --artifact-type "application/vnd.microsoft.artifact.lifecycle" "$image_name"); then echo "+++ Warning: could not discover lifecycle manifests for $image_name; skipping detach" return fi