[llvm] [CI] Make premerge advisor exit with code 0 if failures are explained (PR #172394)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 16 15:50:21 PST 2025
https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/172394
>From 5b1085e98c6a2a26fa4eb1c9f69562c6b3f6c61f Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 16 Dec 2025 00:47:47 +0000
Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?=
=?UTF-8?q?anges=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.7
[skip ci]
---
.ci/premerge_advisor_explain.py | 3 +++
.ci/utils.sh | 8 ++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/.ci/premerge_advisor_explain.py b/.ci/premerge_advisor_explain.py
index 6296599aa4f49..00df1b94c4578 100644
--- a/.ci/premerge_advisor_explain.py
+++ b/.ci/premerge_advisor_explain.py
@@ -7,6 +7,7 @@
import platform
import sys
import json
+import os
# TODO(boomanaiden154): Remove the optional call once we can require Python
# 3.10.
@@ -158,3 +159,5 @@ def main(
args.pr_number,
args.return_code,
)
+
+ sys.exit(args.return_code)
diff --git a/.ci/utils.sh b/.ci/utils.sh
index 713a07ba5d898..098b1e696a87b 100644
--- a/.ci/utils.sh
+++ b/.ci/utils.sh
@@ -37,10 +37,10 @@ function at-exit {
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
$retcode "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log \
>> $GITHUB_STEP_SUMMARY
- python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \
+ (python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \
$(git rev-parse HEAD~1) $retcode "${GITHUB_TOKEN}" \
$GITHUB_PR_NUMBER "${BUILD_DIR}"/test-results.*.xml \
- "${MONOREPO_ROOT}"/ninja*.log
+ "${MONOREPO_ROOT}"/ninja*.log)
fi
if [[ "$retcode" != "0" ]]; then
@@ -54,6 +54,10 @@ function at-exit {
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
fi
fi
+
+ if [[ -n "$GITHUB_ACTIONS" ]]; then
+ exit $advisor_retcode
+ fi
}
trap at-exit EXIT
>From 367aa321403b12c428a857bf264cf1021de3417e Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 16 Dec 2025 01:06:28 +0000
Subject: [PATCH 2/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?=
=?UTF-8?q?anges=20introduced=20through=20rebase?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.7
[skip ci]
---
.ci/premerge_advisor_explain.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/.ci/premerge_advisor_explain.py b/.ci/premerge_advisor_explain.py
index 00df1b94c4578..a88bfd223d9aa 100644
--- a/.ci/premerge_advisor_explain.py
+++ b/.ci/premerge_advisor_explain.py
@@ -7,7 +7,6 @@
import platform
import sys
import json
-import os
# TODO(boomanaiden154): Remove the optional call once we can require Python
# 3.10.
>From a46dbc69f1e8fbadfc9c3c5a45ebb5abc512a50a Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 16 Dec 2025 23:05:00 +0000
Subject: [PATCH 3/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?=
=?UTF-8?q?anges=20introduced=20through=20rebase?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.7
[skip ci]
---
.ci/utils.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/.ci/utils.sh b/.ci/utils.sh
index 098b1e696a87b..923c64a4e169c 100644
--- a/.ci/utils.sh
+++ b/.ci/utils.sh
@@ -41,6 +41,7 @@ function at-exit {
$(git rev-parse HEAD~1) $retcode "${GITHUB_TOKEN}" \
$GITHUB_PR_NUMBER "${BUILD_DIR}"/test-results.*.xml \
"${MONOREPO_ROOT}"/ninja*.log)
+ advisor_retcode=$?
fi
if [[ "$retcode" != "0" ]]; then
More information about the llvm-commits
mailing list