chiark / gitweb /
* adt-testreport-onepackage: support for Launchpad bug filing
authorIan Jackson <ian@davenant.greenend.org.uk>
Tue, 28 Aug 2007 16:09:41 +0000 (17:09 +0100)
committerIan Jackson <ian@davenant.greenend.org.uk>
Tue, 28 Aug 2007 16:09:41 +0000 (17:09 +0100)
  including signing emails, `affects' line, etc.
* hosts/chinstrap/*: screen-scrap Launchpad to get existing bugs.
* adt-testreport-onepackage: suppress email for packages listed
  in existing bugs suppression file.
* hosts/cadmium/*: convenience scripts changed.
* better formatting and explanations in some emails.

.bzrignore
debian/changelog
hosts/cadmium/adt-sendto-launchpad [deleted file]
hosts/cadmium/install-on-cadmium [new file with mode: 0755]
hosts/cadmium/manual-test-one-source [new file with mode: 0755]
hosts/cadmium/onepackage-config
hosts/chinstrap/crontab [new file with mode: 0644]
hosts/chinstrap/install-on-chinstrap [new file with mode: 0755]
hosts/chinstrap/update-suppressions [new file with mode: 0755]
runner/adt-testreport-onepackage

index feb11fbe0f790868cb4ce376e596576652b2438b..df38628b2349d7615505fdf01c3e7478df8c0d13 100644 (file)
@@ -5,3 +5,6 @@ debian/tmp
 debian/files
 xen/sed-readconfig
 xen/readconfig
+hosts/chinstrap/webpage
+hosts/chinstrap/suppressions
+hosts/chinstrap/suppressions.new
index db036375eb64a7f715af7f3716c0bf2f75b46b9b..3a3c4d67425a5c10ea90c2b8825572367fc99e73 100644 (file)
@@ -7,6 +7,13 @@ autopkgtest (1.0.4) unstable; urgency=low
   * adt-run: increase timeouts 10s, 3ks, 10ks, 100ks.
   * adt-testreport-onepackage: suppress repetitive emails.
   * hosts/cadmium/onepackage-config: change destination directory
+  * adt-testreport-onepackage: support for Launchpad bug filing
+    including signing emails, `affects' line, etc.
+  * hosts/chinstrap/*: screen-scrap Launchpad to get existing bugs.
+  * adt-testreport-onepackage: suppress email for packages listed
+    in existing bugs suppression file.
+  * hosts/cadmium/*: convenience scripts changed.
+  * better formatting and explanations in some emails.
 
  --
 
diff --git a/hosts/cadmium/adt-sendto-launchpad b/hosts/cadmium/adt-sendto-launchpad
deleted file mode 100755 (executable)
index c636269..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/perl
-
-# formail < AUTOPKGTEST -s /net/anarres/slash/ubuntu/work/AutomatedTesting/autopkgtest--main/runner/adt-sendto-launchpad --mail
-
-if ($ARGV[0] eq '--mail') {
-    shift;
-    $sm= open STDOUT, "|/usr/sbin/sendmail -oi -odb -oem -t";
-    defined $sm or die $!;
-}
-
-while (<>) {
-    if (s/^subject: //i) {
-       s/^autopkgtest // or die "$_ ?";
-       s/^(\w+) // or die "$_ ?";  $distro= $1;
-       s/^([-+.0-9a-z]+)// or die "$_ ?";  $package= $1;
-       if (m/^:/) {
-           $target= 'source';
-       } elsif (m/^ (\w+)\:/) {
-           $target= $1;
-       } else {
-           die "$_ ?";
-       }
-    }
-    last if m/^$/;
-}
-
-$lphead= " affects /ubuntu/$package\n";
-
-if ($target eq 'source') {
-    $subject= "$distro/amd64: ftbfs / autopkgtest failure";
-    $intro= '
-An instance of autopkgtest (an automatic package testing system) has
-found that this package either failed to build from source - or that
-it declared some tests in its debian/tests/control and that at least
-one of these tests failed.
-';
-} else {
-    $subject= "$distro/$target: failed to install (autopkgtest)";
-    $intro= '
-An instance of autopkgtest (an automatic package testing system) has
-found that this package did not successfully install.
-';
-}
-
-$common= "
-A human has briefly looked at the transcript and concluded that the
-fault is a bug in the package or one of its build-dependencies.
-
-The test environment is an amd64 Xen guest with limited amounts of
-memory.  The relevant dependencies are installed for each test but
-very few other packages.
-
-The top and bottom of the mail sent by the autopkgtest instance to its
-administrator is included below.  The full log can be found at
- http://autopkgtest.ubuntu.com/autopkgtest-output/$distro/$package/
-
-";
-
-$headers=
-"To: new\@bugs.launchpad.net
-Subject: $subject
-
-";
-
-for ($i=0; $i<7; $i++) { $top .= "| ".<>; }
-
-for (;;) {
-    defined($_= <>) or last;
-    push @bot, "| ".$_;
-    shift @bot if @bot > 50;
-}
-
-print $headers or die $!;
-
-$body= $lphead.$intro. $common. $top. "...\n". join("",@bot);
-
-open P, "|gpg -u0xc62ac3f4 --clearsign" or die $!;
-print P $body;
-$?=0; close P or die $!;
-die $? if $?;
-
-if (defined $sm) {
-    $?=0; close STDOUT or die $!;
-    die $? if $?;
-}
diff --git a/hosts/cadmium/install-on-cadmium b/hosts/cadmium/install-on-cadmium
new file mode 100755 (executable)
index 0000000..bc1aa6e
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+cd /work/AutomatedTesting/autopkgtest--main/
+rsync -a . cadmium.buildd:autopkgtest/.
diff --git a/hosts/cadmium/manual-test-one-source b/hosts/cadmium/manual-test-one-source
new file mode 100755 (executable)
index 0000000..c25842f
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+# usage: .../manual-test-one-source <package-name>
+set -ex
+cd /home/iwj/adt-play
+PATH=/home/iwj/autopkgtest/runner:/usr/local/sbin:/usr/sbin:$PATH
+export PATH
+adt-testreport-onepackage /home/iwj/adt-play/onepackage-config adtrun_extra_opts=--built-binaries-filter=__ interactive=false target=source pkg=$1
index a99e8d0c6c815714017309f3e74fc46ccf095ffb..aa747db76cbdae2115050b94be91fadaa181b332 100644 (file)
@@ -3,14 +3,29 @@ mirror=http://archive.ubuntu.com/ubuntu
 distro=gutsy
 suite=main
 administrator_email=iwj@ubuntu.com
-maintainer_email_override="$administrator_email"
+#maintainer_email_override="$administrator_email"
 salutation="Ian"
-from="$salutation Jackson <iwj@ubuntu.com>"
+from="$salutation Jackson <ian+ubuntu-autopkgtest@chiark.greenend.org.uk>"
 disable=false
-desthttphead=http://autopkgtest.ubuntu.com/
+desthttphead=http://autopkgtest.ubuntu.com
 destrsynchead=/home/iwj/public_html
 destdirtail=autopkgtest-output
 adtvirt_extra_opts=--userv
 upload_if_ok=true
 upload_if_notests=true
-suppressrepeatedemails=true
+suppressrepeatedemails=false
+suppresspackages=suppressions
+
+email_extra_info='
+The test environment is an amd64 Xen guest with limited amounts of
+memory.  The relevant dependencies are installed for each test but
+very few other packages.  Most autopkgtest reports are FTBFS problems.
+'
+
+maintainer_email_override="new@bugs.launchpad.net"
+email_package_header='
+ affects /ubuntu/%s
+ importance high
+
+'
+email_signing_key=0xD6279768
diff --git a/hosts/chinstrap/crontab b/hosts/chinstrap/crontab
new file mode 100644 (file)
index 0000000..f716f26
--- /dev/null
@@ -0,0 +1,3 @@
+MAILTO=iwj@ubuntu.com
+# m h dom mon dow       command
+26 * * * *             autopkgtest/hosts/chinstrap/update-suppressions
diff --git a/hosts/chinstrap/install-on-chinstrap b/hosts/chinstrap/install-on-chinstrap
new file mode 100755 (executable)
index 0000000..189ff1c
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+cd /work/AutomatedTesting/autopkgtest--main/
+rsync -a . chinstrap.ubuntu.com:autopkgtest/.
diff --git a/hosts/chinstrap/update-suppressions b/hosts/chinstrap/update-suppressions
new file mode 100755 (executable)
index 0000000..601c4cf
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+cd ${0%/*}
+
+url='https://launchpad.net/ubuntu/+bugs?field.searchtext=&orderby=-importance&field.status%3Alist=New&field.status%3Alist=Incomplete&field.status%3Alist=Confirmed&field.status%3Alist=Triaged&field.status%3Alist=In+Progress&field.status%3Alist=Fix+Committed&assignee_option=any&field.assignee=&field.bug_reporter=ian%2Bubuntu-autopkgtest&field.bug_contact=&field.bug_commenter=&field.subscriber=&field.status_upstream-empty-marker=1&field.omit_dupes.used=&field.has_patch.used=&field.tag=&field.has_cve.used=&search=Search'
+
+echo 'fetching'
+curl -s -k -o webpage "$url"
+
+echo 'grepping'
+perl -ne '
+    print "$1\n" or die $! if
+     m,"https://bugs.launchpad.net/ubuntu/\+source/([-+.0-9a-z]+)/\+bug/\d+",
+' <webpage >suppressions.new
+
+nl -ba suppressions.new
+
+if ! test -s suppressions.new;
+then
+       echo >&2 'NO SUPPRESSIONS - PROBABLY WENT WRONG'
+fi
+
+echo 'uploading'
+
+mv suppressions.new suppressions
+RSYNC_RSH=ssh rsync suppressions cadmium.buildd:adt-play/.
+
+echo 'done.'
index f2f3e5d171c1f7f15e02c3fb8415316c81b5ee19..37c4766ff68b07f91ecefcd857f561576c12e8c0 100755 (executable)
@@ -257,6 +257,12 @@ esac
 
 progress "RESULTS $summary"
 
+if  [ "x$suppresspackages" != x ] \
+ && grep -x "$pkg" "$suppresspackages" >/dev/null; then
+       printf >&3 "email-suppressed "
+       email=''
+fi
+
 if $upload; then
        progress "bundling"
        printf "\n%s\n" "$summary" >>"$tmp"/_summary
@@ -270,7 +276,7 @@ if $upload; then
        elif $suppressrepeatedemails \
          && [ -f "$esummary" ] \
          && diff -u "$esummary" "$tmp"/_summary >"$var"/emailed/diff-$pkg; then
-               printf >&3 "email-suppressed $email "
+               printf >&3 "email-same $email "
                email=''
                esummary=''
        else
@@ -296,11 +302,16 @@ if [ "x$email" != x ]; then
        progress "contacting $email"
        eval "email_addr=\$$email"
        printf >&3 "email \"%s\" " "$email_addr"
-       cat >"$tmp"/_email <<END
+       cat >"$tmp"/_email_header <<END
 From: $from
 To: $email_addr
 Subject: autopkgtest $distro $desc: $summary
 
+END
+
+       printf >"$tmp"/_email "$email_package_header" "$pkg"
+
+       cat >>"$tmp"/_email <<END
  Test executed for:  $distro  $target  $pkg
  Outcome: $summary
 END
@@ -314,14 +325,14 @@ END
                pMaintainer)
                        cat >>"$tmp"/_email <<END
  You are listed in the Maintainer field of the $pkg package in $distro
 and the test results appear to indicate a problem with the package.
+ and the test results appear to indicate a problem with the package.
 END
                        ;;
                maintainer_email_override)
                        cat >>"$tmp"/_email <<END
  The test results appear to indicate a problem with the package
 and reports for package maintainers for $distro are being directed to
 $maintainer_email_override
+ and reports for package maintainers for $distro are being directed to
+ $maintainer_email_override
 END
                        ;;
                administrator_email)
@@ -341,7 +352,7 @@ failures, can be found below.  However, in case this is not
 sufficient, another copy can be found along with output files, saved
 temporary files, and so on, at:
  $desthttphead/$destdirfin/
-
+$email_extra_info
 If you have any questions about this service please contact me at:
  $from
 
@@ -371,6 +382,17 @@ if [ "x$email" = x ]; then
        fi
 else
        cat >>"$tmp"/_email 2>&1 "$tmp"/_log ||:
+
+       if [ "x$email_signing_key" != x ]; then
+               printf >&3 "signing "
+               echo >>"$tmp/_email"
+               gpg -u"$email_signing_key" --clearsign \
+                       <"$tmp/_email" >"$tmp/_email.asc"
+               mv -f "$tmp/_email.asc" "$tmp/_email"
+       fi
+       cat "$tmp/_email_header" "$tmp/_email" >"$tmp/_email.new"
+       mv -f "$tmp/_email.new" "$tmp/_email"
+
        if $interactive; then
                cat "$tmp"/_email >&2
        else