https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/166605

>From 06c030dcb4ee57be287beffd96d1b21ef1697dd4 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <[email protected]>
Date: Wed, 5 Nov 2025 18:23:46 +0000
Subject: [PATCH] fix

Created using spr 1.3.7
---
 .ci/premerge_advisor_explain.py | 34 ++++++++++++++++-----------------
 .ci/utils.sh                    | 10 +++++-----
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/.ci/premerge_advisor_explain.py b/.ci/premerge_advisor_explain.py
index 4d840a33c3cf2..1d487af9e9ec7 100644
--- a/.ci/premerge_advisor_explain.py
+++ b/.ci/premerge_advisor_explain.py
@@ -31,22 +31,11 @@ def get_comment_id(platform: str, pr: 
github.PullRequest.PullRequest) -> int | N
 def get_comment(
     github_token: str,
     pr_number: int,
-    junit_objects,
-    ninja_logs,
-    advisor_response,
-    return_code,
+    body: str,
 ) -> dict[str, str]:
     repo = github.Github(github_token).get_repo("llvm/llvm-project")
     pr = repo.get_issue(pr_number).as_pull_request()
-    comment = {
-        "body": generate_test_report_lib.generate_report(
-            generate_test_report_lib.compute_platform_title(),
-            return_code,
-            junit_objects,
-            ninja_logs,
-            failure_explanations_list=advisor_response,
-        )
-    }
+    comment = {"body": body}
     comment_id = get_comment_id(platform.system(), pr)
     if comment_id:
         comment["id"] = comment_id
@@ -59,6 +48,14 @@ def main(
     pr_number: int,
     return_code: int,
 ):
+    if return_code == 0:
+        with open("comment", "w") as comment_file_handle:
+            comment = get_comment(
+                ":white_check_mark: With the latest revision this PR passed "
+                "the premerge checks."
+            )
+            if comment["id"]:
+                json.dump([comment], comment_file_handle)
     junit_objects, ninja_logs = generate_test_report_lib.load_info_from_files(
         build_log_files
     )
@@ -90,10 +87,13 @@ def main(
             get_comment(
                 github_token,
                 pr_number,
-                junit_objects,
-                ninja_logs,
-                advisor_response.json(),
-                return_code,
+                generate_test_report_lib.generate_report(
+                    generate_test_report_lib.compute_platform_title(),
+                    return_code,
+                    junit_objects,
+                    ninja_logs,
+                    failure_explanations_list=advisor_response.json(),
+                ),
             )
         ]
         with open("comment", "w") as comment_file_handle:
diff --git a/.ci/utils.sh b/.ci/utils.sh
index 72f4b04f5bf3a..91c27319f3534 100644
--- a/.ci/utils.sh
+++ b/.ci/utils.sh
@@ -33,18 +33,18 @@ function at-exit {
   # If building fails there will be no results files.
   shopt -s nullglob
 
-  if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
+  if [[ "$GITHUB_ACTIONS" != "" ]]; then
     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 \
+      $(git rev-parse HEAD~1) $retcode ${{ secrets.GITHUB_TOKEN }} \
+      $GITHUB_PR_NUMBER "${BUILD_DIR}"/test-results.*.xml \
+      "${MONOREPO_ROOT}"/ninja*.log
   fi
 
   if [[ "$retcode" != "0" ]]; then
     if [[ "$GITHUB_ACTIONS" != "" ]]; then
-      python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \
-        $(git rev-parse HEAD~1) $retcode ${{ secrets.GITHUB_TOKEN }} \
-        $GITHUB_PR_NUMBER "${BUILD_DIR}"/test-results.*.xml \
-        "${MONOREPO_ROOT}"/ninja*.log
       python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
         $(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
         "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log

_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to