[Libreoffice-commits] dev-tools.git: 2 commits - qa/createWikiStats.py
xisco (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jan 22 16:25:58 UTC 2020
qa/createWikiStats.py | 188 ++++++++++++++++++++++++++++----------------------
1 file changed, 109 insertions(+), 79 deletions(-)
New commits:
commit 7bfbf55ae1b94ebe8e3ea9d13d820970b77e664d
Author: xisco <xiscofauli at libreoffice.org>
AuthorDate: Wed Jan 22 16:24:38 2020 +0100
Commit: xisco <xiscofauli at libreoffice.org>
CommitDate: Wed Jan 22 17:24:44 2020 +0100
QA: Add OS info
diff --git a/qa/createWikiStats.py b/qa/createWikiStats.py
index 14a1538..2689645 100755
--- a/qa/createWikiStats.py
+++ b/qa/createWikiStats.py
@@ -74,9 +74,10 @@ def util_increase_user_actions(statList, bug, mail, targets, action, actionTime)
statList['period'][period]['people'][mail][action] += 1
statList['period'][period]['people'][mail]['bugs'].append(bug)
-def util_create_bug(summary, component, version, keywords, creationDate, count_cc):
+def util_create_bug(summary, component, os, version, keywords, creationDate, count_cc):
return { 'summary': summary,
'component': component,
+ 'os': os,
'version': version,
'keywords': keywords,
'creationDate': creationDate,
@@ -131,7 +132,7 @@ def analyze_bugzilla_wiki_stats(statList, bugzillaData, cfg):
elif 'regression' in rowKeywords:
typeName = 'regressions'
statList['CC'][typeName][rowId] = util_create_bug(
- row['summary'], row['component'], row['version'], rowKeywords, creationDate, len(row['cc']))
+ row['summary'], row['component'], row['op_sys'], row['version'], rowKeywords, creationDate, len(row['cc']))
rowDupeOf = common.util_check_duplicated(bugzillaData, rowId)
if rowDupeOf and str(rowDupeOf) in bugzillaData['bugs'] and \
@@ -149,6 +150,7 @@ def analyze_bugzilla_wiki_stats(statList, bugzillaData, cfg):
statList['duplicates'][typeName][rowDupeOf] = util_create_bug(
bugzillaData['bugs'][str(rowDupeOf)]['summary'],
bugzillaData['bugs'][str(rowDupeOf)]['component'],
+ bugzillaData['bugs'][str(rowDupeOf)]['op_sys'],
bugzillaData['bugs'][str(rowDupeOf)]['version'],
bugzillaData['bugs'][str(rowDupeOf)]['keywords'],
datetime.datetime.strptime(
@@ -254,11 +256,11 @@ def create_wikimedia_table_for_cc_and_duplicates(cfg, statList):
table = []
if nameList == 'regressions':
- headers = ['Id', 'Summary', 'Component', 'Version', 'Bisected', 'Reported']
+ headers = ['Id', 'Summary', 'Component', 'OS', 'Version', 'Bisected', 'Reported']
elif nameList == 'enhancements':
- headers = ['Id', 'Summary', 'Component', 'Version', 'Reported']
+ headers = ['Id', 'Summary', 'Component', 'OS', 'Version', 'Reported']
else:
- headers = ['Id', 'Summary', 'Component', 'Version', 'EasyHack', 'Reported']
+ headers = ['Id', 'Summary', 'Component', 'OS', 'Version', 'EasyHack', 'Reported']
if typeList == 'CC':
headers.append('Total CC')
@@ -274,6 +276,7 @@ def create_wikimedia_table_for_cc_and_duplicates(cfg, statList):
row.append('[' + common.urlShowBug + str(k) + ' #tdf' + str(k) + ']')
row.append(v['summary'])
row.append(v['component'])
+ row.append(v['os'])
row.append(v['version'])
if nameList == 'regressions':
commit d82a458c79d384fd3f4bf9f8cdd71e8e5b234d69
Author: xisco <xiscofauli at libreoffice.org>
AuthorDate: Wed Jan 22 16:00:02 2020 +0100
Commit: xisco <xiscofauli at libreoffice.org>
CommitDate: Wed Jan 22 17:24:44 2020 +0100
QA: Create 3 kind of pages: regressions, enhancements and bugs
diff --git a/qa/createWikiStats.py b/qa/createWikiStats.py
index 97f868e..14a1538 100755
--- a/qa/createWikiStats.py
+++ b/qa/createWikiStats.py
@@ -21,9 +21,19 @@ def util_create_wiki_statList():
return {
'targets': {t:{'count':0, 'people':{}} for t in targets_list},
'period': {p:{'count':0, 'people':{}} for p in periods_list},
- 'MostCCBugs': {},
'dupesBugs': {},
- 'MostDupeBugs': {},
+ 'duplicates':
+ {
+ 'regressions': {},
+ 'enhancements': {},
+ 'bugs':{},
+ },
+ 'CC':
+ {
+ 'regressions': {},
+ 'enhancements': {},
+ 'bugs':{}
+ },
'people': {},
'stat': {'oldest': datetime.datetime.now(), 'newest': datetime.datetime(2001, 1, 1)}
}
@@ -115,25 +125,34 @@ def analyze_bugzilla_wiki_stats(statList, bugzillaData, cfg):
util_increase_user_actions(statList, key, creatorMail, bugTargets, 'created', creationDate)
if common.isOpen(rowStatus) and len(row['cc']) >= 10:
- statList['MostCCBugs'][rowId] = util_create_bug(
+ typeName = 'bugs'
+ if row['severity'] == "enhancement":
+ typeName = 'enhancements'
+ elif 'regression' in rowKeywords:
+ typeName = 'regressions'
+ statList['CC'][typeName][rowId] = util_create_bug(
row['summary'], row['component'], row['version'], rowKeywords, creationDate, len(row['cc']))
rowDupeOf = common.util_check_duplicated(bugzillaData, rowId)
- if rowDupeOf:
+ if rowDupeOf and str(rowDupeOf) in bugzillaData['bugs'] and \
+ common.isOpen(bugzillaData['bugs'][str(rowDupeOf)]['status']):
if rowDupeOf not in statList['dupesBugs']:
statList['dupesBugs'][rowDupeOf] = []
statList['dupesBugs'][rowDupeOf].append(rowId)
- if str(rowDupeOf) in bugzillaData['bugs'] and \
- common.isOpen(bugzillaData['bugs'][str(rowDupeOf)]['status']):
- if rowDupeOf not in statList['MostDupeBugs']:
- statList['MostDupeBugs'][rowDupeOf] = util_create_bug(
- bugzillaData['bugs'][str(rowDupeOf)]['summary'],
- bugzillaData['bugs'][str(rowDupeOf)]['component'],
- bugzillaData['bugs'][str(rowDupeOf)]['version'],
- bugzillaData['bugs'][str(rowDupeOf)]['keywords'],
- datetime.datetime.strptime(
- bugzillaData['bugs'][str(rowDupeOf)]['creation_time'], "%Y-%m-%dT%H:%M:%SZ"), 1)
+ typeName = 'bugs'
+ if bugzillaData['bugs'][str(rowDupeOf)]['severity'] == "enhancement":
+ typeName = 'enhancements'
+ elif 'regression' in bugzillaData['bugs'][str(rowDupeOf)]['keywords']:
+ typeName = 'regressions'
+
+ statList['duplicates'][typeName][rowDupeOf] = util_create_bug(
+ bugzillaData['bugs'][str(rowDupeOf)]['summary'],
+ bugzillaData['bugs'][str(rowDupeOf)]['component'],
+ bugzillaData['bugs'][str(rowDupeOf)]['version'],
+ bugzillaData['bugs'][str(rowDupeOf)]['keywords'],
+ datetime.datetime.strptime(
+ bugzillaData['bugs'][str(rowDupeOf)]['creation_time'], "%Y-%m-%dT%H:%M:%SZ"), 1)
for action in row['history']:
actionMail = action['who']
@@ -212,71 +231,79 @@ def analyze_bugzilla_wiki_stats(statList, bugzillaData, cfg):
statList['stat']['oldest'] = statOldDate.strftime("%Y-%m-%d")
print(" from " + statList['stat']['oldest'] + " to " + statList['stat']['newest'])
-def create_wikimedia_table_mostCCBugs_and_MostDupes(cfg, statList):
-
- for k, v in statList['dupesBugs'].items():
- if k in statList['MostDupeBugs']:
- if len(v) >= minNumOfDupes:
- statList['MostDupeBugs'][k]['count'] = len(v)
+def create_wikimedia_table_for_cc_and_duplicates(cfg, statList):
+
+ for nameList in statList['duplicates']:
+ for k, v in statList['dupesBugs'].items():
+ if k in statList['duplicates'][nameList]:
+ if len(v) >= minNumOfDupes:
+ statList['duplicates'][nameList][k]['count'] = len(v)
+ else:
+ del statList['duplicates'][nameList][k]
+
+ for typeList in ['duplicates','CC']:
+ for nameList in statList[typeList]:
+ fileName = typeList + '_' + nameList
+ print('Creating wikimedia table for ' + fileName)
+ output = ""
+
+ output += '{{TopMenu}}\n'
+ output += '{{Menu}}\n'
+ output += '{{Menu.QA}}\n'
+ output += '\n'
+ table = []
+
+ if nameList == 'regressions':
+ headers = ['Id', 'Summary', 'Component', 'Version', 'Bisected', 'Reported']
+ elif nameList == 'enhancements':
+ headers = ['Id', 'Summary', 'Component', 'Version', 'Reported']
else:
- del statList['MostDupeBugs'][k]
+ headers = ['Id', 'Summary', 'Component', 'Version', 'EasyHack', 'Reported']
- for nameList in ['MostCCBugs', 'MostDupeBugs']:
- print('Creating wikimedia table for ' + nameList)
- output = ""
-
- output += '{{TopMenu}}\n'
- output += '{{Menu}}\n'
- output += '{{Menu.QA}}\n'
- output += '\n'
- table = []
- headers = ['Id', 'Summary', 'Component', 'Version', 'isRegression', 'isBisected',
- 'isEasyHack', 'haveBackTrace', 'Reported']
- if nameList == 'MostCCBugs':
- headers.append('Total CC')
- output += '{} bugs have 10 or more emails in the CC list. (sorted in alphabetical order by number of users)\n'.format(
- len(statList['MostCCBugs']))
- else:
- headers.append('Total Duplicates')
- output += '{} open bugs have 3 or more duplicates. (sorted in alphabetical order by number of duplicates)\n'.format(
- len(statList['MostDupeBugs']))
-
- for k,v in statList[nameList].items():
- row = []
- row.append('[' + common.urlShowBug + str(k) + ' #tdf' + str(k) + ']')
- row.append(v['summary'])
- row.append(v['component'])
- row.append(v['version'])
- if 'regression' in v['keywords']:
- row.append('True')
- else:
- row.append('False')
- if 'bisected' in v['keywords']:
- row.append('True')
+ if typeList == 'CC':
+ headers.append('Total CC')
+ output += '{} {} have 10 or more people in the CC list. (sorted in alphabetical order by number of users)\n'.format(
+ len(statList['CC'][nameList]), nameList)
else:
- row.append('False')
- if 'easyHack' in v['keywords']:
- row.append('True')
- else:
- row.append('False')
- if 'haveBacktrace' in v['keywords']:
- row.append('True')
- else:
- row.append('False')
- row.append(v['creationDate'].strftime("%Y-%m-%d %H:%M:%S"))
- row.append(v['count'])
- table.append(row)
-
- output += tabulate(sorted(table, key = lambda x: x[9], reverse=True), headers, tablefmt='mediawiki')
- output += "\n"
- output +='Generated on {}.'.format(cfg['todayDate'])
- output += "\n"
- output += '[[Category:EN]]\n'
- output += '[[Category:QA/Stats]]'
-
- fp = open('/tmp/table_' + nameList + '.txt', 'w', encoding='utf-8')
- print(output.replace('wikitable', 'wikitable sortable'), file=fp)
- fp.close()
+ headers.append('Total Duplicates')
+ output += '{} open {} have 3 or more duplicates. (sorted in alphabetical order by number of duplicates)\n'.format(
+ len(statList['duplicates'][nameList]), nameList)
+
+ for k,v in statList[typeList][nameList].items():
+ row = []
+ row.append('[' + common.urlShowBug + str(k) + ' #tdf' + str(k) + ']')
+ row.append(v['summary'])
+ row.append(v['component'])
+ row.append(v['version'])
+
+ if nameList == 'regressions':
+ if 'bibisectNotNeeded' in v['keywords']:
+ row.append('Not Needed')
+ elif 'bisected' in v['keywords']:
+ row.append('True')
+ else:
+ row.append('False')
+
+ if nameList == 'bugs':
+ if 'easyHack' in v['keywords']:
+ row.append('True')
+ else:
+ row.append('False')
+
+ row.append(v['creationDate'].strftime("%Y-%m-%d %H:%M:%S"))
+ row.append(v['count'])
+ table.append(row)
+
+ output += tabulate(sorted(table, key = lambda x: x[len(headers) - 1], reverse=True), headers, tablefmt='mediawiki')
+ output += "\n"
+ output +='Generated on {}.'.format(cfg['todayDate'])
+ output += "\n"
+ output += '[[Category:EN]]\n'
+ output += '[[Category:QA/Stats]]'
+
+ fp = open('/tmp/table_' + fileName + '.txt', 'w', encoding='utf-8')
+ print(output.replace('wikitable', 'wikitable sortable'), file=fp)
+ fp.close()
def create_wikimedia_table_by_target(cfg, statList):
for kT,vT in sorted(statList['targets'].items()):
@@ -396,6 +423,6 @@ if __name__ == '__main__':
create_wikimedia_table_by_target(cfg, statList)
create_wikimedia_table_by_period(cfg, statList)
- create_wikimedia_table_mostCCBugs_and_MostDupes(cfg, statList)
+ create_wikimedia_table_for_cc_and_duplicates(cfg, statList)
print('End of report')
More information about the Libreoffice-commits
mailing list