Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into...
[openembedded.git] / contrib / weekly-changelog-report.py
1 #!/usr/bin/python
2
3
4 # generates an OE changelog for last weeks activity (Mon-Sun) assuming it is run on
5 # any day of the following week
6
7 # TODO
8 # - remove patch count as it does not match after we remove "Merge branch" statements
9 # - add bugzilla info
10
11 import datetime
12 import os
13 import sys
14 import string
15
16 today = datetime.date.today()
17
18 # 0 = Mon, 6 = Sun
19 today_weekday = today.weekday()
20
21 # find Mon of this week
22 end_day = today - datetime.timedelta(today_weekday)
23
24 start_day = end_day - datetime.timedelta(7)
25
26 if (len(sys.argv) <= 1):
27     branch = "origin/org.openembedded.dev"
28 else:
29     branch = sys.argv[1]
30
31 branch_pretty = string.replace(branch, "origin/", "")
32
33 print "OE weekly changelog for %s, %s to %s\n" % (branch_pretty, start_day.isoformat(), end_day.isoformat())
34 os.system("git shortlog --since=%s --until=%s %s | grep -v 'Merge branch' | grep -v 'Merge commit'|sed -e 's/^    //g'|cut -b -78 " % (start_day.isoformat(), end_day.isoformat(), branch))
35
36 sys.exit(0)
37
38 os.system("wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&bugidtype=include&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&known_name=1WFixed&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=RESOLVED%2CVERIFIED%2CCLOSED&value0-0-0=&ctype=csv' -O resolved-bugs.csv >& /dev/null")
39 os.system("wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=NEW&bugidtype=include&chfield=%5BBug%20creation%5D&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=NEW&value0-0-0=&ctype=csv' -O new-bugs.csv &> /dev/null")
40
41
42 print "====================================================="
43 print "Bugs fixed:\n"
44
45 os.system("cat resolved-bugs.csv | awk -F, '{print $1 \" \" $7 \"\t \" $8}' | sed s:\\\"::g")
46
47 print "\nBugs opened:\n"
48
49 os.system("cat new-bugs.csv | awk -F, '{print $1 \" \" $7 \"\t \" $8}' | sed s:\\\"::g")
50
51