From affafd906da933fb9cab5daa26f0a4dc76a7eb94 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Thu, 28 Nov 2024 18:05:29 +0000 Subject: [PATCH] improve report on failures summarizing the modules with incompatible changes --- hack/apidiff.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hack/apidiff.sh b/hack/apidiff.sh index 6b67227caea..aa95b22c461 100755 --- a/hack/apidiff.sh +++ b/hack/apidiff.sh @@ -206,7 +206,7 @@ inWorktree "${KUBE_TEMP}/base" "${base}" run "${KUBE_TEMP}/before" # be non-zero if there are incompatible changes. # # The report is Markdown-formatted and can be copied into a PR comment verbatim. -res=0 +failures=() echo compare () { what="$1" @@ -226,7 +226,7 @@ compare () { fi incompatible=$(apidiff -incompatible -m "${before}" "${after}" 2>&1) || true if [ -n "$incompatible" ]; then - res=1 + failures+=("${what}") fi } @@ -263,7 +263,11 @@ tryBuild () { ) } -if [ $res -ne 0 ]; then +res=0 +if [ ${#failures[@]} -gt 0 ]; then + res=1 + echo "Detected incompatible changes on modules:" + printf '%s\n' "${failures[@]}" cat <