summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-12-11 22:55:06 +0100
committerXisco Fauli <anistenis@gmail.com>2016-12-11 22:55:06 +0100
commitacd2c722ddac79ce659bff47c6afd73878d44a9b (patch)
treea1bad9e98906ae901bf34db88caac590c97269a6
parent017c974d29b87bdfa18f57aab462f51e754f1351 (diff)
List people who bisect bugs
-rwxr-xr-xesc-reporting/esc-analyze.py37
-rwxr-xr-xesc-reporting/esc-report.py50
2 files changed, 60 insertions, 27 deletions
diff --git a/esc-reporting/esc-analyze.py b/esc-reporting/esc-analyze.py
index e2713ff..28339c6 100755
--- a/esc-reporting/esc-analyze.py
+++ b/esc-reporting/esc-analyze.py
@@ -85,15 +85,16 @@ def util_build_period_stat(cfg, statList, xDate, email, status, pstatus, base =
if email is not None:
statList['people'][email][base][i][pstatus] += 1
statList['people'][email][base][i]['total'] += 1
- if base != 'gerrit' :
- statList['data'][base][i][status] += 1
- statList['data'][base][i]['total'] += 1
- elif statList['people'][email]['isCommitter']:
- statList['data'][base]['committer'][i][status] += 1
- statList['data'][base]['committer'][i]['total'] += 1
- else:
- statList['data'][base]['contributor'][i]['total'] += 1
- statList['data'][base]['contributor'][i][status] += 1
+ if status:
+ if base != 'gerrit' :
+ statList['data'][base][i][status] += 1
+ statList['data'][base][i]['total'] += 1
+ elif statList['people'][email]['isCommitter']:
+ statList['data'][base]['committer'][i][status] += 1
+ statList['data'][base]['committer'][i]['total'] += 1
+ else:
+ statList['data'][base]['contributor'][i]['total'] += 1
+ statList['data'][base]['contributor'][i][status] += 1
@@ -121,10 +122,10 @@ def util_create_person_gerrit(person, email):
'3month': {'owner': 0, 'reviewer': 0, 'total': 0},
'1month': {'owner': 0, 'reviewer': 0, 'total': 0},
'1week': {'owner': 0, 'reviewer': 0, 'total': 0}},
- 'qa': {'1year': {'owner': 0, 'reviewer': 0, 'total': 0},
- '3month': {'owner': 0, 'reviewer': 0, 'total': 0},
- '1month': {'owner': 0, 'reviewer': 0, 'total': 0},
- '1week': {'owner': 0, 'reviewer': 0,'total': 0}},
+ 'qa': {'1year': {'owner': 0, 'reviewer': 0, 'bisected': 0, 'total': 0},
+ '3month': {'owner': 0, 'reviewer': 0, 'bisected': 0, 'total': 0},
+ '1month': {'owner': 0, 'reviewer': 0, 'bisected': 0, 'total': 0},
+ '1week': {'owner': 0, 'reviewer': 0, 'bisected': 0, 'total': 0}},
'isCommitter': False,
'isContributor': False,
'hasLicense': False,
@@ -409,6 +410,16 @@ def analyze_qa(statList, openhubData, gerritData, gitData, bugzillaData, cfg):
util_build_period_stat(cfg, statList, creationDate, email, row['status'], 'owner', base='qa')
+ for change in row['history']:
+ email = util_check_mail('*UNKNOWN*', change['who'], statList, cfg['contributor']['combine-email'])
+ xDate = datetime.datetime.strptime(change['when'], "%Y-%m-%dT%H:%M:%SZ")
+ for entry in change['changes']:
+ if entry['field_name'] == 'keywords':
+ keywordsAdded = entry['added'].split(", ")
+ for keyword in keywordsAdded:
+ if keyword == 'bisected':
+ util_build_period_stat(cfg, statList, xDate, email, '', 'bisected', base='qa')
+
for change in row['comments']:
email = util_check_mail('*UNKNOWN*', change['creator'], statList, cfg['contributor']['combine-email'])
xDate = datetime.datetime.strptime(change['creation_time'], "%Y-%m-%dT%H:%M:%SZ")
diff --git a/esc-reporting/esc-report.py b/esc-reporting/esc-report.py
index a2c7a7b..cfe397d 100755
--- a/esc-reporting/esc-report.py
+++ b/esc-reporting/esc-report.py
@@ -389,18 +389,6 @@ def report_ui(statList, openhubData, gerritData, gitData, bugzillaData, cfg):
def report_qa(statList, openhubData, gerritData, gitData, bugzillaData, cfg):
- tmpClist = sorted(statList['people'], key=lambda k: (statList['people'][k]['qa']['1week']['owner']), reverse=True)
- top10list = []
- for i in tmpClist:
- if i != 'qa-admin@libreoffice.org' and i != 'libreoffice-commits@lists.freedesktop.org':
- x = {'mail': i,
- 'name': statList['people'][i]['name'],
- 'week' :statList['people'][i]['qa']['1week']['owner'],
- 'month' :statList['people'][i]['qa']['1month']['owner'],
- '3month':statList['people'][i]['qa']['1month']['owner']}
- top10list.append(x)
- if len(top10list) >= 10:
- break
fp = open('/tmp/esc_qa_report.txt', 'w', encoding='utf-8')
print('ESC QA report, generated {} based on stats.json from {}'.format(
@@ -441,11 +429,45 @@ def report_qa(statList, openhubData, gerritData, gitData, bugzillaData, cfg):
{'db': 'trendQA', 'tag': '100+', 'text': '100+'}]
print(util_build_matrix('distribution', xRow, None, statList), end='', file=fp)
+ tmpClist = sorted(statList['people'], key=lambda k: (statList['people'][k]['qa']['1week']['owner']), reverse=True)
+ top10reporters = []
+ for i in tmpClist:
+ if i != 'qa-admin@libreoffice.org' and i != 'libreoffice-commits@lists.freedesktop.org':
+ x = {'mail': i,
+ 'name': statList['people'][i]['name'],
+ 'week' :statList['people'][i]['qa']['1week']['owner'],
+ 'month' :statList['people'][i]['qa']['1month']['owner'],
+ '3month':statList['people'][i]['qa']['1month']['owner']}
+ top10reporters.append(x)
+ if len(top10reporters) >= 10:
+ break
+
print("\n + top 10 bugs reporters:", file=fp)
xRow = []
- for i in range(0, 10):
+ for i in top10reporters:
print(' {} reported {} bugs in 1 week, {} bugs in 1 month and {} bugs in 3 months'.format(
- top10list[i]['name'], top10list[i]['week'], top10list[i]['month'], top10list[i]['3month']), file=fp)
+ i['name'], i['week'], i['month'], i['3month']), file=fp)
+
+ tmpClist = sorted(statList['people'], key=lambda k: (statList['people'][k]['qa']['1week']['bisected']), reverse=True)
+ top10bisected = []
+ for i in tmpClist:
+ if i != 'qa-admin@libreoffice.org' and i != 'libreoffice-commits@lists.freedesktop.org' and \
+ statList['people'][i]['qa']['1week']['bisected'] > 0:
+ x = {'mail': i,
+ 'name': statList['people'][i]['name'],
+ 'week' :statList['people'][i]['qa']['1week']['bisected'],
+ 'month' :statList['people'][i]['qa']['1month']['bisected'],
+ '3month':statList['people'][i]['qa']['1month']['bisected']}
+ top10bisected.append(x)
+ if len(top10bisected) >= 10:
+ break
+
+ print("\n + Bisected by:", file=fp)
+ xRow = []
+ for i in top10bisected:
+ print(' {} bisected {} bugs in 1 week, {} bugs in 1 month and {} bugs in 3 months'.format(
+ i['name'], i['week'], i['month'], i['3month']), file=fp)
+
fp.close()
return None