[Libreoffice-commits] dev-tools.git: 3 commits - esc-reporting/qa-tools.py

Xisco Fauli anistenis at gmail.com
Wed Aug 16 11:12:57 UTC 2017


 esc-reporting/qa-tools.py |  122 +++++++++++++++++++++++++++++++++++++---------
 1 file changed, 99 insertions(+), 23 deletions(-)

New commits:
commit 3e2907052a16720d6348672a56502fb44cad28d9
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Wed Aug 16 13:11:15 2017 +0200

    QA tools: create the weekly report only when the argument is passed

diff --git a/esc-reporting/qa-tools.py b/esc-reporting/qa-tools.py
index ecf73ec..d21b737 100755
--- a/esc-reporting/qa-tools.py
+++ b/esc-reporting/qa-tools.py
@@ -1144,10 +1144,10 @@ if __name__ == '__main__':
             crashes_Report(statList)
         elif sys.argv[1] == 'untouched':
             untouchedBugs_Report(statList)
+        elif sys.argv[1] == 'weekly':
+            Weekly_Report(statList)
         else:
             print('You must use \'report\',\'blog\', \'target\', \'period\', \'users\' or \'crash\' as parameter.')
             sys.exit(1)
-    else:
-        Weekly_Report(statList)
 
     print('End of report')
commit c7aa4df5ccbbf67b35062810fb886c6471142c54
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Wed Aug 16 13:05:40 2017 +0200

    QA tools: list untouched bugs pinged more than once

diff --git a/esc-reporting/qa-tools.py b/esc-reporting/qa-tools.py
index 85e6a8a..ecf73ec 100755
--- a/esc-reporting/qa-tools.py
+++ b/esc-reporting/qa-tools.py
@@ -50,6 +50,8 @@ system_list = ['All', 'Linux (All)', 'Android', 'Windows (All)', 'Mac OS X (All)
 product_list = ['cppunit', 'Document Liberation Project', 'Impress Remote', 'libabw', 'libetonyek', 'libexttextcatYes',
         'libfreehand', 'libgltf', 'libmspub', 'libpagemaker', 'LibreOffice', 'LibreOffice Online', 'libvisio', 'QA Tools']
 
+pingComment = "** Please read this message in its entirety before responding **\n\nTo make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year."
+
 def util_load_file(fileName):
     try:
         fp = open(fileName, encoding='utf-8')
@@ -157,6 +159,12 @@ def util_create_statList():
                 'system_changed': {p: [[], []] for p in system_list}
             }
         },
+        'untouched':
+            {
+                '1year': [],
+                '2years': [],
+                '3years': []
+            },
         'people': {},
         'newUsersPeriod': {},
         'targets': {t:{'count':0, 'people':{}} for t in targets_list},
@@ -579,7 +587,8 @@ def analyze_bugzilla(statList, bugzillaData, cfg):
                                 addAssignedMail = actionMail
 
             commentMail = None
-            for comment in row['comments'][1:]:
+            comments = row['comments'][1:]
+            for comment in comments:
                 commentMail = comment['creator']
                 commentDate = datetime.datetime.strptime(comment['time'], "%Y-%m-%dT%H:%M:%SZ")
 
@@ -589,6 +598,17 @@ def analyze_bugzilla(statList, bugzillaData, cfg):
                 if commentDate >= cfg[reportPeriod]:
                     statList['detailedReport']['comments_count'] += 1
 
+
+            if len(comments) > 0 and comments[-1]["text"].startswith(pingComment):
+
+                if len(comments) > 1 and comments[-2]["text"].startswith(pingComment):
+                    if len(comments) > 2 and comments[-3]["text"].startswith(pingComment):
+                        statList['untouched']['3years'].append(rowId)
+                    else:
+                        statList['untouched']['2years'].append(rowId)
+                else:
+                    statList['untouched']['1year'].append(rowId)
+
             for person in row['cc_detail']:
                 email = person['email']
                 if commentMail == email or actionMail == email:
@@ -865,6 +885,25 @@ def create_wikimedia_table_by_period(cfg, statList):
         print(output.replace('wikitable', 'wikitable sortable'), file=fp)
         fp.close()
 
+def untouchedBugs_Report(startList):
+    fp = open('/tmp/untouch_report.txt', 'w', encoding='utf-8')
+
+    print('* Untouched Bugs Report from {} to {}'.format(cfg[reportPeriod].strftime("%Y-%m-%d"), statList['stat']['newest']), file=fp )
+
+    for key, value in sorted(statList['untouched'].items()):
+        print(file=fp)
+        print('* ' + key + ' - ' + str(len(value)) + ' bugs.', file=fp)
+        for i in range(0, len(value), 400):
+            url = "https://bugs.documentfoundation.org/buglist.cgi?bug_id="
+            subList = value[i:i + 400]
+            for bug in subList:
+                url += str(bug) + "%2C"
+            url = url[:-3]
+            shortener = Shortener('Tinyurl', timeout=9000)
+            print(str(len(subList)) + ' bugs: ' + shortener.short(url), file=fp)
+
+    fp.close()
+
 def users_Report(statList) :
     print('Users report from {} to {}'.format(cfg[newUsersPeriod].strftime("%Y-%m-%d"), statList['stat']['newest']))
     #fp = open('/tmp/users_report.txt', 'w', encoding='utf-8')
@@ -1103,6 +1142,8 @@ if __name__ == '__main__':
             users_Report(statList)
         elif sys.argv[1] == 'crash':
             crashes_Report(statList)
+        elif sys.argv[1] == 'untouched':
+            untouchedBugs_Report(statList)
         else:
             print('You must use \'report\',\'blog\', \'target\', \'period\', \'users\' or \'crash\' as parameter.')
             sys.exit(1)
commit 9a0212ecec1c20ddb9ad21a5fa9cd98980403209
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Wed Aug 16 13:00:44 2017 +0200

    QA tools: Collect data about resolved bugs

diff --git a/esc-reporting/qa-tools.py b/esc-reporting/qa-tools.py
index 4bb6bff..85e6a8a 100755
--- a/esc-reporting/qa-tools.py
+++ b/esc-reporting/qa-tools.py
@@ -22,7 +22,7 @@ newUsersPeriod = '7d'
 
 lastAction = '30d'
 
-targets_list = ['5.4.0']
+targets_list = ['5.3.5']
 
 periods_list = ['30d', '60d', '90d', '180d']
 
@@ -119,13 +119,16 @@ def util_create_statList():
             'enhancement_count': 0,
             'no_enhancement_count': 0,
             'created_week': {},
+            'resolved_week': {},
             'is_confirm_count': 0,
             'is_fixed': 0,
             'comments_count': 0,
             'bug_component': {},
             'bug_system': {},
             'bug_platform': {},
-            'bug_status': {},
+            'closed_count': 0,
+            'bug_status_open': {},
+            'bug_status_close': {},
             'bug_resolution': {},
             'backTraceStatus': {},
             'regressionStatus': {},
@@ -181,6 +184,9 @@ def get_bugzilla(cfg):
 def isOpen(status):
     return status == 'NEW' or status == 'ASSIGNED' or status == 'REOPENED'
 
+def isClosed(status):
+    return status == 'VERIFIED' or status == 'RESOLVED' or status == 'CLOSED'
+
 def util_increase_user_actions(statList, bug, mail, targets, action, actionTime):
     for target in targets:
         if mail not in statList['targets'][target]['people']:
@@ -250,14 +256,16 @@ def analyze_bugzilla(statList, bugzillaData, cfg):
                     statList['detailedReport']['bug_component'][component] = 0
                 statList['detailedReport']['bug_component'][component] += 1
 
-                if rowStatus not in statList['detailedReport']['bug_status']:
-                    statList['detailedReport']['bug_status'][rowStatus] = 0
-                statList['detailedReport']['bug_status'][rowStatus] += 1
+                if rowStatus not in statList['detailedReport']['bug_status_open']:
+                    statList['detailedReport']['bug_status_open'][rowStatus] = 0
+                statList['detailedReport']['bug_status_open'][rowStatus] += 1
+
+                if isClosed(row['status']):
+                    statList['detailedReport']['closed_count'] += 1
 
-                resolution = row['resolution']
-                if resolution not in statList['detailedReport']['bug_resolution']:
-                    statList['detailedReport']['bug_resolution'][resolution] = 0
-                statList['detailedReport']['bug_resolution'][resolution] += 1
+                    if rowResolution not in statList['detailedReport']['bug_resolution']:
+                        statList['detailedReport']['bug_resolution'][rowResolution] = 0
+                    statList['detailedReport']['bug_resolution'][rowResolution] += 1
 
                 platform = row['platform']
                 if platform not in statList['detailedReport']['bug_platform']:
@@ -324,6 +332,7 @@ def analyze_bugzilla(statList, bugzillaData, cfg):
             removeAssignedMail = ""
             backPortAdded = False
             backPortAddedMail = ""
+            bResolved = False
             for action in row['history']:
                 actionMail = action['who']
                 actionDate = datetime.datetime.strptime(action['when'], "%Y-%m-%dT%H:%M:%SZ")
@@ -373,9 +382,20 @@ def analyze_bugzilla(statList, bugzillaData, cfg):
                                 newerVersionMail = actionMail
 
                     if change['field_name'] == 'status':
-
                         addedStatus = change['added']
                         removedStatus = change['removed']
+
+                        if actionDate >= cfg[reportPeriod] and not bResolved and isClosed(addedStatus) and isClosed(row['status']):
+                            bResolved = True
+                            week = str(actionDate.year) + '-' + str(actionDate.strftime("%V"))
+                            if week not in statList['detailedReport']['resolved_week']:
+                                statList['detailedReport']['resolved_week'][week] = 0
+                            statList['detailedReport']['resolved_week'][week] += 1
+
+                            if rowStatus not in statList['detailedReport']['bug_status_close']:
+                                statList['detailedReport']['bug_status_close'][rowStatus] = 0
+                            statList['detailedReport']['bug_status_close'][rowStatus] += 1
+
                         if  addedStatus == 'RESOLVED' or addedStatus == 'VERIFIED':
                             if(rowResolution):
                                 addedStatus = addedStatus + "_" + rowResolution
@@ -729,19 +749,24 @@ def util_print_QA_line_blog(fp, statList, number, tuple, total_count):
 
     print(file=fp)
 
-def util_print_QA_line_created(fp, d , whole):
+def util_print_QA_line_created(fp, d , whole=None):
     others = 0
     s = [(k, d[k]) for k in sorted(d, key=d.get, reverse=True)]
     total = 0
     for k, v in s:
-        percent = 100 * float(v)/float(whole)
-        if percent >= 3:
-            print('{}: {} \t\t {}%'.format(k, v, percent), file=fp)
-            total += percent
+        if whole:
+            percent = 100 * float(v)/float(whole)
+            if percent >= 3:
+                print('{}: {} \t\t {}%'.format(k, v, percent), file=fp)
+                total += percent
+            else:
+                others += v
         else:
-            others += v
-    others_percent = 100 - total
-    print('OTHERS: {} \t\t {}%'.format(others, others_percent) , file=fp)
+            print('{}: {}'.format(k, v), file=fp)
+
+    if whole:
+        others_percent = 100 - total
+        print('OTHERS: {} \t\t {}%'.format(others, others_percent) , file=fp)
 
 
 def create_wikimedia_table_by_target(cfg, statList):
@@ -913,6 +938,16 @@ def Blog_Report(statList) :
     for key, value in sorted(statList['detailedReport']['created_week'].items()):
         print('{}: {}'.format(key, value), file=fp)
 
+    print(file=fp)
+    print('* Bugs resolved by week', file=fp)
+
+    for key, value in sorted(statList['detailedReport']['resolved_week'].items()):
+        print('{}: {}'.format(key, value), file=fp)
+
+    print(file=fp)
+    print('* Statuses of closed bugs', file=fp)
+    util_print_QA_line_created(fp, statList['detailedReport']['bug_status_close'])
+
     whole = statList['detailedReport']['created_count']
 
     print(file=fp)
@@ -929,12 +964,12 @@ def Blog_Report(statList) :
 
     print(file=fp)
     print('* Statuses of created bugs', file=fp)
-    util_print_QA_line_created(fp, statList['detailedReport']['bug_status'], whole)
+    util_print_QA_line_created(fp, statList['detailedReport']['bug_status_open'], whole)
 
     print(file=fp)
     print('* Resolution of created bugs', file=fp)
     util_print_QA_line_created(fp, statList['detailedReport']['bug_resolution'],
-        statList['detailedReport']['bug_status']['RESOLVED'])
+        statList['detailedReport']['closed_count'])
 
     print(file=fp)
     print('* Regressions statuses', file=fp)


More information about the Libreoffice-commits mailing list