Minor fixes for the buildbot-side warning parser step:
authorBenjamin Smedberg <benjamin@smedbergs.us>
Wed, 10 Dec 2008 12:30:50 -0500
changeset 6 03664a1472ce
parent 5 79214df79809
child 7 c77013199a86
push id3
push userbsmedberg@mozilla.com
push date2008-12-10 20:06 +0000
Minor fixes for the buildbot-side warning parser step: * link to cvsblame.cgi, not cvslog. * keep a running total of new warnings and print this to the tinderbox summary * fix line/lineno variable confusion
warningstep.py
--- a/warningstep.py
+++ b/warningstep.py
@@ -137,41 +137,47 @@ class WarningParserStep(ShellCommand):
                            FROM warnings
                            WHERE buildnumber = ? AND
                              NOT EXISTS (SELECT *
                                          FROM warnings AS oldwarnings
                                          WHERE oldwarnings.signature = warnings.signature AND
                                            oldwarnings.buildnumber = ?)''', (buildnumber, prevbuildnumber))
             cur2 = db.cursor()
 
+            wnewcount = 0
+
             for signature, in cur:
+                wnewcount = wnewcount + 1
                 cur2.execute('''SELECT file, lineno, msg, blametype, blamefile, blamerev, blameline, blamewho
                                 FROM wlines
                                 WHERE buildnumber = ? AND signature = ?
                                 ORDER BY wline''',
                              (buildnumber, signature))
                 comparison.append('NEW WARNING:')
 
                 for file, lineno, msg, blametype, blamefile, blamerev, blameline, blamewho in cur2:
                     out = "  %s" % file
-                    if line is not None:
+                    if lineno is not None:
                         out += ":%i" % lineno
 
                     out += ": %s" % msg
 
                     if blamewho is not None:
                         out += ' - Blamed on %s' % blamewho
 
                     if blametype == 'cvs':
-                        out += ' -  http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/%s&rev=HG_REPO_INITIAL_IMPORT&mark=%s#%s' % (blamefile, blameline, blameline)
+                        out += ' -  http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/%s&rev=HG_REPO_INITIAL_IMPORT&mark=%s#%s' % (blamefile, blameline, blameline)
                     elif blametype == 'hg':
                         out += ' - http://hg.mozilla.org/mozilla-central/annotate/%s/%s#l%i' % (blamerev, blamefile, blameline)
 
                     comparison.append(out)
 
+        if wnewcount > 0:
+            comparison.append("TinderboxPrint:warn-new:%i" % wnewcount)
+
         self.addCompleteLog('comparison', '\n'.join(comparison))
 
         cur.close()
         db.close()
 
     def evaluateCommand(self, cmd):
         if cmd.rc != 0:
             return FAILURE