status-report-scripts parseBZbugList,1.14,1.15
Christian Iseli (c4chris)
fedora-extras-commits at redhat.com
Wed Apr 19 10:06:01 UTC 2006
Author: c4chris
Update of /cvs/fedora/status-report-scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4103
Modified Files:
parseBZbugList
Log Message:
Add CVS and open bugs checks.
Index: parseBZbugList
===================================================================
RCS file: /cvs/fedora/status-report-scripts/parseBZbugList,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- parseBZbugList 19 Apr 2006 10:05:01 -0000 1.14
+++ parseBZbugList 19 Apr 2006 10:05:58 -0000 1.15
@@ -1,6 +1,11 @@
#!/usr/bin/env perl
# $Id$
+# Grab BZ tickets through:
+# https://bugzilla.redhat.com/bugzilla/showdependencytree.cgi?id=FE-NEW
+# https://bugzilla.redhat.com/bugzilla/showdependencytree.cgi?id=FE-REVIEW
+# https://bugzilla.redhat.com/bugzilla/showdependencytree.cgi?id=FE-ACCEPT
+
# TODO stuff
use strict;
@@ -9,7 +14,7 @@
my %opt;
my @options = ( "help", "core=s", "extras=s", "bzid=s", "o=s", "d=s",
- "extras_r=s" );
+ "extras_r=s", "cvs=s" );
$main::core
= "http://mirrors.kernel.org/fedora/core/development/SRPMS/";
@@ -21,6 +26,7 @@
= "http://fedoraproject.org/wiki/Extras/PackagesNoLongerInDevel";
$main::bzid
= "http://fedoraproject.org/wiki/Extras/UsefulScripts?action=AttachFile&do=get&target=bzId_pkg.txt";
+$main::cvsDir = "/export/scratch/extras";
if( ! GetOptions( \%opt, @options ) ) { &usage(); }
@@ -30,6 +36,7 @@
$main::extras_r = $opt{"extras_r"} if defined $opt{"extras_r"};
$main::discarded = $opt{"d"} if defined $opt{"d"};
$main::bzid = $opt{"bzid"} if defined $opt{"bzid"};
+$main::cvsDir = $opt{"cvs"} if defined $opt{"cvs"};
&usage() if defined $opt{'help'};
@@ -41,6 +48,7 @@
my %BZS;
my %BZR;
my %BZA;
+my %BZB;
my %CORE;
my %EXTRAS;
my %EXTRAS_R;
@@ -48,6 +56,8 @@
my %NAME;
my %OWN;
my %OWN_DUP;
+my %OWN_CVS_RECENT;
+my %CVS_NO_OWNER;
my %DISCARD;
my %FC_INTEGRATED;
my %PKG_LIST;
@@ -134,6 +144,34 @@
foreach my $k (keys %CORE) {
$SRPMS{$k} = 1;
}
+# Take a look at CVS stuff
+if (-d $main::cvsDir) {
+ $main::cvsDir =~ s/\/+$//;
+ my $f = "/tmp/tstmp_$$";
+ system "touch -d '12 weeks ago' $f";
+ my $cmd = "find $main::cvsDir -name CVS -prune -o -type f -newer $f -print "
+ . "| sed 's|^$main::cvsDir/||;s|/.*||'|sort -u";
+ local *IN;
+ open IN, "$cmd |" or die "Couldn't launch find command in CVS: $!";
+ while ( <IN> ) {
+ s/\s+$//;
+ next unless defined $OWN{$_};
+ $OWN_CVS_RECENT{$_} = 1;
+ }
+ close IN;
+ unlink $f;
+ my @PL;
+ $cmd = "find $main::cvsDir -type d -name devel -print "
+ . "| sed 's|^$main::cvsDir/||;s|/.*||'";
+ open IN, "$cmd |" or die "Couldn't launch find command in CVS: $!";
+ while ( <IN> ) {
+ s/\s+$//;
+ $COUNT_LIST{"CVS"} += 1;
+ next if defined $OWN{$_};
+ $CVS_NO_OWNER{$_} = 1;
+ }
+ close IN;
+}
while ( <> ) {
s/[,\n]+$//;
my @F = split /,/;
@@ -153,33 +191,36 @@
if ($F[0] ne "bug_id"
|| $F[1] ne "\"opendate\""
|| $F[2] ne "\"changeddate\""
- || $F[3] ne "\"assigned_to\""
- || $F[4] ne "\"reporter\""
- || $F[5] ne "\"bug_status\""
- || $F[6] ne "\"resolution\""
- || $F[7] ne "\"blockedby\""
- || $F[8] ne "\"short_desc\"") {
+ || $F[3] ne "\"bug_severity\""
+ || $F[4] ne "\"assigned_to\""
+ || $F[5] ne "\"reporter\""
+ || $F[6] ne "\"bug_status\""
+ || $F[7] ne "\"resolution\""
+ || $F[8] ne "\"component\""
+ || $F[9] ne "\"blockedby\""
+ || $F[10] ne "\"short_desc\"") {
die "Bad header: $_";
}
next;
}
- $F[7] =~ s/["{}]//g;
+ $F[9] =~ s/["{}]//g;
$F[1] =~ s/["]//g;
$F[2] =~ s/["]//g;
+ $F[8] =~ s/["]//g;
$F[1] = ParseDate($F[1]);
$F[2] = ParseDate($F[2]);
- my @B = split /,/, $F[7];
- next if $F[8] =~ /TESTING-BUGSPAM/;
- $F[9] = $F[8];
- $F[9] =~ s/^["]+//;
- $F[9] =~ s/["]+$//;
+ my @B = split /,/, $F[9];
+ next if $F[10] =~ /TESTING-BUGSPAM/;
+ $F[11] = $F[10];
+ $F[11] =~ s/^["]+//;
+ $F[11] =~ s/["]+$//;
if (defined $NAME{$F[0]}) {
- $F[8] = $NAME{$F[0]};
- } else {
+ $F[10] = $NAME{$F[0]};
+ } elsif ($F[8] eq "Package Review") {
# Try to guess package name
- $F[8] =~ s/["]//g;
- $F[8] =~ s/^review\s+request:?\s+<?//i;
- $F[8] =~ s/[:.,>]?\s.*$//g;
+ $F[10] =~ s/["]//g;
+ $F[10] =~ s/^review\s+request:?\s+<?//i;
+ $F[10] =~ s/[:.,>]?\s.*$//g;
}
my $block = 0;
my $sponsor = 0;
@@ -210,7 +251,14 @@
if ($sponsor == 1 && $bzb == \%BZN) {
$BZS{$F[0]} = \@F;
}
+ next;
}
+ if (defined $OWN{$F[8]}) {
+ $COUNT_LIST{"openOPEN-BUGS"} += 1;
+ $BZB{$F[0]} = \@F;
+ next;
+ }
+ print STDERR "Not handled: ", join(" ", @F), "\n";
}
&checkOpenInOwners(\%BZR, "FE-REVIEW");
&checkOpenInOwners(\%BZN, "FE-NEW");
@@ -229,6 +277,8 @@
#&checkNoActivity(\%BZN, "FE-NEW");
&countOpen(\%BZS, "FE-NEEDSPONSOR");
&checkLowActivity(\%BZS, "FE-NEEDSPONSOR");
+&checkLowCVSActivity();
+&checkLowActivity(\%BZB, "OPEN-BUGS");
print "[[TableOfContents]]\n\n= FE Package Status of ",
&UnixDate("today", "%b %e, %Y"), " =\n";
&displayOwnersWiki;
@@ -236,6 +286,8 @@
&displayNewReviewWiki(\%BZR, "FE-REVIEW");
&displayNewReviewWiki(\%BZN, "FE-NEW");
&displayNewReviewWiki(\%BZS, "FE-NEEDSPONSOR");
+&displayNewReviewWiki(\%BZB, "OPEN-BUGS");
+&displayCVSWiki();
print "----\nCategoryExtras\n";
print STDERR "\n\nFE Package Status of ",
&UnixDate("today", "%b %e, %Y"), "\n";
@@ -246,6 +298,8 @@
&displayNewReviewMail("FE-REVIEW");
&displayNewReviewMail("FE-NEW");
&displayNewReviewMail("FE-NEEDSPONSOR");
+&displayNewReviewMail("OPEN-BUGS");
+&displayCVSMail();
exit 0;
@@ -455,27 +509,27 @@
my @BLO;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next unless $$a[5] eq "\"CLOSED\"";
- my $pkg = $$a[8];
+ next unless $$a[6] eq "\"CLOSED\"";
+ my $pkg = $$a[10];
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
$pkg =~ s/-[^-]+-[^-]+$//;
}
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
- $pkg = $$a[8];
+ $pkg = $$a[10];
$pkg =~ s/-[^-]+$//;
}
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
- $pkg = lc $$a[8];
+ $pkg = lc $$a[10];
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
$pkg =~ s/-[^-]+-[^-]+$//;
}
}
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
- $pkg = lcfirst $$a[8];
+ $pkg = lcfirst $$a[10];
}
if ($SRPMS{$pkg} == 1) {
- $BZREV_CNT{$$a[3]} += 1;
- $BZOWN_CNT{$$a[4]} += 1;
+ $BZREV_CNT{$$a[4]} += 1;
+ $BZOWN_CNT{$$a[5]} += 1;
$COUNT_LIST{"acceptedClosed"} += 1;
if (!defined($CORE{$pkg}) && !defined($OWN{$pkg})) {
push @BLO, $b;
@@ -488,8 +542,8 @@
$COUNT_LIST{"missing"} += 1;
}
if (defined $OWN{$pkg}) {
- $BZREV_CNT{$$a[3]} += 1;
- $BZOWN_CNT{$$a[4]} += 1;
+ $BZREV_CNT{$$a[4]} += 1;
+ $BZOWN_CNT{$$a[5]} += 1;
$COUNT_LIST{"acceptedClosed"} += 1;
} else {
push @BLO, $b;
@@ -567,13 +621,13 @@
my @LATE;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next if $$a[5] eq "\"CLOSED\"";
- my $pkg = $$a[8];
+ next if $$a[6] eq "\"CLOSED\"";
+ my $pkg = $$a[10];
unless ($SRPMS{$pkg} == 1) {
- $pkg = lc $$a[8];
+ $pkg = lc $$a[10];
}
unless ($SRPMS{$pkg} == 1) {
- $pkg = lcfirst $$a[8];
+ $pkg = lcfirst $$a[10];
}
if ($SRPMS{$pkg} == 1) {
$COUNT_LIST{"acceptOpenInDevel"} += 1;
@@ -592,7 +646,7 @@
my ($BZ, $cur) = @_;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next if $$a[5] eq "\"CLOSED\"";
+ next if $$a[6] eq "\"CLOSED\"";
$COUNT_LIST{"open$cur"} += 1;
}
}
@@ -602,7 +656,7 @@
my @BL;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next unless $$a[5] eq "\"CLOSED\"";
+ next unless $$a[6] eq "\"CLOSED\"";
push @BL, $b;
}
$COUNT_LIST{"closed$cur"} = $#BL + 1;
@@ -615,7 +669,7 @@
my @LATE;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next if $$a[5] eq "\"CLOSED\"";
+ next if $$a[6] eq "\"CLOSED\"";
if (Date_Cmp($$a[2], $fourWeeksAgo) < 0) {
if (Date_Cmp($$a[2], $eightWeeksAgo) < 0) {
push @LATE, $b;
@@ -635,7 +689,7 @@
# my @BL;
# foreach my $b (sort(keys %$BZ)) {
# my $a = $BZ->{$b};
-# next if $$a[5] eq "\"CLOSED\"";
+# next if $$a[6] eq "\"CLOSED\"";
# next if $$a[1] ne $$a[2];
# if (Date_Cmp($$a[2], $eightWeeksAgo) < 0) {
# push @BL, $b;
@@ -662,7 +716,8 @@
[$main::core]
-d <url> list of migrated/discarded packages
[$main::discarded]
- -o <file> owners.list file\n";
+ -o <file> owners.list file
+ -cvs <dir> extras CVS directory [$main::cvsDir]\n";
exit 1;
}
@@ -703,8 +758,8 @@
join(",", @$BL), "\n";
foreach my $b (@$BL) {
my $a = $BZ->{$b};
- my ($owner) = $$a[4] =~ /^.([^@]+)/;
- printf " %-40s %s\n", $$a[8], $owner;
+ my ($owner) = $$a[5] =~ /^.([^@]+)/;
+ printf " %-40s %s\n", $$a[10], $owner;
}
}
@@ -713,11 +768,11 @@
my %O;
foreach my $b (@$BL) {
my $a = $BZ->{$b};
- my $e = $O{$$a[4]};
+ my $e = $O{$$a[5]};
if (defined $e) {
push @$e, $a;
} else {
- $O{$$a[4]} = [ $a ];
+ $O{$$a[5]} = [ $a ];
}
}
foreach my $n (sort(keys %O)) {
@@ -726,9 +781,9 @@
$n =~ s/\@/ at /;
$n =~ s/\./ dot /g;
foreach my $a (@$e) {
- print "||$n||`$$a[8]`||[";
+ print "||$n||`$$a[10]`||[";
print "https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=$$a[0] $$a[0]";
- print "]||$$a[9]||\n";
+ print "]||$$a[11]||\n";
}
}
}
@@ -785,11 +840,54 @@
my @BL;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next if $$a[5] eq "\"CLOSED\"";
- next unless defined $OWN{$$a[8]};
- delete $OWN{$$a[8]};
+ next if $$a[6] eq "\"CLOSED\"";
+ next unless defined $OWN{$$a[10]};
+ delete $OWN{$$a[10]};
push @BL, $b;
}
$COUNT_LIST{"openInOwners"} += $#BL + 1;
$BUG_LIST{"openInOwners$cur"} = \@BL;
}
+
+sub checkLowCVSActivity {
+ my @PL;
+ foreach my $k (keys %OWN) {
+ next if defined $OWN_CVS_RECENT{$k};
+ push @PL, $k;
+ }
+ $COUNT_LIST{"lowCVSActivity"} = $#PL + 1;
+ $PKG_LIST{"lowCVSActivity"} = \@PL;
+}
+
+sub displayCVSWiki {
+ print "\n\n== About CVS repository ==\n\n";
+ print "\n\n=== Package count ===\n";
+ print "\nWe have $COUNT_LIST{'CVS'} packages with a devel directory\n";
+ my @A = sort(keys %CVS_NO_OWNER);
+ if ($#A >= 0) {
+ my $cnt = $#A + 1;
+ print "\n=== Packages in CVS with no entry in the owners.list ===\n";
+ 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 {
+ print STDERR "\nCVS stats:\n";
+ print STDERR " - $COUNT_LIST{'CVS'} packages with a devel directory\n";
+ my @A = keys %CVS_NO_OWNER;
+ if ($#A >= 0) {
+ 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";
+ }
+}
More information about the fedora-extras-commits
mailing list