[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 3 commits: reproducible debian: build.sh: remove some query_db fallbacks from the sqlite time

Mattia Rizzolo gitlab at salsa.debian.org
Wed Jun 20 11:28:04 BST 2018


Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net


Commits:
bdaff5af by Mattia Rizzolo at 2018-06-20T12:26:33+02:00
reproducible debian: build.sh: remove some query_db fallbacks from the sqlite time

query_db can't tempfail anymore with postgres

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -
bb4adfb6 by Mattia Rizzolo at 2018-06-20T12:26:36+02:00
reproducible debian: build.sh: drop old case when DURATION could have been undefined

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -
4395f641 by Mattia Rizzolo at 2018-06-20T12:27:24+02:00
reproducible: introduce a new "timeout" status to represent build timeouts

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


8 changed files:

- bin/rblib/models.py
- bin/reproducible_build.sh
- bin/reproducible_common.sh
- bin/reproducible_html_dashboard.sh
- bin/reproducible_html_indexes.py
- mustache-templates/reproducible/main_navigation.mustache
- + userContent/reproducible/static/Current_event_clock.png
- userContent/reproducible/static/README.md


Changes:

=====================================
bin/rblib/models.py
=====================================
--- a/bin/rblib/models.py
+++ b/bin/rblib/models.py
@@ -53,6 +53,7 @@ class Status(Enum):
     FTBFS = _status('FTBFS', 'FTBFS', 'weather-storm.png')
     FTBR = _status('FTBR', 'unreproducible', 'weather-showers-scattered.png')
     E404 = _status('E404', '404', 'weather-severe-alert.png')
+    TIMEOUT = _status('timeout', 'build timeout', 'Current_event_clock.png')
     DEPWAIT = _status('depwait', 'depwait', 'weather-snow.png')
     NFU = _status('NFU', 'not for us', 'weather-few-clouds-night.png')
     UNTESTED = _status('untested', 'untested', 'weather-clear-night.png')


=====================================
bin/reproducible_build.sh
=====================================
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -146,7 +146,7 @@ update_db_and_html() {
 			   query_db "SELECT status FROM results WHERE package_id='${SRCPKGID}'")
 	# irc+mail notifications for changing status in unstable and experimental
 	if [ "$SUITE" = "unstable" ] || [ "$SUITE" = "experimental" ] ; then
-		if ([ "$OLD_STATUS" = "reproducible" ] && ( [ "$STATUS" = "FTBR" ] || [ "$STATUS" = "FTBFS" ] )) || \
+		if ([ "$OLD_STATUS" = "reproducible" ] && ( [ "$STATUS" = "FTBR" ] || [ "$STATUS" = "FTBFS" ] || [ "$STATUS" = "timeout" ])) || \
 			([ "$OLD_STATUS" = "FTBR" ] && [ "$STATUS" = "FTBFS" ] ); then
 			MESSAGE="${DEBIAN_URL}/${SUITE}/${ARCH}/${SRCPACKAGE} : ${OLD_STATUS} ➤ ${STATUS}"
 			log_info "$MESSAGE"
@@ -163,18 +163,11 @@ update_db_and_html() {
 	RESULTID=$(query_db "SELECT id FROM results WHERE package_id=$SRCPKGID")
 	# Insert or replace existing entry in results table
 	if [ ! -z "$RESULTID" ] ; then
-		query_db "UPDATE results set package_id='$SRCPKGID', version='$VERSION', status='$STATUS', build_date='$DATE', build_duration='$DURATION', node1='$NODE1', node2='$NODE2', job='$JOB' WHERE id=$RESULTID" || \
 		query_db "UPDATE results set package_id='$SRCPKGID', version='$VERSION', status='$STATUS', build_date='$DATE', build_duration='$DURATION', node1='$NODE1', node2='$NODE2', job='$JOB' WHERE id=$RESULTID"
 	else
-		query_db "INSERT INTO results (package_id, version, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPKGID', '$VERSION', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')" || \
 		query_db "INSERT INTO results (package_id, version, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPKGID', '$VERSION', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')"
 	fi
-	if [ ! -z "$DURATION" ] ; then  # this happens when not E404 and NFU
-		query_db "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPACKAGE', '$VERSION', '$SUITE', '$ARCH', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')" || \
-		query_db "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPACKAGE', '$VERSION', '$SUITE', '$ARCH', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')"
-	fi
 	# unmark build since it's properly finished
-	query_db "DELETE FROM schedule WHERE package_id='$SRCPKGID';" || \
 	query_db "DELETE FROM schedule WHERE package_id='$SRCPKGID';"
 	gen_package_html $SRCPACKAGE
 	echo
@@ -250,6 +243,18 @@ handle_NFU() {
 	exit 0 # RBUILDLOG and SAVE_ARTIFACTS and NOTIFY are used in cleanup_all called at exit
 }
 
+handle_timeout() {
+	echo "${SRCPACKAGE} build timed out"
+	cleanup_pkg_files
+	diff_copy_buildlogs
+	update_rbuildlog
+	calculate_build_duration
+	update_db_and_html "timeout"
+	if [ $SAVE_ARTIFACTS -eq 1 ] ; then SAVE_ARTIFACTS=0 ; fi
+	if [ ! -z "$NOTIFY" ] ; then NOTIFY="timeout" ; fi
+	exit 0
+}
+
 handle_ftbfs() {
 	echo "${SRCPACKAGE} failed to build from source."
 	cleanup_pkg_files
@@ -786,9 +791,12 @@ remote_build() {
 		148)  # 404-256=148... (ssh 'really' only 'supports' exit codes below 255...)
 			handle_E404
 			;;
-		2|3)
+		2)
 			handle_ftbfs
 			;;
+		3)
+			handle_timeout
+			;;
 		0)  # build succcessfully completed
 			;;
 		*)


=====================================
bin/reproducible_common.sh
=====================================
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -145,6 +145,7 @@ set_icon() {
 					;;
 		FTBFS)			ICON=weather-storm.png
 					;;
+		timeout)	ICON=Current_event_clock.png ;;
 		depwait)		ICON=weather-snow.png
 					;;
 		E404)			ICON=weather-severe-alert.png


=====================================
bin/reproducible_html_dashboard.sh
=====================================
--- a/bin/reproducible_html_dashboard.sh
+++ b/bin/reproducible_html_dashboard.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# vim: set noexpandtab:
 
 # Copyright 2014-2017 Holger Levsen <holger at layer-acht.org>
 #         © 2015 Mattia Rizzolo <mattia at mapreri.org>
@@ -194,15 +195,17 @@ gather_suite_arch_stats() {
 	COUNT_GOOD=$(query_db "SELECT COUNT(*) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status='reproducible'")
 	COUNT_BAD=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'FTBR'")
 	COUNT_UGLY=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'FTBFS'")
+	COUNT_TIMEOUT=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'timeout'")
 	COUNT_SOURCELESS=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'E404'")
 	COUNT_NOTFORUS=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'NFU'")
 	COUNT_BLACKLISTED=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'blacklisted'")
 	COUNT_DEPWAIT=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'depwait'")
-	COUNT_OTHER=$(( $COUNT_SOURCELESS+$COUNT_NOTFORUS+$COUNT_BLACKLISTED+$COUNT_DEPWAIT ))
+	COUNT_OTHER=$(( $COUNT_SOURCELESS+$COUNT_NOTFORUS+$COUNT_BLACKLISTED+$COUNT_DEPWAIT+$COUNT_TIMEOUT ))
 	PERCENT_TOTAL=$(echo "scale=1 ; ($COUNT_TOTAL*100/$AMOUNT)" | bc)
 	PERCENT_GOOD=$(echo "scale=1 ; ($COUNT_GOOD*100/$COUNT_TOTAL)" | bc || echo 0)
 	PERCENT_BAD=$(echo "scale=1 ; ($COUNT_BAD*100/$COUNT_TOTAL)" | bc || echo 0)
 	PERCENT_UGLY=$(echo "scale=1 ; ($COUNT_UGLY*100/$COUNT_TOTAL)" | bc || echo 0)
+	PERCENT_TIMEOUT=$(echo "scale=1 ; ($COUNT_TIMEOUT*100/$COUNT_TOTAL)" | bc || echo 0)
 	PERCENT_NOTFORUS=$(echo "scale=1 ; ($COUNT_NOTFORUS*100/$COUNT_TOTAL)" | bc || echo 0)
 	PERCENT_DEPWAIT=$(echo "scale=1 ; ($COUNT_DEPWAIT*100/$COUNT_TOTAL)" | bc || echo 0)
 	PERCENT_SOURCELESS=$(echo "scale=1 ; ($COUNT_SOURCELESS*100/$COUNT_TOTAL)" | bc || echo 0)
@@ -420,6 +423,9 @@ write_suite_arch_table() {
 	set_icon FTBFS
 	write_icon
 	write_page "packages failing to build</th><th class=\"center\">"
+	set_icon timeout
+	write_icon
+	write_page "packages timing out</th><th class=\"center\">"
 	set_icon depwait
 	write_icon
 	write_page "packages in depwait state</th><th class=\"center\">"
@@ -436,7 +442,7 @@ write_suite_arch_table() {
 			if [ $(echo $PERCENT_TOTAL/1|bc) -lt 99 ] ; then
 				write_page "<span style=\"font-size:0.8em;\">($PERCENT_TOTAL% tested)</span>"
 			fi
-			write_page "</td><td>$COUNT_GOOD / $PERCENT_GOOD%</td><td>$COUNT_BAD / $PERCENT_BAD%</td><td>$COUNT_UGLY / $PERCENT_UGLY%</td><td>$COUNT_DEPWAIT / $PERCENT_DEPWAIT%</td><td>$COUNT_NOTFORUS / $PERCENT_NOTFORUS%</td><td>$COUNT_BLACKLISTED / $PERCENT_BLACKLISTED%</td></tr>"
+			write_page "</td><td>$COUNT_GOOD / $PERCENT_GOOD%</td><td>$COUNT_BAD / $PERCENT_BAD%</td><td>$COUNT_UGLY / $PERCENT_UGLY%</td><td>$COUNT_TIMEOUT / $PERCEN_TIMEOUT</td><td>$COUNT_DEPWAIT / $PERCENT_DEPWAIT%</td><td>$COUNT_NOTFORUS / $PERCENT_NOTFORUS%</td><td>$COUNT_BLACKLISTED / $PERCENT_BLACKLISTED%</td></tr>"
 		done
 	done
         write_page "</table>"


=====================================
bin/reproducible_html_indexes.py
=====================================
--- a/bin/reproducible_html_indexes.py
+++ b/bin/reproducible_html_indexes.py
@@ -278,6 +278,14 @@ queries = {
         ).order_by(
             desc(results.c.build_date)
         ),
+    "timeout_all":
+        select_sources.where(
+            and_(
+                results.c.status == Status.TIMEOUT.value.name
+            )
+        ).order_by(
+            sources.c.name
+        ),
     "not_for_us_all":
         select_sources.where(
             and_(
@@ -393,6 +401,16 @@ pages = {
             }
         ]
     },
+    'timeout': {
+        'title': 'Packages in {suite}/{arch} which build timed out',
+        'body': [
+            {
+                'icon_status': Status.TIMEOUT.value.icon,
+                'query': 'timeout_all',
+                'text': Template('$tot ($percent%) packages which build timed out:')
+            }
+        ]
+    },
     'blacklisted': {
         'title': 'Packages in {suite}/{arch} which have been blacklisted',
         'body': [
@@ -425,6 +443,12 @@ pages = {
                 'text': Template('$tot ($percent%) packages which should not be build in $suite/$arch:')
             },
             {
+                'icon_status': Status.TIMEOUT.value.icon,
+                'icon_lnk': '/index_timeout.html',
+                'query': 'timeout_all',
+                'text': Template('$tot ($percent%) packages which build timed out in $suite/$arch:')
+            },
+            {
                 'icon_status': Status.E404.value.icon,
                 'icon_link': '/index_404.html',
                 'query': 'E404_all_abc',
@@ -566,6 +590,13 @@ pages = {
                 'text': Template('$tot not for us packages in $suite/$arch:')
             },
             {
+                'status': Status.TIMEOUT,
+                'icon_link': '/index_timeout.html',
+                'query': 'notes',
+                'nosuite': True,
+                'text': Template('$tot timing out packages in $suite/$arch:')
+            },
+            {
                 'status': Status.BLACKLISTED,
                 'icon_link': '/index_blacklisted.html',
                 'query': 'notes',


=====================================
mustache-templates/reproducible/main_navigation.mustache
=====================================
--- a/mustache-templates/reproducible/main_navigation.mustache
+++ b/mustache-templates/reproducible/main_navigation.mustache
@@ -78,6 +78,10 @@
            title="Failed To Build From Source">
           <img src="/static/weather-storm.png" alt="FTBFS icon" />
         </a>
+        <a href="/debian/{{suite}}/{{arch}}/index_timeout.html" target="_parent"
+           title="Build timed out">
+          <img src="/static/Current_event_clock.png" alt="timeout icon" />
+        </a>
         <a href="/debian/{{suite}}/{{arch}}/index_depwait.html" target="_parent"
            title="failed to install build dependencies">
           <img src="/static/weather-snow.png" alt="depwait icon" />


=====================================
userContent/reproducible/static/Current_event_clock.png
=====================================
Binary files /dev/null and b/userContent/reproducible/static/Current_event_clock.png differ


=====================================
userContent/reproducible/static/README.md
=====================================
--- a/userContent/reproducible/static/README.md
+++ b/userContent/reproducible/static/README.md
@@ -1,5 +1,9 @@
 ## Copyright and License information
 
+* Current_event_clock.png
+  + https://commons.wikimedia.org/wiki/File:Current_event_clock.svg
+  + Public Domain
+
 * error.png
 * weather-clear-night.png
 * weather-clear.png



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/b5b250cdf01ef7e4724b1c9fe7aef76bab768178...4395f6411a1c7e1ecc633799e55052a260d89743

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/b5b250cdf01ef7e4724b1c9fe7aef76bab768178...4395f6411a1c7e1ecc633799e55052a260d89743
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/20180620/beb3ff9d/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list