[Libreoffice-commits] dev-tools.git: 2 commits - esc-reporting/esc-analyze.py esc-reporting/esc-collect.py

jan Iversen jani at libreoffice.org
Sun May 21 08:47:28 UTC 2017


 esc-reporting/esc-analyze.py |   36 ++++++++++++++++++++++++++----------
 esc-reporting/esc-collect.py |   23 ++++++++++++++++-------
 2 files changed, 42 insertions(+), 17 deletions(-)

New commits:
commit 17a696bb1f3c325935e1c6bb489a743bb6e419e4
Author: jan Iversen <jani at libreoffice.org>
Date:   Sun May 21 10:47:07 2017 +0200

    esc-analyze, added mail on error

diff --git a/esc-reporting/esc-analyze.py b/esc-reporting/esc-analyze.py
index de7ec26..b022a43 100755
--- a/esc-reporting/esc-analyze.py
+++ b/esc-reporting/esc-analyze.py
@@ -56,6 +56,21 @@ import xmltodict
 import re
 
 
+
+def util_errorMail(text):
+    print(text)
+    sendMail = 'mail -r mentoring at libreoffice.org -s "ERROR: esc-analyze FAILED" mentoring at libreoffice.org <<EOF\n' + text + '\nPlease have a look at vm174\nEOF\n'
+    os.system(sendMail)
+
+
+
+
+def util_errorMail(text):
+    print(text)
+    sendMail = 'mail -r mentoring at libreoffice.org -s "' + text + '" mentoring at libreoffice.org <<EOF\nPlease have a look at vm174\nEOF\n'
+    os.system(sendMail)
+
+
 def util_load_file(fileName):
     try:
       fp = open(fileName, encoding='utf-8')
@@ -290,7 +305,7 @@ def analyze_mentoring():
       statList['people'][mail]['gerrit']['reviewName'] = '{} <{}>'.format(row['name'],row['email'])
       statList['people'][mail]['isCommitter'] = True
       statList['people'][mail]['isContributor'] = True
-
+    x1 = statList['people']['thb at openoffice.org']
     statNewDate = cfg['1yearDate']
     statOldDate = cfg['nowDate']
     for key, row in gerritData['patch'].items():
@@ -690,6 +705,7 @@ def analyze_reports():
                 break
         except Exception as e:
           pass
+      x = statList['people'][reviewEmail]
       automateList['gerrit']['to_review'][rowTmp['id']] = {'name': statList['people'][reviewEmail]['gerrit']['reviewName'],
                                                            'patchset': rowTmp['patchset']}
 
@@ -899,43 +915,43 @@ def runAnalyze():
     try:
       runLoadCSV()
     except Exception as e:
-      print('ERROR: runLoadCSV failed with ' + str(e))
+      util_errorMail('ERROR: runLoadCSV failed with ' + str(e))
       pass
     try:
       analyze_mentoring()
     except Exception as e:
-      print('ERROR: analyze_mentoring failed with ' + str(e))
+      util_errorMail('ERROR: analyze_mentoring failed with ' + str(e))
       pass
     try:
       analyze_ui()
     except Exception as e:
-      print('ERROR: analyze_ui failed with ' + str(e))
+      util_errorMail('ERROR: analyze_ui failed with ' + str(e))
       pass
     try:
       analyze_qa()
     except Exception as e:
-      print('ERROR: analyze_qa failed with ' + str(e))
+      util_errorMail('ERROR: analyze_qa failed with ' + str(e))
       pass
     try:
       analyze_esc()
     except Exception as e:
-      print('ERROR: analyze_esc failed with ' + str(e))
+      util_errorMail('ERROR: analyze_esc failed with ' + str(e))
       pass
     try:
       analyze_myfunc()
     except Exception as e:
-      print('ERROR: analyze_myfunc failed with ' + str(e))
+      util_errorMail('ERROR: analyze_myfunc failed with ' + str(e))
       pass
     try:
       analyze_reports()
     except Exception as e:
-      print('ERROR: analyze_reports failed with ' + str(e))
+      util_errorMail('ERROR: analyze_reports failed with ' + str(e))
       pass
     try:
       analyze_final()
     except Exception as e:
-       print('ERROR: analyze_final failed with ' + str(e))
-       pass
+      util_errorMail('ERROR: analyze_final failed with ' + str(e))
+      pass
 
 
 def runUpgrade(args):
commit b73645bbd749f254038a898cfb47445239d31e89
Author: jan Iversen <jani at libreoffice.org>
Date:   Sun May 21 10:45:04 2017 +0200

    esc-report, added test for gerrit fail

diff --git a/esc-reporting/esc-collect.py b/esc-reporting/esc-collect.py
index 5c77d6a..1547a55 100755
--- a/esc-reporting/esc-collect.py
+++ b/esc-reporting/esc-collect.py
@@ -41,6 +41,12 @@ from requests.auth import HTTPDigestAuth
 
 
 
+def util_errorMail(text):
+    print(text)
+    sendMail = 'mail -r mentoring at libreoffice.org -s "ERROR: esc-collect FAILED" mentoring at libreoffice.org <<EOF\n' + text + '\nPlease have a look at vm174\nEOF\n'
+    os.system(sendMail)
+
+
 def util_load_file(fileName):
     try:
       fp = open(fileName, encoding='utf-8')
@@ -563,7 +569,10 @@ def get_gerrit(cfg):
     print("Updating gerrit dump from " + rawList['newest-entry'])
 
     rawList['committers'] = []
-    os.system('ssh gerrit.libreoffice.org "gerrit ls-members Committers" > /tmp/committerList')
+    r = os.system('ssh gerrit.libreoffice.org "gerrit ls-members Committers" > /tmp/committerList')
+    if r != 0:
+      raise Exception('ssh gerrit... failed')
+
     fp = open('/tmp/committerList', encoding='utf-8')
     tmp = fp.read().split('\n')[1:-1]
     fp.close()
@@ -714,32 +723,32 @@ def runBuild(cfg):
     try:
       gerritData = get_gerrit(cfg)
     except Exception as e:
-      print('ERROR: get_gerrit failed with ' + str(e))
+      util_errorMail('ERROR: get_gerrit failed with ' + str(e))
       pass
     try:
       crashData = get_crash(cfg)
     except Exception as e:
-      print('ERROR: get_crash failed with ' + str(e))
+      util_errorMail('ERROR: get_crash failed with ' + str(e))
       pass
     try:
       openhubData = get_openhub(cfg)
     except Exception as e:
-      print('ERROR: get_openhub failed with ' + str(e))
+      util_errorMail('ERROR: get_openhub failed with ' + str(e))
       pass
     try:
       bugzillaData = get_bugzilla(cfg)
     except Exception as e:
-      print('ERROR: get_bugzilla failed with ' + str(e))
+      util_errorMail('ERROR: get_bugzilla failed with ' + str(e))
       pass
     try:
       ESCData = get_esc_bugzilla(cfg)
     except Exception as e:
-      print('ERROR: get_esc_bugzilla failed with ' + str(e))
+      util_errorMail('ERROR: get_esc_bugzilla failed with ' + str(e))
       pass
     try:
       gitData = get_git(cfg)
     except Exception as e:
-      print('ERROR: get_git failed with ' + str(e))
+      util_errorMail('ERROR: get_git failed with ' + str(e))
       pass
 
 


More information about the Libreoffice-commits mailing list