[gnome-ostree] bot: Add the latest failed build to the status message



commit 02f62d29b077edf701dd90fc964d7e29a4e02a1e
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Nov 2 13:18:51 2012 -0400

    bot: Add the latest failed build to the status message

 qa/supybot/GNOMEOSTree/plugin.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/qa/supybot/GNOMEOSTree/plugin.py b/qa/supybot/GNOMEOSTree/plugin.py
index 51cf7dc..be02b8c 100644
--- a/qa/supybot/GNOMEOSTree/plugin.py
+++ b/qa/supybot/GNOMEOSTree/plugin.py
@@ -68,11 +68,19 @@ class GNOMEOSTree(callbacks.Plugin):
                 self._broadcast("No builds")
             return
         latest = None
+        latest_failed = None
+        # find the first successful build
         for build in reversed(builds):
             if build['state'] == 'running':
                 continue
             latest = build
             break
+        # find the first failed build
+        for build in reversed(builds):
+            if build['state'] != 'failed':
+                continue
+            latest_failed = build
+            break
         version = latest['meta']['version']
         version_matches = version == self._last_version
         if (not status and version_matches):
@@ -86,7 +94,10 @@ class GNOMEOSTree(callbacks.Plugin):
             if status and builds[-1]['state'] == 'running':
                 building = builds[-1]
                 msg = "Active build: %s; %s" % (building['build-status']['description'], msg)
-        msg += " %s: %s." % (version, latest['state'])
+        if latest['state'] == 'failed' and latest['meta']['version'] != latest_failed['meta']['version']:
+            msg += " %s: %s (fails since: %s)." % (version, latest['state'], latest_failed['meta']['version'])
+        else:
+            msg += " %s: %s." % (version, latest['state'])
         diff = latest['diff']
         if len(diff[0]) > 0:
             msg += " Latest added modules: %s." % (', '.join(diff[0]), )



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]