From: Ian Jackson Date: Tue, 28 Aug 2007 16:09:41 +0000 (+0100) Subject: * adt-testreport-onepackage: support for Launchpad bug filing X-Git-Tag: converted-from-bzr~39 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5c51dce76fad4e30d23e5c41c99bd1b01cdeec95;p=autopkgtest.git * 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/.bzrignore b/.bzrignore index feb11fb..df38628 100644 --- a/.bzrignore +++ b/.bzrignore @@ -5,3 +5,6 @@ debian/tmp debian/files xen/sed-readconfig xen/readconfig +hosts/chinstrap/webpage +hosts/chinstrap/suppressions +hosts/chinstrap/suppressions.new diff --git a/debian/changelog b/debian/changelog index db03637..3a3c4d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 index c636269..0000000 --- a/hosts/cadmium/adt-sendto-launchpad +++ /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 index 0000000..bc1aa6e --- /dev/null +++ b/hosts/cadmium/install-on-cadmium @@ -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 index 0000000..c25842f --- /dev/null +++ b/hosts/cadmium/manual-test-one-source @@ -0,0 +1,7 @@ +#!/bin/sh +# usage: .../manual-test-one-source +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 diff --git a/hosts/cadmium/onepackage-config b/hosts/cadmium/onepackage-config index a99e8d0..aa747db 100644 --- a/hosts/cadmium/onepackage-config +++ b/hosts/cadmium/onepackage-config @@ -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 " +from="$salutation Jackson " 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 index 0000000..f716f26 --- /dev/null +++ b/hosts/chinstrap/crontab @@ -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 index 0000000..189ff1c --- /dev/null +++ b/hosts/chinstrap/install-on-chinstrap @@ -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 index 0000000..601c4cf --- /dev/null +++ b/hosts/chinstrap/update-suppressions @@ -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+", +' 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.' diff --git a/runner/adt-testreport-onepackage b/runner/adt-testreport-onepackage index f2f3e5d..37c4766 100755 --- a/runner/adt-testreport-onepackage +++ b/runner/adt-testreport-onepackage @@ -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 <"$tmp"/_email_header <"$tmp"/_email "$email_package_header" "$pkg" + + cat >>"$tmp"/_email <>"$tmp"/_email <>"$tmp"/_email <>"$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