diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh
index eb616b1311..0000f01b89 100755
--- a/EESSI-install-software.sh
+++ b/EESSI-install-software.sh
@@ -237,7 +237,7 @@ else
copy_build_log "${eb_last_log}" "${build_logs_dir}"
fi
- $TOPDIR/check_missing_installations.sh ${TOPDIR}/${easystack_file}
+ $TOPDIR/check_missing_installations.sh ${TOPDIR}/${easystack_file} ${TOPDIR}/${pr_diff}
else
fatal_error "Easystack file ${easystack_file} not found!"
fi
diff --git a/bot/check-build.sh b/bot/check-build.sh
index ec1ca56bba..e075518421 100755
--- a/bot/check-build.sh
+++ b/bot/check-build.sh
@@ -98,15 +98,15 @@ job_dir=${PWD}
job_out="slurm-${SLURM_JOB_ID}.out"
[[ ${VERBOSE} -ne 0 ]] && echo ">> searching for job output file(s) matching '"${job_out}"'"
if [[ -f ${job_out} ]]; then
- SLURM=1
+ SLURM_OUTPUT_FOUND=1
[[ ${VERBOSE} -ne 0 ]] && echo " found slurm output file '"${job_out}"'"
else
- SLURM=0
+ SLURM_OUTPUT_FOUND=0
[[ ${VERBOSE} -ne 0 ]] && echo " Slurm output file '"${job_out}"' NOT found"
fi
ERROR=-1
-if [[ ${SLURM} -eq 1 ]]; then
+if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_error='ERROR: '
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_error}")
[[ $? -eq 0 ]] && ERROR=1 || ERROR=0
@@ -116,7 +116,7 @@ if [[ ${SLURM} -eq 1 ]]; then
fi
FAILED=-1
-if [[ ${SLURM} -eq 1 ]]; then
+if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_failed='FAILED: '
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_failed}")
[[ $? -eq 0 ]] && FAILED=1 || FAILED=0
@@ -126,7 +126,7 @@ if [[ ${SLURM} -eq 1 ]]; then
fi
MISSING=-1
-if [[ ${SLURM} -eq 1 ]]; then
+if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_req_missing=' required modules missing:'
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_req_missing}")
[[ $? -eq 0 ]] && MISSING=1 || MISSING=0
@@ -136,7 +136,7 @@ if [[ ${SLURM} -eq 1 ]]; then
fi
NO_MISSING=-1
-if [[ ${SLURM} -eq 1 ]]; then
+if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_no_missing='No missing installations'
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_no_missing}")
[[ $? -eq 0 ]] && NO_MISSING=1 || NO_MISSING=0
@@ -147,7 +147,7 @@ fi
TGZ=-1
TARBALL=
-if [[ ${SLURM} -eq 1 ]]; then
+if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_tgz_created="\.tar\.gz created!"
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_tgz_created}" | sort -u)
if [[ $? -eq 0 ]]; then
@@ -169,9 +169,27 @@ fi
[[ ${VERBOSE} -ne 0 ]] && echo " NO_MISSING.: $([[ $NO_MISSING -eq 1 ]] && echo 'yes' || echo 'no') (yes)"
[[ ${VERBOSE} -ne 0 ]] && echo " TGZ_CREATED: $([[ $TGZ -eq 1 ]] && echo 'yes' || echo 'no') (yes)"
+# Here, we try to do some additional analysis on the output file
+# to see if we can print a more clear 'reason' for the failure
+# For now, we only analyse unmerged EasyConfigs as potential cause, but we can easily add checks for other
+# specific scenarios below
+
+# Check for the pattern being added here by check_missing_installations.sh to the output to
+# see if EasyConfigs might have been unmerged, and that's causing a failure
+UNMERGED_EASYCONFIG=-1
+if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
+ gp_unmerged="are you sure all PRs referenced have been merged in EasyBuild"
+ grep_unmerged=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${gp_unmerged}")
+ [[ $? -eq 0 ]] && UNMERGED_EASYCONFIG=1 || UNMERGED_EASYCONFIG=0
+ # have to be careful to not add searched for pattern into slurm out file
+ [[ ${VERBOSE} -ne 0 ]] && echo ">> searching for '"${gp_unmerged}"'"
+ [[ ${VERBOSE} -ne 0 ]] && echo "${grep_unmerged}"
+fi
+
job_result_file=_bot_job${SLURM_JOB_ID}.result
-if [[ ${SLURM} -eq 1 ]] && \
+# Default reason:
+if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]] && \
[[ ${ERROR} -eq 0 ]] && \
[[ ${FAILED} -eq 0 ]] && \
[[ ${MISSING} -eq 0 ]] && \
@@ -180,10 +198,17 @@ if [[ ${SLURM} -eq 1 ]] && \
[[ ! -z ${TARBALL} ]]; then
# SUCCESS
status="SUCCESS"
+ reason=""
summary=":grin: SUCCESS"
+elif [[ ${UNMERGED_EASYCONFIG} -eq 1 ]]; then
+ status="FAILURE"
+ reason="EasyConfig not found during missing installation check. Are you sure all PRs referenced have been merged in EasyBuild?"
+ summary=":cry: FAILURE"
else
# FAILURE
status="FAILURE"
+ # General failure, we don't know a more specific reason
+ reason=""
summary=":cry: FAILURE"
fi
@@ -253,14 +278,6 @@ fi
#
###
-# construct and write complete PR comment details: implements third alternative
-comment_template="__DETAILS_FMT____ARTEFACTS_FMT__
${job_out}
"
failure_msg="no job output file ${job_out}
"
-CoDeList=${CoDeList}$(add_detail ${SLURM} 1 "${success_msg}" "${failure_msg}")
+comment_details_list=${comment_details_list}$(add_detail ${SLURM_OUTPUT_FOUND} 1 "${success_msg}" "${failure_msg}")
success_msg="no message matching ${GP_error}
"
failure_msg="found message matching ${GP_error}
"
-CoDeList=${CoDeList}$(add_detail ${ERROR} 0 "${success_msg}" "${failure_msg}")
+comment_details_list=${comment_details_list}$(add_detail ${ERROR} 0 "${success_msg}" "${failure_msg}")
success_msg="no message matching ${GP_failed}
"
failure_msg="found message matching ${GP_failed}
"
-CoDeList=${CoDeList}$(add_detail ${FAILED} 0 "${success_msg}" "${failure_msg}")
+comment_details_list=${comment_details_list}$(add_detail ${FAILED} 0 "${success_msg}" "${failure_msg}")
success_msg="no message matching ${GP_req_missing}
"
failure_msg="found message matching ${GP_req_missing}
"
-CoDeList=${CoDeList}$(add_detail ${MISSING} 0 "${success_msg}" "${failure_msg}")
+comment_details_list=${comment_details_list}$(add_detail ${MISSING} 0 "${success_msg}" "${failure_msg}")
success_msg="found message(s) matching ${GP_no_missing}
"
failure_msg="no message matching ${GP_no_missing}
"
-CoDeList=${CoDeList}$(add_detail ${NO_MISSING} 1 "${success_msg}" "${failure_msg}")
+comment_details_list=${comment_details_list}$(add_detail ${NO_MISSING} 1 "${success_msg}" "${failure_msg}")
success_msg="found message matching ${GP_tgz_created}
"
failure_msg="no message matching ${GP_tgz_created}
"
-CoDeList=${CoDeList}$(add_detail ${TGZ} 1 "${success_msg}" "${failure_msg}")
-
-comment_details="${comment_details_fmt/__DETAILS_LIST__/${CoDeList}}"
-
+comment_details_list=${comment_details_list}$(add_detail ${TGZ} 1 "${success_msg}" "${failure_msg}")
+# Now, do the actual replacement of __DETAILS_FMT__
+comment_details_fmt="" + comment_artifacts_list="" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item2 'size: __ITEM__ MiB (__ITEM2__ bytes)' ${size_mib} ${size})" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item 'entries: __ITEM__' ${entries})" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item 'modules under ___ITEM___' ${prefix}/modules/all)" + comment_artifacts_list="${comment_artifacts_list}" else - CoArList="${CoArList}$(print_dd_item 'No artefacts were created or found.' '')" + comment_artifacts_list="${comment_artifacts_list}$(print_dd_item 'No artefacts were created or found.' '')" fi +comment_artefact_details_fmt="" if [[ ! -z ${modules} ]]; then while IFS= read -r mod ; do - CoArList="${CoArList}$(print_br_item '" - CoArList="${CoArList}$(print_br_item 'software under ___ITEM___' ${prefix}/software)" - CoArList="${CoArList}__ITEM__
' ${mod})" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item '__ITEM__
' ${mod})" done <<< "${modules}" else - CoArList="${CoArList}$(print_br_item '__ITEM__' 'no module files in tarball')" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item '__ITEM__' 'no module files in tarball')" fi - CoArList="${CoArList}" + comment_artifacts_list="${comment_artifacts_list}" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item 'software under ___ITEM___' ${prefix}/software)" + comment_artifacts_list="${comment_artifacts_list}" if [[ ! -z ${software_pkgs} ]]; then while IFS= read -r sw_pkg ; do - CoArList="${CoArList}$(print_br_item '" - CoArList="${CoArList}$(print_br_item 'other under ___ITEM___' ${prefix})" - CoArList="${CoArList}__ITEM__
' ${sw_pkg})" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item '__ITEM__
' ${sw_pkg})" done <<< "${software_pkgs}" else - CoArList="${CoArList}$(print_br_item '__ITEM__' 'no software packages in tarball')" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item '__ITEM__' 'no software packages in tarball')" fi - CoArList="${CoArList}" + comment_artifacts_list="${comment_artifacts_list}" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item 'other under ___ITEM___' ${prefix})" + comment_artifacts_list="${comment_artifacts_list}" if [[ ! -z ${other_shortened} ]]; then while IFS= read -r other ; do - CoArList="${CoArList}$(print_br_item '" + comment_artifacts_list="${comment_artifacts_list}__ITEM__
' ${other})" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item '__ITEM__
' ${other})" done <<< "${other_shortened}" else - CoArList="${CoArList}$(print_br_item '__ITEM__' 'no other files in tarball')" + comment_artifacts_list="${comment_artifacts_list}$(print_br_item '__ITEM__' 'no other files in tarball')" fi - CoArList="${CoArList}