[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible: spool notifications to package maintainers and only send them once a day
Holger Levsen
holger at moszumanska.debian.org
Fri Oct 2 09:40:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit 2cfab5ad8fdd5856738deed4f6569e2904e2cfee
Author: Holger Levsen <holger at layer-acht.org>
Date: Fri Oct 2 11:40:11 2015 +0200
reproducible: spool notifications to package maintainers and only send them once a day
---
bin/reproducible_build.sh | 7 +++----
bin/reproducible_html_indexes.py | 2 +-
bin/reproducible_maintenance.sh | 13 ++++++++++++-
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 3f01c8a..07bd0f9 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -114,10 +114,9 @@ update_db_and_html() {
[ "$OLD_STATUS" != "$STATUS" ] && [ "$NOTIFY_MAINTAINER" -eq 1 ] && \
[ "$OLD_STATUS" != "depwait" ] && [ "$STATUS" != "depwait" ] && \
[ "$OLD_STATUS" != "404" ] && [ "$STATUS" != "404" ]; then
- echo "More information on $REPRODUCIBLE_URL/$SUITE/$ARCH/$SRCPACKAGE, feel free to reply to this email to get more help." | \
- mail -s "$SRCPACKAGE changed in $SUITE/$ARCH: $OLD_STATUS -> $STATUS" \
- -a "From: Reproducible builds folks <reproducible-builds at lists.alioth.debian.org>" \
- "$SRCPACKAGE at packages.debian.org"
+ # spool notifications and mail them once a day
+ mkdir -p /srv/reproducible-results/notification-emails
+ echo "$(date -u +'%Y-%m-%d %H:%M') $REPRODUCIBLE_URL/$SUITE/$ARCH/$SRCPACKAGE changed from $OLD_STATUS -> $STATUS" >> /srv/reproducible-results/notification-emails/$SRCPACKAG
fi
sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration, builder) VALUES ('$SRCPKGID', '$VERSION', '$STATUS', '$DATE', '$DURATION', '$BUILDER')"
if [ ! -z "$DURATION" ] ; then # this happens when not 404 and not_for_us
diff --git a/bin/reproducible_html_indexes.py b/bin/reproducible_html_indexes.py
index 3b5f66d..0da7f4c 100755
--- a/bin/reproducible_html_indexes.py
+++ b/bin/reproducible_html_indexes.py
@@ -374,7 +374,7 @@ pages = {
'notes': True,
'nosuite': True,
'title': 'Packages with notification enabled',
- 'header': '<p>The following {tot} packages have notifications enabled. (This page only shows packages in {suite}/{arch} though notifications are send for these packages in unstable and experimental in any tested arch.) On status changes (e.g. reproducible → unreproducible) the system sends an email to $srcpackage at packages.debian.org, notifying the maintainer and relevant parties. You can subscribe through the PTS or Tracker if you are interested in such emails.<br />Please ask u [...]
+ 'header': '<p>The following {tot} packages have notifications enabled. (This page only shows packages in {suite}/{arch} though notifications are send for these packages in unstable and experimental in any tested arch.) On status changes (e.g. reproducible → unreproducible) the system notifies the maintainer and relevant parties via an email to $srcpackage at packages.debian.org. Notifications are collected and send once a day to avoid flooding mailinglists..<br />Please ask us to en [...]
'header_query': 'SELECT COUNT(*) FROM sources WHERE suite="{suite}" AND architecture="{arch}" AND notify_maintainer = 1',
'body': [
{
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 7cc50dd..4518415 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -336,8 +336,9 @@ if [ ! -z "$BADPERMS" ] ; then
echo
fi
-# once a day, send mail about builder problems
+# daily mails
if [ "$HOSTNAME" = "$MAINNODE" ] && [ $(date -u +%H) -eq 0 ] ; then
+ # once a day, send mail about builder problems
for PROBLEM in /var/lib/jenkins/stale_builds.txt /var/log/jenkins/reproducible-race-conditions.log ; do
if [ -s $PROBLEM ] ; then
TMPFILE=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXXX)
@@ -346,6 +347,16 @@ if [ "$HOSTNAME" = "$MAINNODE" ] && [ $(date -u +%H) -eq 0 ] ; then
rm -f $TMPFILE
fi
done
+ # once a day, send notifications to package maintainers
+ cd /srv/reproducible-results/notification-emails
+ for NOTE in $(find . -type f) ; do
+ TMPFILE=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXXX)
+ mv $NOTE $TMPFILE
+ cat $TMPFILE | mail -s "reproducible.debian.net status changes for $NOTE" \
+ -a "From: Reproducible builds folks <reproducible-builds at lists.alioth.debian.org>" \
+ $NOTE at packages.debian.org
+ rm -f $TMPFILE
+ done
fi
if ! $DIRTY ; then
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list