[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fedora-buildsys-list
Subject:    [koji patch] koji-shadow - show top broken packages instead of top brokendep packages
From:       Karsten Hopp <karsten () redhat ! com>
Date:       2013-02-28 16:38:54
Message-ID: 512F94EB.80206 () redhat ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Currently koji-shadows prints out the top 5 brokendep packages, which is kind of useless 
as they don't need fixing.
With this patchit prints out the top 10 broken packages, sorted by the number of packages 
they are blocking from being built.
Secondary arch maintainers will know immediately which packages they should probably fix 
first without having to trace them down in the output.

     Karsten


[Attachment #5 (text/html)]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font size="+1"><font size="+1">C</font>urrently koji-shadows prints
      out the top 5 brokendep packages, which is kind of useless as they
      don't need fixing.<br>
      <font size="+1"><font size="+1">With <font size="+1">t</font></font>his
        pa<font size="+1">tch<font size="+1"> it prints out the top 10
            broken packages, sorted by the num<font size="+1">ber of
              packages they are blocking from being built.<br>
              <font size="+1">Secondary arch maintainers will know
                immediately which packages they should <font size="+1">probably
                  fix firs<font size="+1">t without <font size="+1">having
                      to trace them down in the \
output.</font></font></font></font></font></font></font></font><br>  <br>
      <font size="+1">    Karsten</font><br>
      <br>
    </font>
  </body>
</html>


["0001-report-top-broken-packages-instead-of-top-brokendeps.patch" (text/x-patch)]

From 05ee21f0defa08dd128e609926672b2cec96e53a Mon Sep 17 00:00:00 2001
From: Karsten Hopp <karsten@redhat.com>
Date: Thu, 28 Feb 2013 17:54:22 +0100
Subject: [PATCH] report top broken packages instead of top brokendeps

---
 util/koji-shadow | 44 +++++++++++++++++++++++++++++++++++---------
 1 file changed, 35 insertions(+), 9 deletions(-)

diff --git a/util/koji-shadow b/util/koji-shadow
index 25492d5..e4da04c 100755
--- a/util/koji-shadow
+++ b/util/koji-shadow
@@ -1084,17 +1084,21 @@ class BuildTracker(object):
         return task_id
 
     def report(self):
+        brokenpackage = {}
+        thispackageblocks = {}
         print "-- %s --" % time.asctime()
         self.report_brief()
         for state in ('broken', 'noroot', 'blocked'):
             builds = self.state_idx[state].values()
             not_replaced = [b for b in builds if not b.substitute]
             n_replaced = len(builds) - len(not_replaced)
-            print "%s: %i (+%i replaced)" % (state, len(not_replaced), n_replaced)
             if not_replaced and len(not_replaced) < 8:
                 print '', ' '.join([b.nvr for b in not_replaced])
-        #generate a report of the most frequent problem deps
-        problem_counts = {}
+            for b in not_replaced:
+                if not b.nvr in brokenpackage:
+                    brokenpackage.update({b.nvr:[b.nvr]})
+                else:
+                    brokenpackage[b.nvr].append(b.nvr)
         for build in self.state_idx['brokendeps'].values():
             for dep_id in build.deps:
                 dep = self.builds.get(dep_id)
@@ -1115,15 +1119,37 @@ class BuildTracker(object):
                         continue
                     #otherwise the substitution is the problem
                     nvr = dep.substitute
-                problem_counts.setdefault(nvr, 0)
-                problem_counts[nvr] += 1
-        order = [(c, nvr) for (nvr, c) in problem_counts.iteritems()]
+                if dep.state == 'broken':
+                    brokenpackage[dep.nvr].append(build.nvr)
+                elif dep.state == 'brokendeps':
+                    found = 0;
+                    for i in brokenpackage:
+                        if dep.nvr in brokenpackage[i]:
+                           brokenpackage[i] += [build.nvr]
+                           found = 1
+                    if found == 0:
+                        if not dep.nvr in thispackageblocks:
+                            thispackageblocks.update({dep.nvr:[build.nvr]})
+                        else:
+                            thispackageblocks[dep.nvr].append(build.nvr)
+        # group all brokendeps
+        for package in thispackageblocks:
+            for blockedpackage in thispackageblocks:
+                if package in thispackageblocks[blockedpackage]:
+                   thispackageblocks[blockedpackage] += thispackageblocks[package]
+        for package in thispackageblocks:
+            for blockedpackage in brokenpackage:
+                if package in brokenpackage[blockedpackage]:
+                    brokenpackage[blockedpackage] += thispackageblocks[package]
+        for package in brokenpackage:
+# Remove duplicates, use 'set' as order isn't important:
+            brokenpackage[package] = set(brokenpackage[package])
+        order = [(len(c), nvr) for (nvr, c) in brokenpackage.iteritems()]
         if order:
             order.sort()
             order.reverse()
-            #print top 5 problems
-            print "-- top problems --"
-            for (c, nvr) in order[:5]:
+            print "-- top broken packages --"
+            for (c, nvr) in order[:10]:
                 print " %s (%i)" % (nvr, c)
 
     def report_brief(self):
-- 
1.8.1.2


[Attachment #7 (text/plain)]

--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic