autobuild: send email failure if rebase fails
authorAndrew Tridgell <tridge@samba.org>
Tue, 12 Oct 2010 02:06:43 +0000 (13:06 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 12 Oct 2010 02:53:15 +0000 (02:53 +0000)
users need to know if the rebase on master fails

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Oct 12 02:53:15 UTC 2010 on sn-devel-104

script/autobuild.py

index fe0c1e2b3aada0b95db3a44e25f839338eb7145c..6691437c2331a1b4f2ba7bd6da4d7156a1bb6c14 100755 (executable)
@@ -341,15 +341,18 @@ Your autobuild failed when trying to test %s with the following error:
 
 the autobuild has been abandoned. Please fix the error and resubmit.
 
+A summary of the autobuild process is here:
+
+  http://git.samba.org/%s/samba-autobuild/autobuild.log
+''' % (failed_task, errstr, user)
+    
+    if failed_task != 'rebase':
+        text += '''
 You can see logs of the failed task here:
 
   http://git.samba.org/%s/samba-autobuild/%s.stdout
   http://git.samba.org/%s/samba-autobuild/%s.stderr
 
-A summary of the autobuild process is here:
-
-  http://git.samba.org/%s/samba-autobuild/autobuild.log
-
 or you can get full logs of all tasks in this job here:
 
   http://git.samba.org/%s/samba-autobuild/logs.tar.gz
@@ -358,7 +361,7 @@ The top commit for the tree that was built was:
 
 %s
 
-''' % (failed_task, errstr, user, failed_tag, user, failed_tag, user, user, top_commit_msg)
+''' % (user, failed_tag, user, failed_tag, user, top_commit_msg)
     msg = MIMEText(text)
     msg['Subject'] = 'autobuild failure for task %s during %s' % (failed_task, failed_stage)
     msg['From'] = 'autobuild@samba.org'
@@ -442,10 +445,14 @@ while True:
         raise
 
     try:
-        if options.rebase is not None:
-            rebase_tree(options.rebase)
-        elif options.rebase_master:
-            rebase_tree(samba_master)
+        try:
+            if options.rebase is not None:
+                rebase_tree(options.rebase)
+            elif options.rebase_master:
+                rebase_tree(samba_master)
+        except:
+            email_failure(-1, 'rebase', 'rebase', 'rebase', 'rebase on master failed')
+            sys.exit(1)
         blist = buildlist(tasks, args)
         if options.tail:
             blist.start_tail()