status-report-scripts parseBZbugList,1.67,1.68
Christian Iseli (c4chris)
fedora-extras-commits at redhat.com
Mon Feb 19 15:08:50 UTC 2007
Author: c4chris
Update of /cvs/fedora/status-report-scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5322
Modified Files:
parseBZbugList
Log Message:
Use XMLRPC to grab Package Review tickets. Deal with new review flags.
Index: parseBZbugList
===================================================================
RCS file: /cvs/fedora/status-report-scripts/parseBZbugList,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- parseBZbugList 31 Jan 2007 12:06:45 -0000 1.67
+++ parseBZbugList 19 Feb 2007 15:08:48 -0000 1.68
@@ -27,32 +27,29 @@
# - Maybe report a count of FE-DEADREVIEW.
# - Track packages that do not build on all supported arches, and check they
# have an arch dependent BZ tracking ticket.
+# - Use RPC also for open bug reports and quit querying BZ through wget
use strict;
use Getopt::Long;
use Date::Manip;
use File::Temp qw/ tempfile /;
+use XMLRPC::Lite;
+
+my $rpc = new XMLRPC::Lite (
+ proxy => 'https://bugzilla.redhat.com/bugzilla/xmlrpc.cgi'
+);
# Cookies and BZ URLs to retrieve tickets
my $BZ_cooky = "# HTTP Cookie File
bugzilla.redhat.com FALSE /bugzilla FALSE 2145917104 COLUMNLIST opendate%20changeddate%20bug_severity%20assigned_to%20reporter%20bug_status%20resolution%20component%20blockedby%20short_desc\n";
my @BZ_URLs;
-# FE-NEW blockers
-push @BZ_URLs,
- "https://bugzilla.redhat.com/bugzilla/buglist.cgi?query_format=advanced&chfieldto=Now&field0-0-0=blocked&type0-0-0=equals&value0-0-0=163776&ctype=csv";
-# FE-REVIEW blockers
-push @BZ_URLs,
- "https://bugzilla.redhat.com/bugzilla/buglist.cgi?query_format=advanced&chfieldto=Now&field0-0-0=blocked&type0-0-0=equals&value0-0-0=163778&ctype=csv";
-# FE-ACCEPT blockers
-push @BZ_URLs,
- "https://bugzilla.redhat.com/bugzilla/buglist.cgi?query_format=advanced&chfieldto=Now&field0-0-0=blocked&type0-0-0=equals&value0-0-0=163779&ctype=csv";
# All open FE bug reports
push @BZ_URLs,
"https://bugzilla.redhat.com/bugzilla/buglist.cgi?query_format=advanced&product=Fedora%20Extras&version=4&version=5&version=6&version=devel&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED&bug_severity=security&bug_severity=high&bug_severity=normal&bug_severity=low&bug_severity=translation&bug_severity=regression&chfieldto=Now&negate0=1&field0-0-0=component&type0-0-0=equals&value0-0-0=Package%20Review&ctype=csv";
my %opt;
my @options = ( "help", "repourl=s", "o=s", "d=s", "cvs=s",
- "comps=s", "currel=i", "firstrel=i", "u=s", "p=s" );
+ "comps=s", "currel=i", "firstrel=i", "u=s", "bu=s", "p=s" );
$main::repourl = "http://mirrors.kernel.org/fedora";
$main::members
@@ -61,6 +58,7 @@
$main::currel = 6;
$main::firstrel = 1;
$main::username = "c4chris";
+$main::BZusername = "";
$main::password = "";
if( ! GetOptions( \%opt, @options ) ) { &usage(); }
@@ -72,6 +70,7 @@
$main::currel = $opt{"currel"} if defined $opt{"currel"};
$main::firstrel = $opt{"firstrel"} if defined $opt{"firstrel"};
$main::username = $opt{"u"} if defined $opt{"u"};
+$main::BZusername = $opt{"bu"} if defined $opt{"bu"};
$main::password = $opt{"p"} if defined $opt{"p"};
&usage() if defined $opt{'help'};
@@ -85,6 +84,7 @@
my $FE_GUIDELINES = 197974;
my $FE_DEADREVIEW = 201449;
my $extras_orphan = 'extras-orphan at fedoraproject.org';
+my %NAME2REVIEW;
my %BZN;
my %BZS;
my %BZL;
@@ -163,6 +163,89 @@
}
close IN;
}
+# Grab all Package Review tickets
+for my $flag ('+', '-', '?', ' ') {
+ my $bA = &runQuery($rpc, $flag);
+ foreach my $bug (@$bA) {
+ warn "assigned_to should be an email address: " . $bug->{'assigned_to'}
+ if index($bug->{'assigned_to'}, "@") < 0;
+ warn "reporter should be an email address: " . $bug->{'reporter'}
+ if index($bug->{'reporter'}, "@") < 0;
+ # Try to guess package name
+ my $name = $bug->{'short_desc'};
+ next unless $name =~ /(review\s+request|merge\s+review)/i;
+ $name =~ s/^.*review\s+request:?\s+<?//i;
+ $name =~ s/^.*merge\s+review:?\s+<?//i;
+ $name =~ s/[:.,>]?\s.*$//g;
+ $name =~ s/:.*$//g;
+ next if $name =~ /TESTING-BUGSPAM/;
+ $bug->{'pkg_name'} = $name;
+ $bug->{'opendate'} = ParseDate($bug->{'opendate'});
+ $bug->{'changeddate'} = ParseDate($bug->{'changeddate'});
+ $bug->{'blockedby'} =~ s/[{}]//g;
+ my @B = split /,/, $bug->{'blockedby'};
+ my $block = 0;
+ my $sponsor = 0;
+ my $legal = 0;
+ my $gl = 0;
+ my $bzb;
+ foreach my $b (@B) {
+ if ($b == $FE_NEW) {
+ $block += 1;
+ $bzb = \%BZN;
+ }
+ if ($b == $FE_REVIEW) {
+ $block += 1;
+ $bzb = \%BZR;
+ }
+ if ($b == $FE_ACCEPT) {
+ $block += 1;
+ $bzb = \%BZA;
+ }
+ if ($b == $FE_NEEDSPONSOR) {
+ $sponsor = 1;
+ }
+ if ($b == $FE_LEGAL) {
+ $legal = 1;
+ }
+ if ($b == $FE_GUIDELINES) {
+ $gl = 1;
+ }
+ }
+ if ($block > 1) {
+ print "Warning: bug $bug->{'bug_id'} blocks several FE_ blockers.\n";
+ next;
+ }
+ if ($block == 0) {
+ if ($flag eq "+") {
+ $bzb = \%BZA;
+ } elsif ($flag eq "-") {
+ $bzb = \%BZR;
+ } elsif ($flag eq "?") {
+ $bzb = \%BZR;
+ } else {
+ next if $bug->{'bug_status'} eq "CLOSED";
+ $bzb = \%BZN;
+ }
+ }
+ if ($bug->{'pkg_name'} =~ /^([^(]+)\(-kmod\)$/) {
+ my $pkgName = $1;
+ $bug->{'pkg_name'} = $pkgName;
+ $NAME2REVIEW{"$pkgName-kmod"} = $bug->{'bug_id'};
+ }
+ $NAME2REVIEW{$bug->{'pkg_name'}} = $bug->{'bug_id'};
+ $bzb->{$bug->{'bug_id'}} = $bug;
+ if ($sponsor == 1 && $bzb == \%BZN) {
+ $BZS{$bug->{'bug_id'}} = $bug;
+ }
+ if ($legal == 1 && $bzb == \%BZN) {
+ $BZL{$bug->{'bug_id'}} = $bug;
+ }
+ if ($gl == 1 && $bzb == \%BZN) {
+ $BZG{$bug->{'bug_id'}} = $bug;
+ }
+ }
+}
&grabRepoList("$main::repourl/core/development/source/SRPMS/", \%CORE_D);
&grabRepoList("$main::repourl/extras/development/SRPMS/", \%EXTRAS_D);
$EXTRAS_R[$main::currel + 1] = \%EXTRAS_D;
@@ -308,6 +391,8 @@
$F[9] =~ s/["{}]//g;
$F[1] =~ s/["]//g;
$F[2] =~ s/["]//g;
+ $F[4] =~ s/["]//g;
+ $F[5] =~ s/["]//g;
$F[8] =~ s/["]//g;
$F[1] = ParseDate($F[1]);
$F[2] = ParseDate($F[2]);
@@ -316,71 +401,17 @@
$F[11] = $F[10];
$F[11] =~ s/^["]+//;
$F[11] =~ s/["]+$//;
- if ($F[8] eq "Package Review") {
- # Try to guess package name
- $F[10] =~ s/["]//g;
- $F[10] =~ s/^.*review\s+request:?\s+<?//i;
- $F[10] =~ s/[:.,>]?\s.*$//g;
- $F[10] =~ s/:.*$//g;
- } else {
- $F[10] = $F[8];
- }
- my $block = 0;
- my $sponsor = 0;
- my $legal = 0;
- my $gl = 0;
- my $bzb;
- foreach my $b (@B) {
- if ($b == $FE_NEW) {
- $block += 1;
- $bzb = \%BZN;
- }
- if ($b == $FE_REVIEW) {
- $block += 1;
- $bzb = \%BZR;
- }
- if ($b == $FE_ACCEPT) {
- $block += 1;
- $bzb = \%BZA;
- }
- if ($b == $FE_NEEDSPONSOR) {
- $sponsor = 1;
- }
- if ($b == $FE_LEGAL) {
- $legal = 1;
- }
- if ($b == $FE_GUIDELINES) {
- $gl = 1;
- }
- }
- if ($block > 1) {
- print "Warning: bug $F[0] blocks several FE_ blockers.\n";
- next;
- }
- if ($block == 1) {
- if ($F[8] eq "Package Review"
- && $F[10] =~ /^([^(]+)\(-kmod\)$/) {
- my $pkgName = $1;
- my @F1 = @F;
- $F[10] = $pkgName;
- $F1[10] = "$pkgName-kmod";
- $bzb->{$F[0]} = \@F1;
- }
- $bzb->{$F[0]} = \@F;
- if ($sponsor == 1 && $bzb == \%BZN) {
- $BZS{$F[0]} = \@F;
- }
- if ($legal == 1 && $bzb == \%BZN) {
- $BZL{$F[0]} = \@F;
- }
- if ($gl == 1 && $bzb == \%BZN) {
- $BZG{$F[0]} = \@F;
- }
- next;
- }
if (defined $OWN{$F[8]}) {
$COUNT_LIST{"openOPEN-BUGS"} += 1;
- $BZB{$F[0]} = \@F;
+ $BZB{$F[0]} = {
+ 'bug_id' => $F[0],
+ 'opendate' => $F[1],
+ 'changeddate' => $F[2],
+ 'assigned_to' => $F[4],
+ 'reporter' => $F[5],
+ 'pkg_name' => $F[8],
+ 'short_desc' => $F[10]
+ };
next;
}
print STDERR "Not handled: ", join(" ", @F), "\n";
@@ -421,12 +452,12 @@
&displayOwnersWiki;
&displayCommonWiki;
&displayAcceptWiki(\%BZA);
-&displayNewReviewWiki(\%BZR, "FE-REVIEW", 5);
-&displayNewReviewWiki(\%BZN, "FE-NEW", 5);
-&displayNewReviewWiki(\%BZS, "FE-NEEDSPONSOR", 5);
-&displayNewReviewWiki(\%BZL, "FE-LEGAL", 5);
-&displayNewReviewWiki(\%BZG, "FE-GUIDELINES", 5);
-&displayNewReviewWiki(\%BZB, "OPEN-BUGS", 4);
+&displayNewReviewWiki(\%BZR, "FE-REVIEW", 'reporter');
+&displayNewReviewWiki(\%BZN, "FE-NEW", 'reporter');
+&displayNewReviewWiki(\%BZS, "FE-NEEDSPONSOR", 'reporter');
+&displayNewReviewWiki(\%BZL, "FE-LEGAL", 'reporter');
+&displayNewReviewWiki(\%BZG, "FE-GUIDELINES", 'reporter');
+&displayNewReviewWiki(\%BZB, "OPEN-BUGS", 'assigned_to');
&displayCVSWiki();
&displayMaintainersWiki();
&displayDroppedWiki();
@@ -557,8 +588,8 @@
print "\n\n=== Packages that have not yet completed review ===\n";
print "\nWe have $COUNT_LIST{'openInOwners'} packages ",
"which have not yet been FE-ACCEPT'd...\n";
- &displayBLWiki($BUG_LIST{"openInOwnersFE-REVIEW"}, \%BZR, 5);
- &displayBLWiki($BUG_LIST{"openInOwnersFE-NEW"}, \%BZN, 5);
+ &displayBLWiki($BUG_LIST{"openInOwnersFE-REVIEW"}, \%BZR, 'reporter');
+ &displayBLWiki($BUG_LIST{"openInOwnersFE-NEW"}, \%BZN, 'reporter');
}
if ($COUNT_LIST{"extrasNoOwner"} > 0) {
print "\n\n=== Packages missing in owners.list ===\n";
@@ -729,8 +760,8 @@
if ($COUNT_LIST{"openInOwners"} > 0) {
print STDERR " - $COUNT_LIST{'openInOwners'} packages ",
"which have not yet been FE-ACCEPT'd...\n";
- &displayBL($BUG_LIST{"openInOwnersFE-REVIEW"}, \%BZR, 5);
- &displayBL($BUG_LIST{"openInOwnersFE-NEW"}, \%BZN, 5);
+ &displayBL($BUG_LIST{"openInOwnersFE-REVIEW"}, \%BZR, 'reporter');
+ &displayBL($BUG_LIST{"openInOwnersFE-NEW"}, \%BZN, 'reporter');
}
if ($COUNT_LIST{"extrasNoOwner"} > 0) {
print STDERR " - $COUNT_LIST{'extrasNoOwner'} packages present in the ",
@@ -784,36 +815,36 @@
my @BLO;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next unless $$a[6] eq "\"CLOSED\"";
- my $pkg = $$a[10];
+ next unless $a->{'bug_status'} eq "CLOSED";
+ my $pkg = $a->{'pkg_name'};
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
$pkg =~ s/-[^-]+-[^-]+$//;
}
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
- $pkg = $$a[10];
+ $pkg = $a->{'pkg_name'};
$pkg =~ s/-[^-]+$//;
}
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
- $pkg = lc $$a[10];
+ $pkg = lc $a->{'pkg_name'};
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
$pkg =~ s/-[^-]+-[^-]+$//;
}
}
unless ($SRPMS{$pkg} == 1 || defined($OWN{$pkg})) {
- $pkg = lcfirst $$a[10];
+ $pkg = lcfirst $a->{'pkg_name'};
}
- unless (defined $BZREV_BUGS{$$a[4]}) {
- $BZREV_BUGS{$$a[4]} = {};
+ unless (defined $BZREV_BUGS{$a->{'assigned_to'}}) {
+ $BZREV_BUGS{$a->{'assigned_to'}} = {};
}
- $BZREV_BUGS{$$a[4]}->{$b} = 1;
- unless (defined $BZOWN_BUGS{$$a[5]}) {
- $BZOWN_BUGS{$$a[5]} = {};
+ $BZREV_BUGS{$a->{'assigned_to'}}->{$b} = 1;
+ unless (defined $BZOWN_BUGS{$a->{'reporter'}}) {
+ $BZOWN_BUGS{$a->{'reporter'}} = {};
}
- $BZOWN_BUGS{$$a[5]}->{$b} = 1;
+ $BZOWN_BUGS{$a->{'reporter'}}->{$b} = 1;
$COUNT_LIST{"acceptedClosed"} += 1;
next if defined $DISCARD{$pkg};
- if (Date_Cmp($$a[2], $fourDaysAgo) < 0) {
- #print STDERR "Date_Cmp $$a[2] < $fourDaysAgo\n";
+ if (Date_Cmp($a->{'changeddate'}, $fourDaysAgo) < 0) {
+ #print STDERR "Date_Cmp $a->{'changeddate'} < $fourDaysAgo\n";
if ($SRPMS{$pkg} == 1) {
if (!defined($CORE_D{$pkg}) && !defined($OWN{$pkg})) {
push @BLO, $b;
@@ -864,23 +895,23 @@
if ($COUNT_LIST{"missing"} > 0) {
print "\nWe have $COUNT_LIST{'missing'} accepted, closed packages where I'm unable to ",
"find the package in the development repo:\n";
- &displayBLWiki($BUG_LIST{"acceptedNoDevel"}, $BZ, 5);
+ &displayBLWiki($BUG_LIST{"acceptedNoDevel"}, $BZ, 'reporter');
}
if ($COUNT_LIST{"missingOwner"} > 0) {
print "\nWe have $COUNT_LIST{'missingOwner'} accepted, closed packages where I'm unable to ",
"find the package in the owners file:\n";
- &displayBLWiki($BUG_LIST{"acceptedNoOwn"}, $BZ, 5);
+ &displayBLWiki($BUG_LIST{"acceptedNoOwn"}, $BZ, 'reporter');
}
if ($COUNT_LIST{"acceptOpenInactive"} > 0) {
print "\n\n=== Inactivity notice ===\n";
print "\nWe have $COUNT_LIST{'acceptOpenInactive'} accepted, open package reviews older than 4 weeks\n";
- &displayBLWiki($BUG_LIST{"acceptOpenInactive"}, $BZ, 5);
+ &displayBLWiki($BUG_LIST{"acceptOpenInactive"}, $BZ, 'reporter');
}
if ($COUNT_LIST{"acceptOpenInDevel"} > 0) {
print "\n\n=== Some cleanup needed ===\n";
print "\nWe have $COUNT_LIST{'acceptOpenInDevel'} accepted, open package reviews where the package ",
"appears to already be in the repo...\n";
- &displayBLWiki($BUG_LIST{"acceptOpenInDevel"}, $BZ, 5);
+ &displayBLWiki($BUG_LIST{"acceptOpenInDevel"}, $BZ, 'reporter');
}
}
@@ -913,19 +944,19 @@
my @LATE;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next if $$a[6] eq "\"CLOSED\"";
- my $pkg = $$a[10];
+ next if $a->{'bug_status'} eq "CLOSED";
+ my $pkg = $a->{'pkg_name'};
unless ($SRPMS{$pkg} == 1) {
- $pkg = lc $$a[10];
+ $pkg = lc $a->{'pkg_name'};
}
unless ($SRPMS{$pkg} == 1) {
- $pkg = lcfirst $$a[10];
+ $pkg = lcfirst $a->{'pkg_name'};
}
if ($SRPMS{$pkg} == 1) {
$COUNT_LIST{"acceptOpenInDevel"} += 1;
push @BL, $b;
}
- if (Date_Cmp($$a[2], $fourWeeksAgo) < 0) {
+ if (Date_Cmp($a->{'changeddate'}, $fourWeeksAgo) < 0) {
push @LATE, $b;
}
}
@@ -938,7 +969,7 @@
my ($BZ, $cur) = @_;
foreach my $b (keys %$BZ) {
my $a = $BZ->{$b};
- next if $$a[6] eq "\"CLOSED\"";
+ next if $a->{'bug_status'} eq "CLOSED";
$COUNT_LIST{"open$cur"} += 1;
}
}
@@ -948,7 +979,7 @@
my @BL;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next unless $$a[6] eq "\"CLOSED\"";
+ next unless $a->{'bug_status'} eq "CLOSED";
push @BL, $b;
}
$COUNT_LIST{"closed$cur"} = $#BL + 1;
@@ -961,10 +992,10 @@
my @LATE;
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next if $$a[6] eq "\"CLOSED\"";
- next if $$a[11] =~ /Tracker/;
- if (Date_Cmp($$a[2], $fourWeeksAgo) < 0) {
- if (Date_Cmp($$a[2], $eightWeeksAgo) < 0) {
+ next if $a->{'bug_status'} eq "CLOSED";
+ next if $a->{'short_desc'} =~ /Tracker/;
+ if (Date_Cmp($a->{'changeddate'}, $fourWeeksAgo) < 0) {
+ if (Date_Cmp($a->{'changeddate'}, $eightWeeksAgo) < 0) {
push @LATE, $b;
} else {
push @BL, $b;
@@ -982,16 +1013,16 @@
# my @BL;
# foreach my $b (sort(keys %$BZ)) {
# my $a = $BZ->{$b};
-# next if $$a[6] eq "\"CLOSED\"";
-# next if $$a[1] ne $$a[2];
-# if (Date_Cmp($$a[2], $eightWeeksAgo) < 0) {
+# next if $a->{'bug_status'} eq "CLOSED";
+# next if $a->{'opendate'} ne $a->{'changeddate'};
+# if (Date_Cmp($a->{'changeddate'}, $eightWeeksAgo) < 0) {
# push @BL, $b;
# }
# }
# if ($#BL >= 0) {
# my $cnt = $#BL + 1;
# print "\nWe have $cnt $cur tickets 8 weeks old with no comments\n";
-# &displayBL(\@BL, $BZ, 5);
+# &displayBL(\@BL, $BZ, 'reporter');
# }
#}
@@ -999,6 +1030,7 @@
print STDERR "Usage: $0 [options] <bugs list>
where options are:
-help this help note
+ -bu <str> Bugzilla username
-comps <dir> extras comps directory [$main::compsDir]
-currel <int> current Fedora release number [$main::currel]
-cvs <dir> extras CVS directory [$main::cvsDir]
@@ -1060,10 +1092,10 @@
join(",", @$BL), "\n";
foreach my $b (sort @$BL) {
my $a = $BZ->{$b};
- my $owner = $$a[$field];
+ my $owner = $a->{$field};
$owner =~ s/["]//g;
$owner =~ s/\@/ at /;
- printf STDERR " %-40s %s\n", $$a[10], $owner;
+ printf STDERR " %-40s %s\n", $a->{'pkg_name'}, $owner;
}
}
@@ -1073,11 +1105,11 @@
my %O;
foreach my $b (@$BL) {
my $a = $BZ->{$b};
- my $e = $O{$$a[$field]};
+ my $e = $O{$a->{$field}};
if (defined $e) {
push @$e, $a;
} else {
- $O{$$a[$field]} = [ $a ];
+ $O{$a->{$field}} = [ $a ];
}
}
foreach my $n (sort(keys %O)) {
@@ -1086,9 +1118,10 @@
$n =~ s/\@/ at /;
$n =~ s/\./ dot /g;
foreach my $a (@$e) {
- print "||$n||`$$a[10]`||[";
- print "https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=$$a[0] $$a[0]";
- print "]||$$a[11]||\n";
+ print "||$n||`$a->{'pkg_name'}`||[",
+ "https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=",
+ $a->{'bug_id'}, " ", $a->{'bug_id'},
+ "]||$a->{'short_desc'}||\n";
}
}
}
@@ -1149,10 +1182,10 @@
}
foreach my $b (sort(keys %$BZ)) {
my $a = $BZ->{$b};
- next if $$a[6] eq "\"CLOSED\"";
- next if defined $DISCARD{$$a[10]};
- next unless defined $OL{lc $$a[10]};
-# delete $OWN{$OL{lc $$a[10]}};
+ next if $a->{'bug_status'} eq "CLOSED";
+ next if defined $DISCARD{$a->{'pkg_name'}};
+ next unless defined $OL{lc $a->{'pkg_name'}};
+# delete $OWN{$OL{lc $a->{'pkg_name'}}};
push @BL, $b;
}
$COUNT_LIST{"openInOwners"} += $#BL + 1;
@@ -1236,18 +1269,17 @@
my ($BZ) = @_;
foreach my $b (keys %$BZ) {
my $a = $BZ->{$b};
- next if $$a[11] =~ /Tracker/;
- my $assignee = $$a[4];
- $assignee =~ s/["]//g;
+ next if $a->{'short_desc'} =~ /Tracker/;
+ my $assignee = $a->{'assigned_to'};
my $s = $OWNER_STAT{$assignee};
unless (defined $s) {
- my $o = $OWN{$$a[10]};
+ my $o = $OWN{$a->{'pkg_name'}};
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;
+ die "Couldn't find OWNER_STAT for $assignee $a->{'pkg_name'}" unless defined $s;
$$s[1] += 1;
- if (Date_Cmp($$a[2], $eightWeeksAgo) >= 0) {
+ if (Date_Cmp($a->{'changeddate'}, $eightWeeksAgo) >= 0) {
$$s[3] = 1;
}
$$s[4]->{$b} = $a;
@@ -1275,7 +1307,7 @@
my $e = $OWNER_STAT{$k};
my $bugs = $$e[4];
my @K = keys %$bugs;
- &displayBLWiki(\@K, $bugs, 4);
+ &displayBLWiki(\@K, $bugs, 'assigned_to');
}
}
if ($COUNT_LIST{'maintpkg'} > 0) {
@@ -1431,3 +1463,35 @@
$COUNT_LIST{"CompsOver$tag"} = $#B + 1;
$PKG_LIST{"CompsOver$tag"} = \@B;
}
+
+sub runQuery {
+ my ($rpc, $flag) = @_;
+ my $querydata = {
+ 'column_list' => ['opendate', 'changeddate', 'bug_severity', 'alias',
+ 'assigned_to', 'reporter', 'bug_status',
+ 'resolution', 'component', 'blockedby', 'short_desc'],
+ 'product' => ['Fedora Extras'],
+ 'component' => ['Package Review'],
+ 'field0-0-0' => 'flagtypes.name',
+ 'bug_status' => ["NEW", "VERIFIED", "ASSIGNED", "REOPENED", "CLOSED",
+ "NEEDINFO_ENG", "NEEDINFO", "INVESTIGATE", "MODIFIED",
+ "ON_DEV", "UNCONFIRMED", "QA_READY", "ON_QA",
+ "FAILS_QA", "NEEDINFO_REPORTER", "RELEASE_PENDING",
+ "POST"]
+ };
+ if ($flag eq " ") {
+ $querydata->{'type0-0-0'} = 'notregexp';
+ $querydata->{'value0-0-0'} = 'fedora-review[-+?]'
+ } else {
+ $querydata->{'type0-0-0'} = 'equals';
+ $querydata->{'value0-0-0'} = "fedora-review$flag";
+ }
+ my $call = $rpc->call('bugzilla.runQuery', $querydata,
+ $main::BZusername, $main::password);
+ if ($call->faultstring) {
+ print STDERR $call->faultstring . "\n";
+ exit 1;
+ }
+ my $result = $call->result;
+ return $result->{'bugs'};
+}
More information about the scm-commits
mailing list