[151771] contrib/buildbot-test/master.cfg

mojca at macports.org mojca at macports.org
Sun Aug 21 15:04:18 PDT 2016


Revision: 151771
          https://trac.macports.org/changeset/151771
Author:   mojca at macports.org
Date:     2016-08-21 15:04:18 -0700 (Sun, 21 Aug 2016)
Log Message:
-----------
buildbot: parse maintainers of failed ports

Modified Paths:
--------------
    contrib/buildbot-test/master.cfg

Modified: contrib/buildbot-test/master.cfg
===================================================================
--- contrib/buildbot-test/master.cfg	2016-08-21 21:52:43 UTC (rev 151770)
+++ contrib/buildbot-test/master.cfg	2016-08-21 22:04:18 UTC (rev 151771)
@@ -513,16 +513,19 @@
         text.append("Subport list:\n\t- {:s}".format(build.getProperty('subportlist').replace(" ", "\n\t- ")))
         text.append("Variants:     {:s}".format(build.getProperty('variants')))
         text.append("Revision:     {:s}".format(build.getProperty('revision')))
-        #text.append("Time:         {}".format(build.getTimes()[1] - build.getTimes()[0]))
-        text.append(u"Blamelist:    {:s}".format(",".join(build.getResponsibleUsers())))
+        text.append("Build time:   {:.1f} s".format(build.getTimes()[1] - build.getTimes()[0]))
+        text.append(u"Committer:    {:s}".format(",".join(build.getResponsibleUsers())))
 
         text.append("\nLog from failed builds:")
         summary_step = [x for x in build.getSteps() if x.getName() == "summary"][0]
         summary_log  = [x for x in summary_step.getLogs() if x.getName() == "stdio"][0]
-        failed_ports_set = set()
-        pattern = re.compile("^Building '(?P<port>.*?)'.*?(\(failed to install dependency '(?P<dependency>.*?)'\))?$")
+        failed_ports = set()
+        maintainers_to_notify = set()
+        pattern = re.compile("^Building '(?P<port>.*?)'.*?(\(failed to install dependency '(?P<dependency>.*?)'\))?( maintainers: (?P<maintainers>.*?)[.])?$")
         # iterate through all the ports being built
         for line in summary_log.getText().splitlines():
+            line = line.replace(';', '@')
+            text.append("\t" + line.replace(" maintainers:", "\n\t> maintainers:"))
             # in case of a build error, print the error and add the broken port(s) to the list
             if 'ERROR' in line:
                 text.append("\t" + line)
@@ -531,13 +534,17 @@
                     for key in ['port', 'dependency']:
                         port = match.groupdict().get(key)
                         if port:
-                            failed_ports_set.add(port)
-        failed_ports = sorted(failed_ports_set)
-        text.append("\nBroken ports:\n\t- {:s}".format("\n\t- ".join(failed_ports)))
+                            failed_ports.add(port)
+                    maintainers = match.groupdict().get('maintainers')
+                    if maintainers:
+                        for maintainer in maintainers.split(','):
+                            maintainers_to_notify.add(maintainer)
+        if len(failed_ports) > 0:
+            text.append("\nBroken ports:\n\t- {:s}".format("\n\t- ".join(sorted(failed_ports))))
 
         maintainers_to_notify = list()
-        # TODO
-        text.append("\nResponsible maintainers:\n\t(is there a way to create the list without installing MacPorts to the server?)")
+        if len(maintainers_to_notify) > 0:
+            text.append("\nResponsible maintainers:\n\t- {}".format("\n\t- ".join(sorted(maintainers_to_notify))))
 
         # links to individual builds
         text.append("\nLinks to individual build jobs:")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160821/b674f99d/attachment-0001.html>


More information about the macports-changes mailing list