[llvm] [CI] Use the exit code from the premerge advisor (PR #172393)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 15 16:48:27 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-infrastructure
Author: Aiden Grossman (boomanaiden154)
<details>
<summary>Changes</summary>
This patch makes it so that we use an exit code determined by the
premerge advisor rather than whatever exit code was returned by the
failing command. This is intended for making it so that we can mark the
CI as green if all of the failures are explained as either flaky or
already failing at HEAD. For now we just propagate whatever the last
command returned.
---
Full diff: https://github.com/llvm/llvm-project/pull/172393.diff
2 Files Affected:
- (modified) .ci/premerge_advisor_explain.py (+3)
- (modified) .ci/utils.sh (+6-2)
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/172393
More information about the llvm-commits
mailing list