From 398f3ecca1a844ca2a2e596e55087ab1170b7365 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Fri, 12 Sep 2025 23:04:30 -0700 Subject: [PATCH 1/2] ci: fix failed ISO not commenting on PR --- hack/jenkins/build_iso.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/hack/jenkins/build_iso.sh b/hack/jenkins/build_iso.sh index 8578794f3c..ad5c2e25b1 100755 --- a/hack/jenkins/build_iso.sh +++ b/hack/jenkins/build_iso.sh @@ -65,16 +65,20 @@ else export ISO_BUCKET fi -make release-iso | tee iso-logs.txt -# Abort with error message if above command failed -ec=$? -if [ $ec -gt 0 ]; then - if [ "$release" = false ]; then - gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed. - See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt - " - fi - exit $ec +if ! make release-iso 2>&1 | tee iso-logs.txt; then + # Exit of `make` (PIPESTATUS[0]); fallback to 1 if unavailable + ec=${PIPESTATUS[0]:-1} + + # Only comment on non-release; default release=false if unset + if [[ ${release:-false} != "true" ]]; then + gh pr comment "${ghprbPullId}" --body "$(cat <<'MSG' +Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed for Commit ${ghprbActualCommit} +See the logs at: +https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt +MSG +)" + fi + exit "$ec" fi git config user.name "minikube-bot" From 3a8d7198556600d218e0100775048c5bc46fa4be Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Wed, 17 Sep 2025 14:02:50 -0700 Subject: [PATCH 2/2] review comment --- hack/jenkins/build_iso.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hack/jenkins/build_iso.sh b/hack/jenkins/build_iso.sh index ad5c2e25b1..acbf29fe51 100755 --- a/hack/jenkins/build_iso.sh +++ b/hack/jenkins/build_iso.sh @@ -71,12 +71,15 @@ if ! make release-iso 2>&1 | tee iso-logs.txt; then # Only comment on non-release; default release=false if unset if [[ ${release:-false} != "true" ]]; then - gh pr comment "${ghprbPullId}" --body "$(cat <<'MSG' -Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed for Commit ${ghprbActualCommit} -See the logs at: -https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt -MSG -)" + body="$(cat <<'EOF' + Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed for Commit ${ghprbActualCommit} + See the logs at: + https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt + EOF + " + + gh pr comment "${ghprbPullId}" --body "$body" + fi exit "$ec" fi