status-report-scripts parseBZbugList,1.19,1.20

Christian Iseli (c4chris) fedora-extras-commits at redhat.com
Wed Apr 19 10:10:09 UTC 2006


Author: c4chris

Update of /cvs/fedora/status-report-scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4333

Modified Files:
	parseBZbugList 
Log Message:
Add more maintainer info.


Index: parseBZbugList
===================================================================
RCS file: /cvs/fedora/status-report-scripts/parseBZbugList,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- parseBZbugList	19 Apr 2006 10:09:12 -0000	1.19
+++ parseBZbugList	19 Apr 2006 10:10:06 -0000	1.20
@@ -45,6 +45,7 @@
 my $FE_ACCEPT = 163779;
 my $FE_NEEDSPONSOR = 177841;
 my $FE_LEGAL = 182235;
+my $extras_orphan = 'extras-orphan at fedoraproject.org';
 my %BZN;
 my %BZS;
 my %BZL;
@@ -64,6 +65,7 @@
 my %FC_INTEGRATED;
 my %PKG_LIST;
 my %BUG_LIST;
+my %MAINT_LIST;
 my %OWNER_LIST;
 my %COUNT_LIST;
 my %OWNER_STAT;
@@ -121,6 +123,7 @@
     next if /^#/;
     s/\s+$//;
     my @F = split /\|/;
+    next if $F[1] eq "";
     if (defined $DISCARD{$F[1]}) {
       $DISCARD{$F[1]} += 1;
       next;
@@ -172,7 +175,7 @@
   while ( <IN> ) {
     s/\s+$//;
     $COUNT_LIST{"CVS"} += 1;
-    next if defined $OWN{$_};
+    next if defined($OWN{$_}) || defined($DISCARD{$_});
     $CVS_NO_OWNER{$_} = 1;
   }
   close IN;
@@ -293,8 +296,9 @@
 &checkLowActivity(\%BZS, "FE-NEEDSPONSOR");
 &countOpen(\%BZL, "FE-LEGAL");
 &checkLowActivity(\%BZL, "FE-LEGAL");
-&checkLowCVSActivity();
 &checkLowActivity(\%BZB, "OPEN-BUGS");
+&checkBugs(\%BZB);
+&checkMaintainers();
 print "[[TableOfContents]]\n\n= FE Package Status of ",
   &UnixDate("today", "%b %e, %Y"), " =\n";
 &displayOwnersWiki;
@@ -305,6 +309,7 @@
 &displayNewReviewWiki(\%BZL, "FE-LEGAL", 5);
 &displayNewReviewWiki(\%BZB, "OPEN-BUGS", 4);
 &displayCVSWiki();
+&displayMaintainersWiki();
 print "----\nCategoryExtras\n";
 print STDERR "\n\nFE Package Status of ",
   &UnixDate("today", "%b %e, %Y"), "\n";
@@ -317,6 +322,7 @@
 &displayNewReviewMail("FE-NEEDSPONSOR");
 &displayNewReviewMail("OPEN-BUGS");
 &displayCVSMail();
+&displayMaintainersMail();
 
 exit 0;
 
@@ -351,24 +357,26 @@
       }
     }
   }
+  $OWNER_STAT{$extras_orphan} = [ 0, 0, 0, 0, {} ];
   foreach my $k (keys %OWN) {
     my $a = $OWN{$k};
     next if $$a[0] ne "Fedora Extras";
     $cnt += 1;
-    if ($$a[3] eq 'extras-orphan at fedoraproject.org') {
-      $orphan += 1;
-      push @OE, $k if defined $EXTRAS{$k};
-      next;
-    }
     my $s = $OWNER_STAT{$$a[3]};
     if (defined $s) {
       $$s[0] += 1;
     } else {
-      # We have pkg_cnt, open_bugs, touched_pkgs
-      $OWNER_STAT{$$a[3]} = [ 1, 0, 0 ];
+      # We have pkg_cnt, open_bugs, touched_pkgs, touched_bugs, bugs_hash
+      $OWNER_STAT{$$a[3]} = [ 1, 0, 0, 0, {} ];
       $s = $OWNER_STAT{$$a[3]};
     }
-    $$s[2] = 1 unless defined $OWN_CVS_RECENT{$k};
+    if ($$a[3] eq $extras_orphan) {
+      $orphan += 1;
+      push @OE, $k if defined $EXTRAS{$k};
+      next;
+    } else {
+      $$s[2] = 1 if defined $OWN_CVS_RECENT{$k};
+    }
     unless (defined $EXTRAS{$k}) {
       if (defined($CORE{$k}) || defined($FC_INTEGRATED{$k})) {
 	push @NPC, $k;
@@ -401,10 +409,9 @@
   print "We have $COUNT_LIST{'owner'} extras packages in owners file.[[BR]]\n";
   print "There are $COUNT_LIST{'orphan'} orphans.\n";
   print "\n=== Top 10 package owners ===\n";
-  my $a = $OWNER_LIST{"package"};
-  &displayOwnerCntWiki($a, \%OWNER_STAT);
+  &displayOwnerCntWiki($OWNER_LIST{"package"}, \%OWNER_STAT, 0);
   print "\n=== Packages not present in the development repo ===\n";
-  $a = $PKG_LIST{"NotDevelNotRel"};
+  my $a = $PKG_LIST{"NotDevelNotRel"};
   if ($#$a >= 0) {
     my $cnt = $#$a + 1;
     print "\nWe have $cnt packages not available in extras devel or release:\n";
@@ -459,15 +466,17 @@
 }
 
 sub displayOwnerCntWiki {
-  my ($a, $c) = @_;
+  my ($a, $c, $aref) = @_;
   for my $i (0 .. 9) {
     my $n = $$a[$i];
     $n =~ s/["]//g;
     $n =~ s/\@/ at /;
     $n =~ s/\./ dot /g;
     my $aa = $c->{$$a[$i]};
-    print "||$n||$$aa[0]||\n";
+    $aa = $$aa[$aref] if defined $aref;
+    print "||$n||$aa||\n";
   }
+  print "\n";
 }
 
 sub displayPkgListByOwnerWiki {
@@ -595,9 +604,9 @@
   print "\n\n=== Package count ===\n";
   print "\nWe have $COUNT_LIST{'acceptedClosed'} accepted, closed package reviews\n";
   print "\n=== Top 10 BZ review requests submitters ===\n";
-  &displayOwnerCntWiki($OWNER_LIST{"BZOwner"}, \%BZOWN_CNT);
+  &displayOwnerCntWiki($OWNER_LIST{"BZOwner"}, \%BZOWN_CNT, undef);
   print "\n=== Top 10 BZ review requests reviewers ===\n";
-  &displayOwnerCntWiki($OWNER_LIST{"BZReviewer"}, \%BZREV_CNT);
+  &displayOwnerCntWiki($OWNER_LIST{"BZReviewer"}, \%BZREV_CNT, undef);
   print "\n\n=== Potential problems ===\n";
   if ($COUNT_LIST{"missing"} > 0) {
     print "\nWe have $COUNT_LIST{'missing'} accepted, closed packages where I'm unable to ",
@@ -674,7 +683,7 @@
 
 sub countOpen {
   my ($BZ, $cur) = @_;
-  foreach my $b (sort(keys %$BZ)) {
+  foreach my $b (keys %$BZ) {
     my $a = $BZ->{$b};
     next if $$a[6] eq "\"CLOSED\"";
     $COUNT_LIST{"open$cur"} += 1;
@@ -879,14 +888,25 @@
   $BUG_LIST{"openInOwners$cur"} = \@BL;
 }
 
-sub checkLowCVSActivity {
+sub checkMaintainers {
   my @PL;
-  foreach my $k (keys %OWN) {
-    next if defined $OWN_CVS_RECENT{$k};
-    push @PL, $k;
+  my @BL;
+  my @O = keys %OWNER_STAT;
+  foreach my $k (@O) {
+    my $a = $OWNER_STAT{$k};
+    #next unless $$a[2] == 0 && $$a[3] == 0;
+    next unless $$a[2] == 0;
+    if ($$a[1] > 0) {
+      push @BL, $k;
+    } else {
+      push @PL, $k;
+    }
   }
-  $COUNT_LIST{"lowCVSActivity"} = $#PL + 1;
-  $PKG_LIST{"lowCVSActivity"} = \@PL;
+  $MAINT_LIST{"bugs"} = \@BL;
+  $MAINT_LIST{"packages"} = \@PL;
+  $COUNT_LIST{'maintainers'} = $#O + 1;
+  $COUNT_LIST{'maintbugs'} = $#BL + 1;
+  $COUNT_LIST{'maintpkg'} = $#PL + 1;
 }
 
 sub displayCVSWiki {
@@ -900,12 +920,6 @@
     print "\nWe have $cnt packages in CVS with no owners entry:{{{\n";
     print join("\n", @A), "}}}\n";
   }
-  if ($COUNT_LIST{"lowCVSActivity"} > 0) {
-    print "\n=== Packages not touched in the last 12 weeks ===\n";
-    print "\nWe have $COUNT_LIST{'lowCVSActivity'} packages with no CVS ",
-      "activity in the last 12 weeks:\n";
-    &displayPkgListByOwnerWiki($PKG_LIST{"lowCVSActivity"});
-  }
 }
 
 sub displayCVSMail {
@@ -916,8 +930,80 @@
     my $cnt = $#A + 1;
     print STDERR " - $cnt packages with no owners entry\n";
   }
-  if ($COUNT_LIST{"lowCVSActivity"} > 0) {
-    print STDERR " - $COUNT_LIST{'lowCVSActivity'} packages with no CVS ",
-      "activity in the last 12 weeks\n";
+}
+
+sub checkBugs {
+  my ($BZ) = @_;
+  foreach my $b (keys %$BZ) {
+    my $a = $BZ->{$b};
+    my $assignee = $$a[4];
+    $assignee =~ s/["]//g;
+    my $s = $OWNER_STAT{$assignee};
+    unless (defined $s) {
+      my $o = $OWN{$$a[10]};
+      print STDERR "Change $assignee to $$o[3]\n";
+      $s = $OWNER_STAT{$$o[3]};
+    }
+    die "Couldn't find OWNER_STAT for $assignee $$a[10]" unless defined $s;
+    $$s[1] += 1;
+    if (Date_Cmp($$a[2], $eightWeeksAgo) >= 0) {
+      $$s[3] = 1;
+    }
+    $$s[4]->{$b} = $a;
+  }
+  my @TO = sort {
+    my $ca = $OWNER_STAT{$a};
+    my $cb = $OWNER_STAT{$b};
+    $$cb[1] <=> $$ca[1];
+  } keys %OWNER_STAT;
+  $OWNER_LIST{"bugs"} = \@TO;
+}
+
+sub displayMaintainersWiki {
+  print "== About maintainers ==\n\n";
+  print "=== Maintainers count ===\n\n";
+  print "We have $COUNT_LIST{'maintainers'} maintainers in owners file.[[BR]]\n";
+  print "\n=== Top 10 bugs assignees ===\n";
+  &displayOwnerCntWiki($OWNER_LIST{"bugs"}, \%OWNER_STAT, 1);
+  if ($COUNT_LIST{'maintbugs'} > 0) {
+    print "=== Inactive maintainers with open bug reports ===\n\n";
+    print "We have $COUNT_LIST{'maintbugs'} maintainers with open bugs that ",
+      "have had no noticeable CVS activity in the last 12 weeks\n";
+    my $a = $MAINT_LIST{"bugs"};
+    foreach my $k (sort @$a) {
+      my $e = $OWNER_STAT{$k};
+      my $bugs = $$e[4];
+      my @K = keys %$bugs;
+      &displayBLWiki(\@K, $bugs, 4);
+    }
+  }
+  if ($COUNT_LIST{'maintpkg'} > 0) {
+    print "=== Inactive maintainers ===\n\n";
+    print "We have $COUNT_LIST{'maintpkg'} maintainers that ",
+      "have had no noticeable CVS activity in the last 12 weeks:\n";
+    my $a = $MAINT_LIST{"packages"};
+    foreach my $k (sort @$a) {
+      my $n = $k;
+      $n =~ s/\@/ at /;
+      $n =~ s/\./ dot /g;
+      foreach my $o (keys %OWN) {
+	my $e = $OWN{$o};
+	next unless $$e[3] eq $k;
+	print "||$n||$o||\n";
+      }
+    }
+    print "\n";
+  }
+}
+
+sub displayMaintainersMail {
+  print STDERR "\nMaintainers stats:\n";
+  print STDERR " - $COUNT_LIST{'maintainers'} maintainers\n";
+  if ($COUNT_LIST{'maintbugs'} > 0) {
+    print STDERR " - $COUNT_LIST{'maintbugs'} inactive maintainers with ",
+      "open bugs\n";
+  }
+  if ($COUNT_LIST{'maintpkg'} > 0) {
+    print STDERR " - $COUNT_LIST{'maintpkg'} inactive maintainers\n";
   }
 }




More information about the fedora-extras-commits mailing list