[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: further improvements to general jenkins_job_health page

Holger Levsen gitlab at salsa.debian.org
Fri Oct 12 12:54:22 BST 2018


Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
7640a773 by Holger Levsen at 2018-10-12T11:39:08Z
further improvements to general jenkins_job_health page

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -
004ab3c3 by Holger Levsen at 2018-10-12T11:53:59Z
jenkins_job_health page: don't show 'other jobs' heading if empty

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- bin/maintenance.sh


Changes:

=====================================
bin/maintenance.sh
=====================================
@@ -157,12 +157,14 @@ build_jenkins_job_health_page() {
 	# jenkins job health page
 	#
 	# FIXME: we should really store the output of "$(cd ~/jobs ; ls -1d *)" and only recreate this page if this file doesn't exist or has changed
+	# these are simple egrep filters. however, if they contain a colon,
+	# the filter is split in two, see $category and $avoid below
 	FILTER[0]="maintenance"
 	FILTER[1]="udd"
 	FILTER[2]="lintian"
 	FILTER[3]="piuparts"
 	FILTER[4]="debsums"
-	FILTER[5]="dpkg"
+	FILTER[5]="dpkg:pu-build"
 	FILTER[6]="transitional"
 	FILTER[7]="edu-packages"
 	FILTER[8]="haskell"
@@ -173,24 +175,39 @@ build_jenkins_job_health_page() {
 	FILTER[13]="d-i_overview"
 	FILTER[14]="d-i_manual"
 	FILTER[15]="d-i_build"
-	FILTER[16]="d-i_build"
-	FILTER[17]="d-i_pu-build"
-	FILTER[18]="d-i_schroot"
+	FILTER[16]="d-i_pu-build"
+	FILTER[17]="d-i_schroot"
+	FILTER[18]="d-i_:(overview|manual|build|schroot)"
 	FILTER[19]="rebootstrap"
-	FILTER[20]="g-i-installation_debian_"
-	FILTER[21]="g-i-installation_debian-edu_"
-	FILTER[22]="torbrowser-launcher"
-	FILTER[23]="debian-archive-keyring"
-	FILTER[24]="live"
+	FILTER[20]="g-i-installation_debian_jessie:(presentation|rescue)"
+	FILTER[21]="g-i-installation_debian_sid:(presentation|rescue)"
+	FILTER[22]="g-i-installation_.*presentation"
+	FILTER[23]="g-i-installation_.*rescue"
+	FILTER[24]="g-i-installation_debian-edu_jessie"
+	FILTER[25]="g-i-installation_debian-edu_stretch"
+	FILTER[26]="torbrowser-launcher"
+	FILTER[27]="debian-archive-keyring"
+	FILTER[28]="live:pu-build"
 	numfilters=${#FILTER[@]}
 	let numfilters-=1	# that's what you get when you start counting from 0
 	echo "$(date -u) - starting to write jenkins_job_health page."
 	write_page "<!DOCTYPE html><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"
 	write_page "<title>Jenkins job health</title/></head><body>"
 	for CATEGORY in $(seq 0 $numfilters) ; do
+		# $FILTER with a colon are split into $category and $filter
+		if $(echo "${FILTER[$CATEGORY]}" | grep -q ":") ; then
+			category=$(echo "${FILTER[$CATEGORY]}" | cut -d ":" -f1)
+			filter=$(echo "${FILTER[$CATEGORY]}" | cut -d ":" -f2)
+		else
+			category="${FILTER[$CATEGORY]}"
+			filter=""
+		fi
 		write_page "<p style=\"clear:both;\">"
-		write_page "<h3>${FILTER[$CATEGORY]}</h3>"
-		for JOB in $(cd ~/jobs ; ls -1d * | grep -v reproducible_ | egrep "${FILTER[$CATEGORY]}" | sort ) ; do
+		write_page "<h3>$(echo $category | sed 's#\.\*##g')</h3>"
+		for JOB in $(cd ~/jobs ; ls -1d * | grep -v reproducible_ | egrep "$category" | sort ) ; do
+			if [ -n "$filter" ] && [[ -n $(echo "$JOB" | egrep "$filter") ]] ; then
+				continue
+			fi
 			URL="https://jenkins.debian.net/job/$JOB"
 			BADGE="$URL/badge/icon"
 			write_page "<a href='$URL'><img src='$BADGE' /></a> "
@@ -198,25 +215,35 @@ build_jenkins_job_health_page() {
 		write_page "</p>"
 	done
 	# find jobs not present in jenkins_job_health.html
-	write_page "<p style=\"clear:both;\">"
-	write_page "<h3>Other jobs</h3>"
 	for JOB in $(cd ~/jobs ; ls -1d * | egrep -v '(reproducible_|lost\+found)' | sort ) ; do
 		found=false
 		for CATEGORY in $(seq 0 $numfilters) ; do
-			if [ -n "$(echo $JOB | egrep ${FILTER[$CATEGORY]} 2>/dev/null|| true )" ] ; then
+			if $(echo "${FILTER[$CATEGORY]}" | grep -q ":") ; then
+				category=$(echo "${FILTER[$CATEGORY]}" | cut -d ":" -f1)
+			else
+				category="${FILTER[$CATEGORY]}"
+			fi
+			if [ -n "$(echo $JOB | egrep "$category" 2>/dev/null|| true )" ] ; then
 				found=true
 				continue
 			fi
 		done
 		if ! $found ; then
+			if $empty ; then
+				empty=false
+				write_page "<p style=\"clear:both;\">"
+				write_page "<h3>Other jobs</h3>"
+			fi
 			echo "$(date -u) - job $JOB not present in in existing filters for jenkins_job_health page..."
 			URL="https://jenkins.debian.net/job/$JOB"
 			BADGE="$URL/badge/icon"
 			write_page "<a href='$URL'><img src='$BADGE' /></a> "
 		fi
 	done
-	write_page "</p>"
-	write_page "</body></html>"
+	if ! $empty ; then
+		write_page "</p>"
+		write_page "</body></html>"
+	fi
 	mv $PAGE ~/userContent/jenkins_job_health.html
 	chmod 644 ~/userContent/jenkins_job_health.html
 	echo "$(date -u) - updated https://jenkins.debian.net/userContent/jenkins_job_health.html"



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/a2f215a0648df3b1517714c276a1b9e06121cc19...004ab3c35f07efc3c1409fc995e794b4fcd7442c

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/a2f215a0648df3b1517714c276a1b9e06121cc19...004ab3c35f07efc3c1409fc995e794b4fcd7442c
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/20181012/b63ce541/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list