Better limit the results in per user reports.
This commit is contained in:
parent
dbf763b938
commit
24382e8f38
17
report.py
17
report.py
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
@ -26,6 +27,9 @@ def report(project_filter, user_filter, prefix):
|
||||||
user_filter_new = ['Jenkins']
|
user_filter_new = ['Jenkins']
|
||||||
user_filter_new.extend(user_filter)
|
user_filter_new.extend(user_filter)
|
||||||
user_filter = user_filter_new
|
user_filter = user_filter_new
|
||||||
|
|
||||||
|
user_filter_without_jenkins = copy.copy(user_filter)
|
||||||
|
user_filter_without_jenkins.remove('Jenkins')
|
||||||
|
|
||||||
# This is more complicated than it looks because we need to handle
|
# This is more complicated than it looks because we need to handle
|
||||||
# patchsets which are uploaded so rapidly that older patchsets aren't
|
# patchsets which are uploaded so rapidly that older patchsets aren't
|
||||||
|
@ -65,6 +69,19 @@ def report(project_filter, user_filter, prefix):
|
||||||
if valid_for < datetime.timedelta(hours=3):
|
if valid_for < datetime.timedelta(hours=3):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
matched_authors = 0
|
||||||
|
for author in patchsets[number][patch]:
|
||||||
|
if author == '__created__':
|
||||||
|
continue
|
||||||
|
|
||||||
|
if author not in user_filter_without_jenkins:
|
||||||
|
continue
|
||||||
|
|
||||||
|
matched_authors += 1
|
||||||
|
|
||||||
|
if matched_authors == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
valid_patches.append(patch)
|
valid_patches.append(patch)
|
||||||
|
|
||||||
total_patches += len(valid_patches)
|
total_patches += len(valid_patches)
|
||||||
|
|
Loading…
Reference in New Issue