[Libreoffice-commits] dev-tools.git: qa/bugzillaChecker.py qa/common.py qa/createWikiStats.py

2019-11-29 Thread Xisco Fauli (via logerrit)
 qa/bugzillaChecker.py |   41 -
 qa/common.py  |   13 +
 qa/createWikiStats.py |   15 +--
 3 files changed, 50 insertions(+), 19 deletions(-)

New commits:
commit c623f77a3b60f1f6c8945dca57ab5274adff508c
Author: Xisco Fauli 
AuthorDate: Fri Nov 29 13:57:20 2019 +0100
Commit: Xisco Fauli 
CommitDate: Fri Nov 29 14:29:14 2019 +0100

QA: Change priority based on number of duplicates

diff --git a/qa/bugzillaChecker.py b/qa/bugzillaChecker.py
index 9909b9a..0c7edff 100755
--- a/qa/bugzillaChecker.py
+++ b/qa/bugzillaChecker.py
@@ -48,6 +48,8 @@ versionsToCheck = ('5', '6')
 
 crashReportDomain = "https://crashreport.libreoffice.org/stats/signature/;
 
+minNumOfDupes = 5
+
 def util_create_statList_checkers():
 return {
 'people': {}
@@ -63,6 +65,7 @@ def analyze_bugzilla_checkers(statList, bugzillaData, cfg):
 print("Analyzing bugzilla chekers\n", end="", flush=True)
 
 lResults = {}
+dupesBugs = {}
 
 for key, row in bugzillaData['bugs'].items():
 rowId = row['id']
@@ -85,6 +88,16 @@ def analyze_bugzilla_checkers(statList, bugzillaData, cfg):
 
 common.util_check_bugzilla_mail(statList, creatorMail, 
row['creator_detail']['real_name'], creationDate, rowId)
 
+if common.isOpen(rowStatus) and rowId not in dupesBugs:
+dupesBugs[rowId] = { 'total': 0, 'priority': row['priority'], 
'severity': row['severity'] }
+
+rowDupeOf = common.util_check_duplicated(bugzillaData, rowId)
+if rowDupeOf and 
common.isOpen(bugzillaData['bugs'][str(rowDupeOf)]['status']):
+if rowDupeOf not in dupesBugs:
+dupesBugs[rowDupeOf] = { 'total': 0, 'priority': 
bugzillaData['bugs'][str(rowDupeOf)]['priority'],
+'severity': 
bugzillaData['bugs'][str(rowDupeOf)]['severity'] }
+dupesBugs[rowDupeOf]['total'] += 1
+
 crashSignature = row['cf_crashreport']
 if crashSignature:
 resultValue = [ rowId, creationDate, '']
@@ -386,6 +399,19 @@ def analyze_bugzilla_checkers(statList, bugzillaData, cfg):
 value = [rowId, '', '']
 util_add_to_result(lResults, 'empty_alias', value)
 
+for k, v in dupesBugs.items():
+if v['severity'] == 'enhancement':
+if v['total'] < minNumOfDupes and (v['priority'] == 'high' or 
v['priority'] == 'highest'):
+value = [k, '', '']
+util_add_to_result(lResults, 
'change_enhancement_priority_to_medium', value)
+elif v['total'] >= minNumOfDupes and (v['priority'] != 'high' and 
v['priority'] != 'highest'):
+value = [k, '', '']
+util_add_to_result(lResults, 
'change_enhancement_priority_to_high', value)
+else:
+if v['total'] >= minNumOfDupes and (v['priority'] != 'high' and 
v['priority'] != 'highest'):
+value = [k, '', '']
+util_add_to_result(lResults, 'change_bug_priority_to_high', 
value)
+
 fp = open(bugzillaReportPath, 'w', encoding='utf-8')
 print("Creating file " + bugzillaReportPath)
 
@@ -400,11 +426,16 @@ def analyze_bugzilla_checkers(statList, bugzillaData, 
cfg):
 dValue[idx][1] = 
datetime.datetime.strptime(dValue[idx][1], "%Y-%m-%dT%H:%M:%SZ")
 
 count = idx + 1
-print("{:<3} | {:<58} | {} | {}".format(
-str(count), common.urlShowBug + str(dValue[idx][0]),
-str(dValue[idx][1].strftime("%Y-%m-%d")),
-str(dValue[idx][2])),
-file=fp)
+if dValue[idx][1]:
+print("{:<3} | {:<58} | {} | {}".format(
+str(count), common.urlShowBug + str(dValue[idx][0]),
+str(dValue[idx][1].strftime("%Y-%m-%d")),
+str(dValue[idx][2])),
+file=fp)
+else:
+print("{:<3} | {:<58}".format(
+str(count), common.urlShowBug + str(dValue[idx][0])),
+file=fp)
 
 if count != len(dValue) and count % 10 == 0:
 print('=' * 100, file=fp)
diff --git a/qa/common.py b/qa/common.py
index 51a9b47..52a5cdd 100755
--- a/qa/common.py
+++ b/qa/common.py
@@ -80,6 +80,19 @@ def util_create_person_bugzilla(email, name):
  'bugs': set()
 }
 
+def util_check_duplicated(bugzillaData, bugID, isFirst=True):
+rowDupeOf = bugzillaData['bugs'][str(bugID)]['dupe_of']
+if rowDupeOf:
+if str(rowDupeOf) in bugzillaData['bugs']:
+return util_check_duplicated(bugzillaData, rowDupeOf, False)
+else:
+return bugID
+else:
+if isFirst:
+return None
+else:
+return bugID
+
 def 

[Libreoffice-commits] dev-tools.git: qa/bugzillaChecker.py qa/common.py

2019-08-07 Thread Xisco Fauli (via logerrit)
 qa/bugzillaChecker.py |8 +++-
 qa/common.py  |3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 2ed0c279c652880614dfa98b4c9cb8703d0c8323
Author: Xisco Fauli 
AuthorDate: Wed Aug 7 14:03:00 2019 +0200
Commit: Xisco Fauli 
CommitDate: Wed Aug 7 14:40:09 2019 +0200

QA: Save config info in file

diff --git a/qa/bugzillaChecker.py b/qa/bugzillaChecker.py
index df9e5a0..9909b9a 100755
--- a/qa/bugzillaChecker.py
+++ b/qa/bugzillaChecker.py
@@ -426,13 +426,15 @@ def analyze_bugzilla_checkers(statList, bugzillaData, 
cfg):
 isEasyHack = True
 print("{:<3} | {:<58} | {}".format(
 str(idx + 1), common.urlShowBug + str(lBugs[idx]), 
'easyHack: ' + str(isEasyHack)), file=fp)
+
cfg['configQA']['ignore']['newContributors'].append(statList['people'][k]['email'])
 
-if statList['people'][k]['oldest'] >= cfg['memberPeriod'] and 
statList['people'][k]['newest'] >= cfg['reportPeriod'] and \
+if statList['people'][k]['oldest'] >= cfg['memberPeriod'] and \
 len(statList['people'][k]['bugs']) >= memberBugs and 
statList['people'][k]['email'] not in cfg['configQA']['ignore']['members']:
 print('\n=== New MEMBER: ' + statList['people'][k]['name'] + " ("  
+ statList['people'][k]['email'] + ") ===", file=fp)
 print('\tOldest: ' + 
statList['people'][k]['oldest'].strftime("%Y-%m-%d"), file=fp)
 print('\tNewest: ' + 
statList['people'][k]['newest'].strftime("%Y-%m-%d"), file=fp)
 print('\tTotal: ' + str(len(statList['people'][k]['bugs'])), 
file=fp)
+
cfg['configQA']['ignore']['members'].append(statList['people'][k]['email'])
 
 if statList['people'][k]['newest'] < cfg['oldUserPeriod'] and 
statList['people'][k]['newest'] >= cfg['oldUserPeriod2'] and \
 len(statList['people'][k]['bugs']) >= oldUserBugs and 
statList['people'][k]['email'] not in 
cfg['configQA']['ignore']['oldContributors']:
@@ -440,11 +442,15 @@ def analyze_bugzilla_checkers(statList, bugzillaData, 
cfg):
 print('\tOldest: ' + 
statList['people'][k]['oldest'].strftime("%Y-%m-%d"), file=fp)
 print('\tNewest: ' + 
statList['people'][k]['newest'].strftime("%Y-%m-%d"), file=fp)
 print('\tTotal: ' + str(len(statList['people'][k]['bugs'])), 
file=fp)
+
cfg['configQA']['ignore']['oldContributors'].append(statList['people'][k]['email'])
 
 statList['people'][k]['oldest'] = 
statList['people'][k]['oldest'].strftime("%Y-%m-%d")
 statList['people'][k]['newest'] = 
statList['people'][k]['newest'].strftime("%Y-%m-%d")
 
 fp.close()
+dumpResult = {}
+dumpResult['configQA'] = cfg['configQA']
+common.util_dump_config(dumpResult)
 
 def runCfg():
 cfg = common.get_config()
diff --git a/qa/common.py b/qa/common.py
index 3b94860..51a9b47 100755
--- a/qa/common.py
+++ b/qa/common.py
@@ -60,8 +60,9 @@ def util_load_file(fileName):
 pass
 return rawData
 
-def util_dump_file(fileName, rawList):
+def util_dump_config(rawList):
 try:
+fileName = configDir + 'configQA.json'
 fp = open(fileName, 'w', encoding='utf-8')
 json.dump(rawList, fp, ensure_ascii=False, indent=4, sort_keys=True)
 fp.close()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits