[Git][qa/jenkins.debian.net][master] 2 commits: reproducible Debian: set SUDO_USER when rescheduling

Holger Levsen (@holger) gitlab at salsa.debian.org
Fri Jan 5 12:33:31 GMT 2024



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


Commits:
dd1f4b12 by Holger Levsen at 2024-01-05T13:31:53+01:00
reproducible Debian: set SUDO_USER when rescheduling

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

- - - - -
f5f1f999 by Holger Levsen at 2024-01-05T13:33:14+01:00
reproducible Debian: sreschedule bad status changes in all suites

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

- - - - -


1 changed file:

- bin/reproducible_build.sh


Changes:

=====================================
bin/reproducible_build.sh
=====================================
@@ -100,34 +100,32 @@ update_db_and_html() {
 	STATUS="$@"
 	local OLD_STATUS=$(query_db "SELECT status FROM results WHERE package_id='${SRCPKGID}'" || \
 			   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" ] || [ "$STATUS" = "timeout" ])) || \
-			([ "$OLD_STATUS" = "FTBR" ] && [ "$STATUS" = "FTBFS" ] ); then
-			MESSAGE="${DEBIAN_URL}/${SUITE}/${ARCH}/${SRCPACKAGE} : ${OLD_STATUS} ➤ ${STATUS}"
-			log_info "$MESSAGE"
-			irc_message debian-reproducible-changes "$MESSAGE"
-			RETRY=true
-		fi
-		if [ "$OLD_STATUS" != "$STATUS" ] && [ "$NOTIFY_MAINTAINER" -eq 1 ] && \
-		  [ "$OLD_STATUS" != "depwait" ] && [ "$STATUS" != "depwait" ] && \
-		  [ "$OLD_STATUS" != "E404" ] && [ "$STATUS" != "E404" ]; then
-			# spool notifications and mail them once a day
-			mkdir -p /srv/reproducible-results/notification-emails
-			echo "$(date -u +'%Y-%m-%d %H:%M') $DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE changed from $OLD_STATUS -> $STATUS" >> /srv/reproducible-results/notification-emails/$SRCPACKAGE
-		fi
+	# irc+mail notifications for changing status
+	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"
+		irc_message debian-reproducible-changes "$MESSAGE"
+		RETRY=true
+	fi
+	if [ "$OLD_STATUS" != "$STATUS" ] && [ "$NOTIFY_MAINTAINER" -eq 1 ] && \
+	  [ "$OLD_STATUS" != "depwait" ] && [ "$STATUS" != "depwait" ] && \
+	  [ "$OLD_STATUS" != "E404" ] && [ "$STATUS" != "E404" ]; then
+		# spool notifications and mail them once a day
+		mkdir -p /srv/reproducible-results/notification-emails
+		echo "$(date -u +'%Y-%m-%d %H:%M') $DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE changed from $OLD_STATUS -> $STATUS" >> /srv/reproducible-results/notification-emails/$SRCPACKAGE
 	fi
 	# Insert or update existing entry in results table
 	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') ON CONFLICT (package_id) DO UPDATE SET version='$VERSION', status='$STATUS', build_date='$DATE', build_duration='$DURATION', node1='$NODE1', node2='$NODE2', job='$JOB' WHERE results.package_id='$SRCPKGID'"
 	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')"
-	# unmark build since it's properly finished
+	# unmark build since it has properly finished
 	query_db "DELETE FROM schedule WHERE package_id='$SRCPKGID' AND build_type='ci_build';"
 	gen_package_html $SRCPACKAGE
 	echo
 	echo "$(date -u) - successfully updated the database and updated $DEBIAN_URL/rb-pkg/${SUITE}/${ARCH}/$SRCPACKAGE.html"
 	echo
 	if $RETRY ; then
-		/srv/jenkins/bin/reproducible_schedule_on_demand.sh -a ${ARCH} -s ${SUITE} ${SRCPACKAGE} || true
+		SUDO_USER=jenkins /srv/jenkins/bin/reproducible_schedule_on_demand.sh -a ${ARCH} -s ${SUITE} ${SRCPACKAGE} || true
 	fi
 }
 



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/8d145dc968d7900026702c59ced828066a2cc433...f5f1f999461de4d2a343ea478a6df86481a24e92

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/8d145dc968d7900026702c59ced828066a2cc433...f5f1f999461de4d2a343ea478a6df86481a24e92
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/20240105/610a9173/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list