#!/usr/bin/perl -w # $Id: getReviewByFlags,v 1.1 2007/02/02 17:30:59 c4chris Exp $ use strict; use XMLRPC::Lite; use Data::Dumper; die "Usage: $0 username password" unless $#ARGV == 1; my $username = shift; my $password = shift; my $rpc = new XMLRPC::Lite ( proxy => 'https://bugzilla.redhat.com/bugzilla/xmlrpc.cgi' ); my $date = `date`; $date =~ s/[\r\n]+$//; print ' Cached Bugzilla Review Tracker

This is a cached copy of the Core packages review tickets that are a part of the Core + Extras merge. It\'s intended to make interacting with bugzilla faster. It is updated every ?? minutes.

Last Update: ', $date, '

', "\n"; for my $flag ('+', '-', '?', ' ') { if ($flag eq ' ') { print '

Open ticket(s) with an empty flag

', "\n"; } else { print '

Ticket(s) with a \'', $flag, '\' flag

ID Alias Assignee Status Resolution Summary
', "\n"; } &runQuery($rpc, $flag); print "
ID Alias Assignee Status Resolution Summary
\n"; } print "
\n"; exit 0; 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' }; if ($flag eq " ") { $querydata->{'bug_status'} = ["NEW", "ASSIGNED", "REOPENED", "NEEDINFO", "INVESTIGATE", "MODIFIED"]; $querydata->{'type0-0-0'} = 'notregexp'; $querydata->{'value0-0-0'} = 'fedora-review[-+?]' } else { $querydata->{'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"]; $querydata->{'type0-0-0'} = 'equals'; $querydata->{'value0-0-0'} = "fedora-review$flag"; } my $call = $rpc->call('bugzilla.runQuery', $querydata, $username, $password); if ($call->faultstring) { print STDERR $call->faultstring . "\n"; exit 1; } my $result = $call->result; # print @{$result->{'bugs'}} . " bug(s) found.\n\n"; my @A = sort {$a->{'short_desc'} cmp $b->{'short_desc'}} @{$result->{'bugs'}}; my $cnt = 0; foreach my $e (@A) { $cnt += 1; if (($cnt % 2) == 1) { print '{'bug_status'}, ' onMouseOver="bug_over(this, 0);">', "\n"; my $ma = $e->{'assigned_to'}; $ma =~ s/[.@]/ /g; print ' ', $e->{'bug_id'}, ' ', $e->{'alias'}, ' ', $ma, ' ', $e->{'bug_status'}, ' ', $e->{'resolution'}, ' ', $e->{'short_desc'}, ' ', "\n"; } }