Do not calculate WIP as -1 mark
The fix corrects contribution report and contribution summary block Closes bug 1352881 Change-Id: Ic31f4add2fd1370cf2c2014f9038a7b31ce435e4
This commit is contained in:
@@ -222,11 +222,16 @@ def loc_filter(result, record, param_id, context):
|
|||||||
|
|
||||||
def mark_filter(result, record, param_id, context):
|
def mark_filter(result, record, param_id, context):
|
||||||
result_by_param = result[getattr(record, param_id)]
|
result_by_param = result[getattr(record, param_id)]
|
||||||
if record.type == 'Workflow' and record.value == 1:
|
value = record.value
|
||||||
|
record_type = record.type
|
||||||
|
|
||||||
|
if record_type == 'Code-Review':
|
||||||
|
result_by_param['metric'] += 1
|
||||||
|
elif record.type == 'Workflow':
|
||||||
|
if value == 1:
|
||||||
value = 'A'
|
value = 'A'
|
||||||
else:
|
else:
|
||||||
value = record.value
|
value = 'WIP'
|
||||||
result_by_param['metric'] += 1
|
|
||||||
result_by_param[value] = result_by_param.get(value, 0) + 1
|
result_by_param[value] = result_by_param.get(value, 0) + 1
|
||||||
|
|
||||||
if record.disagreement:
|
if record.disagreement:
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ def get_activity(records, start_record, page_size, query_message=None):
|
|||||||
|
|
||||||
|
|
||||||
def get_contribution_summary(records):
|
def get_contribution_summary(records):
|
||||||
marks = dict((m, 0) for m in [-2, -1, 0, 1, 2, 'A'])
|
marks = dict((m, 0) for m in [-2, -1, 0, 1, 2, 'A', 'WIP'])
|
||||||
commit_count = 0
|
commit_count = 0
|
||||||
loc = 0
|
loc = 0
|
||||||
drafted_blueprint_count = 0
|
drafted_blueprint_count = 0
|
||||||
@@ -182,10 +182,13 @@ def get_contribution_summary(records):
|
|||||||
commit_count += 1
|
commit_count += 1
|
||||||
loc += record.loc
|
loc += record.loc
|
||||||
elif record_type == 'mark':
|
elif record_type == 'mark':
|
||||||
if record.type == 'Workflow' and record.value == 1:
|
value = record.value
|
||||||
marks['A'] += 1
|
if record.type == 'Workflow':
|
||||||
|
if value == 1:
|
||||||
|
value = 'A'
|
||||||
else:
|
else:
|
||||||
marks[record.value] += 1
|
value = 'WIP'
|
||||||
|
marks[value] += 1
|
||||||
elif record_type == 'email':
|
elif record_type == 'email':
|
||||||
email_count += 1
|
email_count += 1
|
||||||
elif record_type == 'bpd':
|
elif record_type == 'bpd':
|
||||||
|
|||||||
Reference in New Issue
Block a user