[Libreoffice-commits] dev-tools.git: 2 commits - scripts/esc-mentoring.py
jan iversen
jani at documentfoundation.org
Sat Feb 13 12:23:55 UTC 2016
scripts/esc-mentoring.py | 130 +++++++++++++++++++++++++++++++++++++++--------
1 file changed, 110 insertions(+), 20 deletions(-)
New commits:
commit 8d5b88bdfdac05367da1dcdb64600cb60415f2c6
Author: jan iversen <jani at documentfoundation.org>
Date: Sat Feb 13 13:22:58 2016 +0100
mentoring tool
Allowed for weekend (monday need to collect info for more days).
diff --git a/scripts/esc-mentoring.py b/scripts/esc-mentoring.py
index 8c01467..499af67 100644
--- a/scripts/esc-mentoring.py
+++ b/scripts/esc-mentoring.py
@@ -39,9 +39,12 @@ def get_easyHacks() :
assign = ''
else :
assign = row[1]
+ status = row[2]
+ if status == 'REOPENED' :
+ status = 'NEW'
rawList[id] = {'id' : id,
'assign' : assign,
- 'status' : row[2],
+ 'status' : status,
'desc' : row[3],
'change' : datetime.datetime.strptime(row[4].split(' ')[0], '%Y-%m-%d').date(),
'reporter' : row[5],
@@ -101,9 +104,9 @@ def ESC_report(easyHacks, gerritOpen, gerritContributor) :
elif status == 'NEEDINFO' :
xInfo += 1
pInfo.append(row)
- elif status == 'NEW' or status == 'REOPENED' :
+ elif status == 'NEW' :
xOpen += 1
- if row['comments'] > 5 :
+ if row['comments'] >= 5 :
xComm += 1
if row['change'] <= mDate or row['whiteboard'] == 'ToBeReviewed':
xRevi += 1
@@ -112,13 +115,13 @@ def ESC_report(easyHacks, gerritOpen, gerritContributor) :
pNew.append(row)
print(' easyHacks: total {}: {} waiting for contributor, {} Assigned to contriburs, {} need info'.format(xTot, xOpen, xAssign, xInfo))
- print(' cleanup: {} has more than 5 comments, {} needs to be reviewed'.format(xComm, xRevi))
+ print(' cleanup: {} has more than 4 comments, {} needs to be reviewed'.format(xComm, xRevi))
print(' new last 8 days:')
for row in pNew :
print(' ', end='')
print(formatEasy(row))
if xInfo > 0 :
- print(' need info, please help:')
+ print(' need info (mentor or code pointer), please help:')
for row in pInfo :
print(' ', end='')
print(formatEasy(row))
@@ -126,9 +129,12 @@ def ESC_report(easyHacks, gerritOpen, gerritContributor) :
-def DAY_report(easyHacks, gerritOpen, gerritContributor) :
+def DAY_report(isWeekend, easyHacks, gerritOpen, gerritContributor) :
# Day report looks 2 days back
- cDate = datetime.date.today() - datetime.timedelta(days=2)
+ if isWeekend :
+ cDate = datetime.date.today() - datetime.timedelta(days=4)
+ else :
+ cDate = datetime.date.today() - datetime.timedelta(days=2)
print('*** day report ***')
print('new easyHacks:')
@@ -157,7 +163,7 @@ def MONTH_report(easyHacks, gerritOpen, gerritContributor) :
print(formatEasy(row))
print('easyHacks with more than 5 comments:')
for key, row in easyHacks.items():
- if row['comments'] > 5 :
+ if row['comments'] >= 5 :
print(' ', end='')
print(formatEasy(row))
print('easyHacks needing review:')
@@ -177,6 +183,7 @@ if __name__ == '__main__':
# check command line options
doESC = False
doDay = False
+ doWeek = False
doMonth = False
if len(sys.argv) <= 1 :
doESC = True
@@ -186,6 +193,8 @@ if __name__ == '__main__':
doESC = True
elif row.lower() == 'day' :
doDay = True
+ elif row.lower() == 'week' :
+ doWeek = True
elif row.lower() == 'month' :
doMonth = True
else :
@@ -199,9 +208,9 @@ if __name__ == '__main__':
if doESC :
ESC_report(easyHacks, gerritOpen, gerritContributor)
- if doDay :
+ if doDay or doWeek:
print("\n\n\n")
- DAY_report(easyHacks, gerritOpen, gerritContributor)
+ DAY_report(doWeek, easyHacks, gerritOpen, gerritContributor)
if doMonth :
print("\n\n\n")
MONTH_report(easyHacks, gerritOpen, gerritContributor)
commit 54a78fdb519fc363d8fc1351655808adf864b0f0
Author: jan iversen <jani at documentfoundation.org>
Date: Fri Feb 12 22:33:33 2016 +0100
mentoring tool
BZ with easyHack, completed for ESC and mentoring use.
diff --git a/scripts/esc-mentoring.py b/scripts/esc-mentoring.py
index 70a701c..8c01467 100644
--- a/scripts/esc-mentoring.py
+++ b/scripts/esc-mentoring.py
@@ -19,7 +19,7 @@ from urllib.request import urlopen, URLError
def get_easyHacks() :
url = 'https://bugs.documentfoundation.org/buglist.cgi?' \
'bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=VERIFIED&bug_status=NEEDINFO' \
- '&columnlist=Cbug_id%2Cassigned_to%2Cbug_status%2Cshort_desc%2Cchangeddate%2Creporter%2Clongdescs.count%2Copendate' \
+ '&columnlist=Cbug_id%2Cassigned_to%2Cbug_status%2Cshort_desc%2Cchangeddate%2Creporter%2Clongdescs.count%2Copendate%2Cstatus_whiteboard' \
'&keywords=easyHack%2C%20' \
'&keywords_type=allwords' \
'&query_format=advanced' \
@@ -39,14 +39,15 @@ def get_easyHacks() :
assign = ''
else :
assign = row[1]
- rawList[id] = {'id' : id,
- 'assign' : assign,
- 'status' : row[2],
- 'desc' : row[3],
- 'change' : datetime.datetime.strptime(row[4].split(' ')[0], '%Y-%m-%d').date(),
- 'reporter' : row[5],
- 'comments' : int(row[6]),
- 'created' : datetime.datetime.strptime(row[7].split(' ')[0], '%Y-%m-%d').date()
+ rawList[id] = {'id' : id,
+ 'assign' : assign,
+ 'status' : row[2],
+ 'desc' : row[3],
+ 'change' : datetime.datetime.strptime(row[4].split(' ')[0], '%Y-%m-%d').date(),
+ 'reporter' : row[5],
+ 'comments' : int(row[6]),
+ 'created' : datetime.datetime.strptime(row[7].split(' ')[0], '%Y-%m-%d').date(),
+ 'whiteboard' : row[8]
}
return rawList
@@ -76,21 +77,22 @@ def get_gerrit(doNonCom) :
def formatEasy(easyHack) :
- return 'https://bugs.documentfoundation.org/show_bug.cgi?id={} {}'.format(easyHack['id'], easyHack['desc'])
+ return 'https://bugs.documentfoundation.org/show_bug.cgi?id={} mentor:{} -> "{}"'.format(easyHack['id'], easyHack['reporter'], easyHack['desc'])
-def ESC_report(easyHacks) :
-
+def ESC_report(easyHacks, gerritOpen, gerritContributor) :
# prepare to count easyHacks, and list special status, new hacks (7 days)
xTot = len(easyHacks)
xAssign = 0
xOpen = 0
xInfo = 0
+ xComm = 0
+ xRevi = 0
pNew = []
pInfo = []
cDate = datetime.date.today() - datetime.timedelta(days=8)
-
+ mDate = datetime.date(2016, month=2, day=11)
for key, row in easyHacks.items():
# Calculate type of status
status = row['status']
@@ -101,12 +103,17 @@ def ESC_report(easyHacks) :
pInfo.append(row)
elif status == 'NEW' or status == 'REOPENED' :
xOpen += 1
+ if row['comments'] > 5 :
+ xComm += 1
+ if row['change'] <= mDate or row['whiteboard'] == 'ToBeReviewed':
+ xRevi += 1
if row['created'] >= cDate :
pNew.append(row)
- print(' easyHacks {}: {} ready to be worked on, {} being worked on, {} need info'.format(xTot, xOpen, xAssign, xInfo))
- print(' new since last:')
+ print(' easyHacks: total {}: {} waiting for contributor, {} Assigned to contriburs, {} need info'.format(xTot, xOpen, xAssign, xInfo))
+ print(' cleanup: {} has more than 5 comments, {} needs to be reviewed'.format(xComm, xRevi))
+ print(' new last 8 days:')
for row in pNew :
print(' ', end='')
print(formatEasy(row))
@@ -115,14 +122,88 @@ def ESC_report(easyHacks) :
for row in pInfo :
print(' ', end='')
print(formatEasy(row))
+ print(' gerrit: open patches {} from non-committers {} non-mergeable {} not reviewd {}'.format(0,0,0,0))
+
+
+
+def DAY_report(easyHacks, gerritOpen, gerritContributor) :
+ # Day report looks 2 days back
+ cDate = datetime.date.today() - datetime.timedelta(days=2)
+
+ print('*** day report ***')
+ print('new easyHacks:')
+ for key, row in easyHacks.items():
+ if row['created'] >= cDate :
+ print(' ', end='')
+ print(formatEasy(row))
+ print('changed easyHacks:')
+ for key, row in easyHacks.items():
+ if row['change'] >= cDate :
+ print(' ', end='')
+ print(formatEasy(row))
+def MONTH_report(easyHacks, gerritOpen, gerritContributor) :
+ # Month report looks 30 days back
+ cDate = datetime.date.today() - datetime.timedelta(days=30)
+ mDate = datetime.date(2016, month=2, day=11)
+
+ print('*** month report ***')
+ print('assigned easyHacks, no movement')
+ for key, row in easyHacks.items():
+ if row['change'] <= cDate and row['status'] == 'ASSIGNED':
+ print(' ', end='')
+ print(formatEasy(row))
+ print('easyHacks with more than 5 comments:')
+ for key, row in easyHacks.items():
+ if row['comments'] > 5 :
+ print(' ', end='')
+ print(formatEasy(row))
+ print('easyHacks needing review:')
+ for key, row in easyHacks.items():
+ if row['change'] <= mDate :
+ print(' ', end='')
+ print(formatEasy(row))
+ print('easyHacks needing review due to whiteboard:')
+ for key, row in easyHacks.items():
+ if row['whiteboard'] == 'ToBeReviewed' :
+ print(' ', end='')
+ print(formatEasy(row))
+
+
if __name__ == '__main__':
+ # check command line options
+ doESC = False
+ doDay = False
+ doMonth = False
+ if len(sys.argv) <= 1 :
+ doESC = True
+ else :
+ for row in sys.argv[1:] :
+ if row.lower() == 'esc' :
+ doESC = True
+ elif row.lower() == 'day' :
+ doDay = True
+ elif row.lower() == 'month' :
+ doMonth = True
+ else :
+ print('Illegal use {}, syntax: esc_mentoring.py esc day month'.format(row))
+ exit(-1)
+
+ # get data from bugzilla and gerrit
easyHacks = get_easyHacks()
gerritOpen = get_gerrit(False)
- gerritNonCommiter = get_gerrit(True)
-
- ESC_report(easyHacks)
+ gerritContributor = get_gerrit(True)
+
+ if doESC :
+ ESC_report(easyHacks, gerritOpen, gerritContributor)
+ if doDay :
+ print("\n\n\n")
+ DAY_report(easyHacks, gerritOpen, gerritContributor)
+ if doMonth :
+ print("\n\n\n")
+ MONTH_report(easyHacks, gerritOpen, gerritContributor)
+ print('end of report')
More information about the Libreoffice-commits
mailing list