[Libreoffice-commits] dev-tools.git: 6 commits - qa/createBlogReport.py

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 27 17:58:16 UTC 2018


 qa/createBlogReport.py |  134 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 123 insertions(+), 11 deletions(-)

New commits:
commit f5077efa516aa8ae2515d38fdfe0f546f4870e00
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Dec 27 18:55:20 2018 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Dec 27 18:57:53 2018 +0100

    QA: Add chart for Most Pressing Bugs evolution

diff --git a/qa/createBlogReport.py b/qa/createBlogReport.py
index 18a0e28..f2512e4 100755
--- a/qa/createBlogReport.py
+++ b/qa/createBlogReport.py
@@ -37,6 +37,7 @@ def util_create_statList():
         'people' : {},
         'unconfirmedCount' : {},
         'regressionCount' : {},
+        'MPBCount' : {},
         'stat': {'oldest': datetime.now(), 'newest': datetime(2001, 1, 1)}
     }
 
@@ -77,6 +78,7 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
 
     unconfirmedCountPerDay = {}
     regressionsCountPerDay = {}
+    MPBCountPerDay = {}
     fixedBugs = []
     for key, row in bugzillaData['bugs'].items():
         rowId = row['id']
@@ -118,6 +120,8 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
             authorVerified = None
             isRegression = False
             isRegressionClosed = False
+            isMPB = False
+            isMPBClosed = False
 
             for action in row['history']:
                 actionMail = action['who']
@@ -130,6 +134,24 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
                 diffTime = (actionDate - creationDate).days
 
                 for change in action['changes']:
+                        if change['field_name'] == 'priority':
+                            addedPriority = change['added']
+                            removedPriority = change['removed']
+
+                            if not isMPBClosed:
+                                if not isMPB and addedPriority == "highest":
+                                    strDay = actionDate.strftime("%Y-%m-%d")
+                                    if strDay not in MPBCountPerDay:
+                                        MPBCountPerDay[strDay] = 0
+                                    MPBCountPerDay[strDay] += 1
+                                    isMPB = True
+
+                                if isMPB and removedPriority == "highest":
+                                    strDay = actionDate.strftime("%Y-%m-%d")
+                                    if strDay not in MPBCountPerDay:
+                                        MPBCountPerDay[strDay] = 0
+                                    MPBCountPerDay[strDay] -= 1
+                                    isMPB = False
 
                         if change['field_name'] == 'status':
                             addedStatus = change['added']
@@ -166,6 +188,22 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
                                     regressionsCountPerDay[strDay] -= 1
                                     isRegressionClosed = True
 
+                            if isMPB:
+                                # the MPB is being reopened
+                                if isMPBClosed and common.isOpen(addedStatus):
+                                    strDay = actionDate.strftime("%Y-%m-%d")
+                                    if strDay not in MPBCountPerDay:
+                                        MPBCountPerDay[strDay] = 0
+                                    MPBCountPerDay[strDay] += 1
+                                    isMPBClosed = False
+
+                                # the MPB is being closed
+                                if not isMPBClosed and common.isClosed(addedStatus):
+                                    strDay = actionDate.strftime("%Y-%m-%d")
+                                    if strDay not in MPBCountPerDay:
+                                        MPBCountPerDay[strDay] = 0
+                                    MPBCountPerDay[strDay] -= 1
+                                    isMPBClosed = True
 
                             if check_date(actionDate, cfg):
                                 if removedStatus == "UNCONFIRMED":
@@ -297,6 +335,14 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
 
         statList['regressionCount'][single_day] = totalCount2
 
+        totalCount3 = 0
+        for k, v in MPBCountPerDay.items():
+            xDay = datetime.strptime( k, "%Y-%m-%d")
+            if xDay < single_date:
+                totalCount3 += v
+
+        statList['MPBCount'][single_day] = totalCount3
+
 def makeStrong(text):
     return "<strong>" + str(text) + "</strong>"
 
@@ -400,6 +446,12 @@ def createReport(statList):
     print(file=fp)
     createPlot(statList['regressionCount'], "line", "Open regressions Per Day", "open regressions", "green")
 
+    print(makeH2("Evolution of Most Pressing Bugs"), file=fp)
+    print(file=fp)
+    print('<img src="PATH_HERE/Most_Mressing_Bugs.png" alt="" width="640" height="480" class="alignnone size-full" />', file=fp)
+    print(file=fp)
+    createPlot(statList['MPBCount'], "line", "Most Pressing Bugs Per Day", "Most Pressing Bugs", "orange")
+
     print(makeStrong('Thank you all for making Libreoffice rock!'), file=fp)
     print(makeStrong('Join us and help to keep LibreOffice super reliable!'), file=fp)
     print(makeStrong('Check <a href="https://wiki.documentfoundation.org/QA/GetInvolved">the Get Involved page</a> out now!'), file=fp)
commit 6abc04d5c6d8bde8d0206864fce0c8355bd313a6
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Dec 27 18:22:41 2018 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Dec 27 18:57:53 2018 +0100

    QA: Add chart for regressions evolution

diff --git a/qa/createBlogReport.py b/qa/createBlogReport.py
index 380f9f8..18a0e28 100755
--- a/qa/createBlogReport.py
+++ b/qa/createBlogReport.py
@@ -36,6 +36,7 @@ def util_create_statList():
         'keywords': { k : util_create_basic_schema() for k in lKeywords},
         'people' : {},
         'unconfirmedCount' : {},
+        'regressionCount' : {},
         'stat': {'oldest': datetime.now(), 'newest': datetime(2001, 1, 1)}
     }
 
@@ -75,6 +76,7 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
 
 
     unconfirmedCountPerDay = {}
+    regressionsCountPerDay = {}
     fixedBugs = []
     for key, row in bugzillaData['bugs'].items():
         rowId = row['id']
@@ -114,6 +116,9 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
             dayVerified = None
             authorConfirmed = None
             authorVerified = None
+            isRegression = False
+            isRegressionClosed = False
+
             for action in row['history']:
                 actionMail = action['who']
                 actionDate = datetime.strptime(action['when'], "%Y-%m-%dT%H:%M:%SZ")
@@ -144,6 +149,24 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
                                         unconfirmedCountPerDay[strDay] = 0
                                     unconfirmedCountPerDay[strDay] += 1
 
+                            if isRegression:
+                                # the regression is being reopened
+                                if isRegressionClosed and common.isOpen(addedStatus):
+                                    strDay = actionDate.strftime("%Y-%m-%d")
+                                    if strDay not in regressionsCountPerDay:
+                                        regressionsCountPerDay[strDay] = 0
+                                    regressionsCountPerDay[strDay] += 1
+                                    isRegressionClosed = False
+
+                                # the regression is being closed
+                                if not isRegressionClosed and common.isClosed(addedStatus):
+                                    strDay = actionDate.strftime("%Y-%m-%d")
+                                    if strDay not in regressionsCountPerDay:
+                                        regressionsCountPerDay[strDay] = 0
+                                    regressionsCountPerDay[strDay] -= 1
+                                    isRegressionClosed = True
+
+
                             if check_date(actionDate, cfg):
                                 if removedStatus == "UNCONFIRMED":
                                     util_increase_action(statList['confirmed'], rowId, actionMail, actionDay, diffTime)
@@ -178,12 +201,29 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
                                     isFixed = False
 
                         elif change['field_name'] == 'keywords':
+                            keywordsAdded = change['added'].split(", ")
+                            keywordsRemoved = change['removed'].split(", ")
+
                             if check_date(actionDate, cfg):
-                                keywordsAdded = change['added'].split(", ")
                                 for keyword in keywordsAdded:
                                     if keyword in lKeywords:
-                                        if keyword in rowKeywords:
-                                            util_increase_action(statList['keywords'][keyword], rowId, actionMail, actionDay, diffTime)
+                                        util_increase_action(statList['keywords'][keyword], rowId, actionMail, actionDay, diffTime)
+
+                            if not isRegressionClosed:
+                                if not isRegression and 'regression' in keywordsAdded:
+                                    strDay = actionDate.strftime("%Y-%m-%d")
+                                    if strDay not in regressionsCountPerDay:
+                                        regressionsCountPerDay[strDay] = 0
+                                    regressionsCountPerDay[strDay] += 1
+                                    isRegression = True
+
+                                if isRegression and 'regression' in keywordsRemoved:
+                                    strDay = actionDate.strftime("%Y-%m-%d")
+                                    if strDay not in regressionsCountPerDay:
+                                        regressionsCountPerDay[strDay] = 0
+                                    regressionsCountPerDay[strDay] -= 1
+                                    isRegression = False
+
 
                         elif change['field_name'] == 'blocks':
                             if check_date(actionDate, cfg):
@@ -241,13 +281,21 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg):
                     if single_day not in statList[k0]['day']:
                         statList[k0]['day'][single_day] = 0
 
-        totalCount = 0
+        totalCount1 = 0
         for k, v in unconfirmedCountPerDay.items():
             xDay = datetime.strptime( k, "%Y-%m-%d")
             if xDay < single_date:
-                totalCount += v
+                totalCount1 += v
+
+        statList['unconfirmedCount'][single_day] = totalCount1
 
-        statList['unconfirmedCount'][single_day] = totalCount
+        totalCount2 = 0
+        for k, v in regressionsCountPerDay.items():
+            xDay = datetime.strptime( k, "%Y-%m-%d")
+            if xDay < single_date:
+                totalCount2 += v
+
+        statList['regressionCount'][single_day] = totalCount2
 
 def makeStrong(text):
     return "<strong>" + str(text) + "</strong>"
@@ -346,6 +394,12 @@ def createReport(statList):
     print(file=fp)
     createPlot(statList['unconfirmedCount'], "line", "Unconfirmed Bugs Per Day", "Unconfirmed Bugs", "blue")
 
+    print(makeH2("Evolution of Open Regressions"), file=fp)
+    print(file=fp)
+    print('<img src="PATH_HERE/open_regressions.png" alt="" width="640" height="480" class="alignnone size-full" />', file=fp)
+    print(file=fp)
+    createPlot(statList['regressionCount'], "line", "Open regressions Per Day", "open regressions", "green")
+
     print(makeStrong('Thank you all for making Libreoffice rock!'), file=fp)
     print(makeStrong('Join us and help to keep LibreOffice super reliable!'), file=fp)
     print(makeStrong('Check <a href="https://wiki.documentfoundation.org/QA/GetInvolved">the Get Involved page</a> out now!'), file=fp)
commit 445b244060094fdcfb62bf195bf59efe6e1c051f
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Dec 27 15:58:09 2018 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Dec 27 18:57:53 2018 +0100

    QA: Add empty lines if we don't reach 10

diff --git a/qa/createBlogReport.py b/qa/createBlogReport.py
index 211c3f5..380f9f8 100755
--- a/qa/createBlogReport.py
+++ b/qa/createBlogReport.py
@@ -308,8 +308,13 @@ def createSection(fp, value, sectionName, action, actionPerson, plotColor):
         else:
             print(makeLI("{} ( {} )".format(statList['people'][item[0]]['name'], item[1])), file=fp)
         itCount += 1
+
     print("</ol>", file=fp)
 
+    while itCount <= 10:
+        print(" ",file=fp)
+        itCount += 1
+
     createPlot(value['day'], "bar", sectionName + " Per Day", sectionName, plotColor)
 
 def createList(fp, value, listName):
commit 7664b1f54a6446af9552e90f3ca146f2d637cde7
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Dec 27 13:26:56 2018 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Dec 27 18:57:53 2018 +0100

    QA: Add tdf# to links' text

diff --git a/qa/createBlogReport.py b/qa/createBlogReport.py
index 70e4cc4..211c3f5 100755
--- a/qa/createBlogReport.py
+++ b/qa/createBlogReport.py
@@ -317,7 +317,8 @@ def createList(fp, value, listName):
     print(makeStrong(listName), file=fp)
     print("<ol>", file=fp)
     for k, v in value.items():
-        print(makeLI("{} {} ( Thanks to {} )".format(makeLink(urlPath + str(k), str(k)), v['summary'], v['author'])), file=fp)
+        print(makeLI("{} {} ( Thanks to {} )".format(makeLink(urlPath + str(k), "tdf#" +  str(k)),
+            v['summary'], v['author'])), file=fp)
     print("</ol>", file=fp)
     print(file=fp)
 
commit 444ce2bdaf699f6e12a8aa0f7c70c25772563e10
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Dec 27 13:21:48 2018 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Dec 27 18:57:53 2018 +0100

    QA: Make images smaller and aligned to the right

diff --git a/qa/createBlogReport.py b/qa/createBlogReport.py
index 84314c7..70e4cc4 100755
--- a/qa/createBlogReport.py
+++ b/qa/createBlogReport.py
@@ -294,6 +294,9 @@ def createSection(fp, value, sectionName, action, actionPerson, plotColor):
 
     print(file=fp)
     print(makeStrong("Top 10 " + actionPerson), file=fp)
+    print('<a href="PATH_HERE/' + sectionName.replace(' ', '_') + \
+            '.png" rel="noopener"><img class="alignright" src="PATH_HERE/' + sectionName.replace(' ', '_') + \
+            '.png" alt="" width="300" height="225" /></a>', file=fp)
     print("<ol>", file=fp)
     sortedList = sorted(value["author"].items(), key=lambda x: x[1], reverse=True)
     itCount = 1
@@ -306,10 +309,6 @@ def createSection(fp, value, sectionName, action, actionPerson, plotColor):
             print(makeLI("{} ( {} )".format(statList['people'][item[0]]['name'], item[1])), file=fp)
         itCount += 1
     print("</ol>", file=fp)
-    print(file=fp)
-    print('<img src="PATH_HERE/' + sectionName.replace(' ', '_') + \
-            '.png" alt="" width="640" height="480" class="alignnone size-full" />', file=fp)
-    print(file=fp)
 
     createPlot(value['day'], "bar", sectionName + " Per Day", sectionName, plotColor)
 
commit 04b3cbee30eea6f8a79915a720f20b2916460dc2
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Dec 27 13:12:37 2018 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Dec 27 18:57:53 2018 +0100

    QA: Add regression to the blog report

diff --git a/qa/createBlogReport.py b/qa/createBlogReport.py
index 87abbf2..84314c7 100755
--- a/qa/createBlogReport.py
+++ b/qa/createBlogReport.py
@@ -332,6 +332,7 @@ def createReport(statList):
     createList(fp, statList['criticalFixed'], "List of critical bugs fixed")
     createSection(fp, statList['verified'], "Verified bug fixes", "verified", "Verifiers", "palegreen")
     createSection(fp, statList['metabug'], "Categorized Bugs", "categorized with a metabug", "Categorizers", "lightpink")
+    createSection(fp, statList['keywords']['regression'], "Regression Bugs", "set as regressions", "", "mediumpurple")
     createSection(fp, statList['keywords']['bisected'], "Bisected Bugs", "bisected", "Bisecters", "orange")
 
     print(makeH2("Evolution of Unconfirmed Bugs"), file=fp)


More information about the Libreoffice-commits mailing list