[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: reproducible trbo system health check: refactoring
Holger Levsen
gitlab at salsa.debian.org
Wed Aug 5 09:44:59 BST 2020
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
7c63d548 by Holger Levsen at 2020-08-03T01:58:43+02:00
reproducible trbo system health check: refactoring
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
8383b838 by Holger Levsen at 2020-08-05T10:44:17+02:00
reproducible trbo system health check: improve description
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- bin/reproducible_system_health.sh
Changes:
=====================================
bin/reproducible_system_health.sh
=====================================
@@ -61,7 +61,7 @@ for JOB_NAME in reproducible_* ; do
SUSPECT=false
# ignore jobs known bad jobs (from jenkins configuration)
if $(grep -q '<disabled>true</disabled>' $JOB_NAME/config.xml) ; then
- echo " <li><a href=\"$JOB_URL/\">$JOB_NAME</a></li>" >> ${KNOWN_BAD_JOBS}
+ echo "1|$JOB_NAME|$JOB_URL||" >> ${KNOWN_BAD_JOBS}
echo " ignored job: $JOB_NAME (known to be non-functional)"
let INVALID+=1
continue
@@ -109,7 +109,7 @@ for JOB_NAME in reproducible_* ; do
# acknowledged they are down...
# jobs one nodes marked down by jenkins are remarked but still counted
if grep -q $NODE $JENKINS_OFFLINE_GIT_LIST >/dev/null 2>&1 ; then
- echo " <li><a href=\"$JOB_URL/\">$JOB_NAME</a></li>" >> ${IGNORED_JOBS}
+ echo "1|$JOB_NAME|$JOB_URL||" >> ${IGNORED_JOBS}
echo " ignored job: $JOB_NAME (node is marked offline)"
let INVALID+=1
continue
@@ -162,9 +162,9 @@ for JOB_NAME in reproducible_* ; do
small_note " (reproducible_build.sh zombies)"
fi
if ! $SUSPECT ; then
- echo " <li><a href=\"$JOB_URL/\"><img src=\"$JOB_URL/badge/icon\">$JOB_NAME</a>$NOTE</li>" >> ${UNSTABLE_JOBS}
+ echo "1|$JOB_NAME|$JOB_URL|true|$NOTE" >> ${UNSTABLE_JOBS}
else
- echo " <li><a href=\"$JOB_URL/\">$JOB_NAME</a>$NOTE</li>" >> ${UNSTABLE_SUSPECTS}
+ echo "1|$JOB_NAME|$JOB_URL||$NOTE" >> ${UNSTABLE_SUSPECTS}
fi
else
prepare_log
@@ -210,19 +210,16 @@ for JOB_NAME in reproducible_* ; do
# skip silently, ignore those jobs
let INPUTS-=1
continue
- elif [ $MODIFIER -eq 1 ] ; then
- echo " failed job: $JOB_NAME"
- if ! $SUSPECT ; then
- echo "$MODIFIER| <li><a href=\"$JOB_URL/\"><img src=\"$JOB_URL/badge/icon\"> $JOB_NAME</a>$NOTE</li>" >> ${FAILED_JOBS}
+ else
+ if [ $MODIFIER -eq 1 ] ; then
+ echo " failed job: $JOB_NAME"
else
- echo "$MODIFIER| <li><a href=\"$JOB_URL/\">$JOB_NAME</a>$NOTE</li>" >> ${FAILED_SUSPECTS}
+ echo " failed job: $JOB_NAME - $MODIFIER"
fi
- else
- echo " failed job: $JOB_NAME - $MODIFIER"
if ! $SUSPECT ; then
- echo "$MODIFIER| <li><a href=\"$JOB_URL/\"><img src=\"$JOB_URL/badge/icon\"> $JOB_NAME</a>$NOTE <em>($MODIFIER)</em></li>" >> ${FAILED_JOBS}
+ echo "$MODIFIER|$JOB_NAME|$JOB_URL|true|$NOTE" >> ${FAILED_JOBS}
else
- echo "$MODIFIER| <li><a href=\"$JOB_URL/\">$JOB_NAME</a>$NOTE <em>($MODIFIER)</em></li>" >> ${FAILED_SUSPECTS}
+ echo "$MODIFIER|$JOB_NAME|$JOB_URL||$NOTE" >> ${FAILED_SUSPECTS}
fi
fi
let SCORE-=$MODIFIER || SCORE=0
@@ -279,19 +276,41 @@ conditional_paragraph() {
write2healthfile " <p>"
write2healthfile " $2:"
write2healthfile " <ul>"
- write2healthfile " $3"
+ OFS=$IFS
+ IFS=$'\012'
+ for LINE in $(cat $1 | sort -t '|' -n ) ; do
+ # only the first three fields are mandatory:
+ # MODIFIER | JOB_NAME | JOB_URL | BADGE (true or false) | NOTE
+ local MODIFIER=$(echo $LINE | cut -d '|' -f1)
+ local NAME=$(echo $LINE | cut -d '|' -f2)
+ local URL=$(echo $LINE | cut -d '|' -f3)
+ local BADGE=$(echo $LINE | cut -d '|' -f4)
+ local NOTE=$(echo $LINE | cut -d '|' -f5)
+ if [ "$BADGE" = "true" ] ; then
+ local LINK="<img src=\"$URL/badge/icon\">$NAME"
+ else
+ local LINK="$NAME"
+ fi
+ if [ "$MODIFIER" = "1" ] ; then
+ local MOREINFO="$NOTE"
+ else
+ local MOREINFO="$NOTE <em>($MODIFIER)</em>"
+ fi
+ write2healthfile " <li><a href=\"$URL/\">$LINK</a>$MOREINFO</li>"
+ done
+ IFS=$OFS
write2healthfile " </ul>"
write2healthfile " </p>"
fi
}
-conditional_paragraph ${FAILED_JOBS} "Failed jobs" "$(cat ${FAILED_JOBS} | sort -t '|' -n -r | cut -d '|' -f2- | sort)"
-conditional_paragraph ${UNSTABLE_JOBS} "Unstable jobs" "$(cat ${UNSTABLE_JOBS})"
-conditional_paragraph ${FAILED_SUSPECTS} "Failed jobs on nodes automatically marked down by jenkins" "$(cat ${FAILED_SUSPECTS} | sort -t '|' -n -r | cut -d '|' -f2- | sort)"
-conditional_paragraph ${UNSTABLE_SUSPECTS} "Unstable jobs on nodes automatically marked down by jenkins" "$(cat ${UNSTABLE_SUSPECTS})"
+conditional_paragraph ${FAILED_JOBS} "Failed jobs"
+conditional_paragraph ${UNSTABLE_JOBS} "Unstable jobs"
+conditional_paragraph ${FAILED_SUSPECTS} "Failed jobs on nodes automatically marked down by jenkins (with modifier > 1)"
+conditional_paragraph ${UNSTABLE_SUSPECTS} "Unstable jobs on nodes automatically marked down by jenkins (with modifier > 1)"
write2healthfile "<hr><p>A stable jobs adds 3 points to the score, an unstable job adds 1 and a failed job substracts something between 1 and 500 (indicated in brackets after the job name if not equal 1), depending on the importance of the job for the setup. Ignored jobs are not counted at all. If the final score is below zero it will be set to zero. Finally status is calculated by diving the score by three times the number of considered jobs and this gets multiplied with 255 to get a status between 0 and 255.</p><hr>"
-conditional_paragraph ${IGNORED_JOBS} "Ignored jobs, because these nodes the are running on are <a href=\"https://salsa.debian.org/qa/jenkins.debian.net/-/blob/master/jenkins-home/offline_nodes\">documented</a> to be offline" "$(cat ${IGNORED_JOBS})"
-conditional_paragraph ${KNOWN_BAD_JOBS} "Ignored jobs, because they are known to be non-funtional" "$(cat ${KNOWN_BAD_JOBS})"
+conditional_paragraph ${IGNORED_JOBS} "Ignored jobs, because these nodes the are running on are <a href=\"https://salsa.debian.org/qa/jenkins.debian.net/-/blob/master/jenkins-home/offline_nodes\">documented</a> to be offline"
+conditional_paragraph ${KNOWN_BAD_JOBS} "Ignored jobs, because they are known to be non-funtional"
write2healthfile "<hr><p><small>This page was last updated on $(date -u) by the <a href=\"https://jenkins.debian.net/job/reproducible_system_health/\">reproducible_system_health</a> job.</small></p>"
write2healthfile "</body></html>"
echo "$(date -u) - $(basename $HEALTH_FILE).html updated, visible at $REPRODUCIBLE_URL/$(basename $HEALTH_FILE).html."
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/2cbe952e9430c653d315b4b0001d848539d06053...8383b8387f7e25604d4f8b648251cdd32d62aa7f
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/2cbe952e9430c653d315b4b0001d848539d06053...8383b8387f7e25604d4f8b648251cdd32d62aa7f
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20200805/09fe32d7/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list