[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] automation: fix eclair gitlab jobs for merge requests



commit 449caecbdfa3f423eae46a53822b7e403607cfee
Author:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
AuthorDate: Mon Aug 5 14:24:23 2024 -0700
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Tue Aug 6 12:29:05 2024 -0700

    automation: fix eclair gitlab jobs for merge requests
    
    The "eclair" script calls action_push.sh even for merge request, while
    instead action_pull_request.sh should be called, resulting in a job
    failure with this error:
    
    Unexpected event pull_request
    
    Fix the script to call action_pull_request.sh appropriately.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
    Reviewed-by: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
---
 automation/eclair_analysis/ECLAIR/action_pull_request.sh |  2 +-
 automation/scripts/eclair                                | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh 
b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
old mode 100644
new mode 100755
index 68f7e6282e..812238e07f
--- a/automation/eclair_analysis/ECLAIR/action_pull_request.sh
+++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
@@ -3,7 +3,7 @@
 set -eu
 
 usage() {
-    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
+    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
     exit 2
 }
 
diff --git a/automation/scripts/eclair b/automation/scripts/eclair
index ebcaf09b54..3ec760bab8 100755
--- a/automation/scripts/eclair
+++ b/automation/scripts/eclair
@@ -21,5 +21,16 @@ ex=0
 # Fail in case of new reports for clean guidelines
 "${ECLAIR_DIR}/action_check_clean_regressions.sh" "${ECLAIR_OUTPUT_DIR}" || 
ex=$?
 
-"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+case "${CI_PIPELINE_SOURCE}" in
+merge_request_event)
+    "${ECLAIR_DIR}/action_pull_request.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+    ;;
+push | pipeline | web | schedule)
+    "${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+    ;;
+*)
+    echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
+    ex=1
+    ;;
+esac
 [ "${ex}" = 0 ] || exit "${ex}"
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.