Remove received reviews from output.

Remove the number of reviews received from the reviewers report output.
I think this information is valuable, but the values we're getting are
not accurate.  The problem is that if a patch gets rebased, the trivial
rebase detection will automatically re-apply reviews.  Those are getting
counted even though they aren't new reviews being received.

Change-Id: I3f1c620c225c1d1d3f2a137b095bac847a353238
This commit is contained in:
Russell Bryant 2013-11-27 19:27:37 -05:00
parent 4ed170cb11
commit 36402ae486
1 changed files with 31 additions and 14 deletions

View File

@ -27,6 +27,13 @@ import sys
from reviewstats import utils
# NOTE(russellb) This data is tracked but not currently put in the
# output because it needs to be made more accurate. Right now trivial
# rebases that have reviews automatically re-applied get included, and
# they shouldn't be.
ENABLE_RECEIVED = False
def round_to_day(ts):
SECONDS_PER_DAY = 60 * 60 * 24
return (ts / (SECONDS_PER_DAY)) * SECONDS_PER_DAY
@ -98,26 +105,35 @@ def process_patchset(project, patchset, reviewers, ts):
def write_csv(reviewer_data, file_obj):
"""Write out reviewers using CSV."""
writer = csv.writer(file_obj)
row = ['Reviewer', 'Reviews', '-2', '-1', '+1', '+2', '+A', '+/- %',
'Disagreements', 'Disagreement%']
if ENABLE_RECEIVED:
row.append('Received')
writer.writerow(
('Reviewer', 'Reviews', '-2', '-1', '+1', '+2', '+A', '+/- %',
'Disagreements', 'Disagreement%', 'Received'))
)
for (name, r_data, d_data, s_data) in reviewer_data:
row = (name,) + r_data + d_data + s_data
row = [name, r_data, d_data]
if ENABLED_RECEIVED:
row.append(s_data)
writer.writerow(row)
def write_pretty(reviewer_data, file_obj):
"""Write out reviewers using PrettyTable."""
table = prettytable.PrettyTable(
('Reviewer',
columns = ['Reviewer',
'Reviews -2 -1 +1 +2 +A +/- %',
'Disagreements*',
'Received***'))
'Disagreements*']
if ENABLE_RECEIVED:
columns.append('Received***')
table = prettytable.PrettyTable(columns)
for (name, r_data, d_data, s_data) in reviewer_data:
r = '%7d %3d %3d %3d %3d %3d %s' % r_data
d = '%3d (%s)' % d_data
s = '%3d (%s)' % s_data
table.add_row((name, r, d, s))
row = [name, r, d]
if ENABLE_RECEIVED:
row.append(s)
table.add_row(row)
file_obj.write("%s\n" % table)
@ -309,8 +325,9 @@ def main(argv=None):
'patch where a core team member later gave a -1 or -2 vote'
', or a negative vote overridden with a positive one '
'afterwards.\n')
if ENABLE_RECEIVED:
file_obj.write(
'\n(***) Received - the number of reviews that this person '
'\n(***) Received - number of reviews that this person '
'received on their patches in this time period. The given '
'ratio is the number of reviews given over the number '
'received.\n')