summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-10-02 11:40:11 +0200
committerHolger Levsen <holger@layer-acht.org>2015-10-02 11:40:11 +0200
commit2cfab5ad8fdd5856738deed4f6569e2904e2cfee (patch)
tree73d9b842d8171f3f25b6a483df051689b73f3268
parent662dc8631c26028715b91571a7a7ced2c4d18218 (diff)
downloadjenkins.debian.net-2cfab5ad8fdd5856738deed4f6569e2904e2cfee.tar.xz
reproducible: spool notifications to package maintainers and only send them once a day
-rwxr-xr-xbin/reproducible_build.sh7
-rwxr-xr-xbin/reproducible_html_indexes.py2
-rwxr-xr-xbin/reproducible_maintenance.sh13
3 files changed, 16 insertions, 6 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 3f01c8a6..07bd0f98 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@lists.alioth.debian.org>" \
- "$SRCPACKAGE@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 3b5f66d0..0da7f4c8 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@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 us to enable notifications for your package(s) in our IRC channel #debian-reproducible or via <a href="mailto:reproducible-builds@lists.alioth.debian.org">mail</a>!</p>',
+ '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@packages.debian.org. Notifications are collected and send once a day to avoid flooding mailinglists..<br />Please ask us to enable notifications for your package(s) in our IRC channel #debian-reproducible or via <a href="mailto:reproducible-builds@lists.alioth.debian.org">mail</a> but ask your fellow team members first if they want to receive such notifications.</p>',
'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 7cc50dd6..4518415d 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@lists.alioth.debian.org>" \
+ $NOTE@packages.debian.org
+ rm -f $TMPFILE
+ done
fi
if ! $DIRTY ; then