]> xenbits.xensource.com Git - xen.git/commitdiff
automation: fix eclair gitlab jobs for merge requests
authorStefano Stabellini <stefano.stabellini@amd.com>
Mon, 5 Aug 2024 21:24:23 +0000 (14:24 -0700)
committerStefano Stabellini <stefano.stabellini@amd.com>
Tue, 6 Aug 2024 19:29:05 +0000 (12:29 -0700)
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@amd.com>
Reviewed-by: Simone Ballarin <simone.ballarin@bugseng.com>
automation/eclair_analysis/ECLAIR/action_pull_request.sh [changed mode: 0644->0755]
automation/scripts/eclair

old mode 100644 (file)
new mode 100755 (executable)
index 68f7e62..812238e
@@ -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
 }
 
index ebcaf09b54390c8209a0dad1ccd51cdb595d4a58..3ec760bab8b3c823a3006b029a9dc9dcebdb1cc8 100755 (executable)
@@ -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}"