From ee7cc1880852d720f863892b739078252c7265c7 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Tue, 12 Jun 2012 20:34:39 -0500 Subject: [PATCH] Add trivial ticket report --- scripts/review-stats/review-stats.py | 31 +++++++++++++++++-- .../review-stats/review-templates/index.html | 2 ++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/scripts/review-stats/review-stats.py b/scripts/review-stats/review-stats.py index 4cd3f5d..4bc3d34 100755 --- a/scripts/review-stats/review-stats.py +++ b/scripts/review-stats/review-stats.py @@ -171,7 +171,8 @@ def run_query(bz): # Now process the other three flags; not much special processing for them querydata['type0-0-0'] = 'equals' # for i in ['-', '+', '?']: - for i in ['-', '?']: + for i in []: #['-', '?']: + print "foo" querydata['value0-0-0'] = 'fedora-review' + i b1 = bz.query(querydata) for bug in b1: @@ -234,6 +235,13 @@ def select_needsponsor(bug, bugd): return 1 return 0 +def select_trivial(bug, bugd): + if (bugd['reviewflag'] == ' ' + and bug.bug_status != 'CLOSED' + and string.lower(bug.status_whiteboard).find('trivial') >= 0): + return 1 + return 0 + def select_epel(bug, bugd): '''If someone assigns themself to a ticket, it's theirs regardless of whether they set the flag properly or not.''' @@ -292,6 +300,24 @@ def report_hidden(bugs, bugdata, loader, tmpdir, subs): return data['count'] +def report_trivial(bugs, bugdata, loader, tmpdir, subs): + data = deepcopy(subs) + data['description'] = 'This page lists review tickets marked as trivial' + data['title'] = 'Trivial reviews' + + for i in bugs: + if select_trivial(i, bugdata[i.bug_id]): + rowclass = 'bz_row_even' + if data['count'] % 2 == 1: + rowclass = 'bz_row_odd' + + data['bugs'].append(std_row(i, rowclass)) + data['count'] +=1 + + write_html(loader, 'plain.html', data, tmpdir, 'TRIVIAL.html') + + return data['count'] + def report_merge(bugs, bugdata, loader, tmpdir, subs): data = deepcopy(subs) data['description'] = 'This page lists all merge review tickets which need reviewers' @@ -442,9 +468,10 @@ if __name__ == '__main__': subs['new'] = report_new(**args) subs['epel'] = report_epel(**args) + subs['hidden'] = report_hidden(**args) subs['merge'] = report_merge(**args) subs['needsponsor'] = report_needsponsor(**args) - subs['hidden'] = report_hidden(**args) + subs['trivial'] = report_trivial(**args) # data['accepted_closed'] = report_accepted_closed(bugs, bugdata, loader, tmpdir) # data['accepted_open'] = report_accepted_open(bugs, bugdata, loader, tmpdir) # data['rejected_closed'] = report_rejected_closed(bugs, bugdata, loader, tmpdir) diff --git a/scripts/review-stats/review-templates/index.html b/scripts/review-stats/review-templates/index.html index 6671c7a..817ba9b 100644 --- a/scripts/review-stats/review-templates/index.html +++ b/scripts/review-stats/review-templates/index.html @@ -35,6 +35,8 @@ current state of all Fedora package review tickets. The following reports are available: + +
Trivial tickets ($trivial)All review tickets marked as trivial. New reviewers should look here for simple packages to review.
New tickets ($new) All non-merge review tickets without an assigned reviewer, sorted by submission date. Tickets colored green require a sponsor.
New EPEL tickets ($epel)