You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2015/10/08 15:36:42 UTC
svn commit: r1707542 - in /comdev/reporter.apache.org/trunk/site: getjson.py
render.js
Author: sebb
Date: Thu Oct 8 13:36:42 2015
New Revision: 1707542
URL: http://svn.apache.org/viewvc?rev=1707542&view=rev
Log:
Add bugzilla stats handling
Modified:
comdev/reporter.apache.org/trunk/site/getjson.py
comdev/reporter.apache.org/trunk/site/render.js
Modified: comdev/reporter.apache.org/trunk/site/getjson.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/getjson.py?rev=1707542&r1=1707541&r2=1707542&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/getjson.py (original)
+++ comdev/reporter.apache.org/trunk/site/getjson.py Thu Oct 8 13:36:42 2015
@@ -250,6 +250,13 @@ if m:
with open("/var/www/reporter.apache.org/data/projects.json", "r") as f:
cchanges = json.loads(f.read())
f.close()
+ bugzillastats = {}
+ try:
+ with open("/var/www/reporter.apache.org/data/bugzillastats.json", "r") as f:
+ bugzillastats = json.loads(f.read())
+ f.close()
+ except:
+ pass
uid = m.group(1)
groups = getPMCs(uid)
include = os.environ['QUERY_STRING'] if 'QUERY_STRING' in os.environ else None
@@ -288,6 +295,7 @@ if m:
pmcdates = json.loads(f.read())
f.close()
dates = {}
+ bdata = {} # bugzilla data
jdata = {}
cdata = {}
ddata = {}
@@ -309,6 +317,10 @@ if m:
jdata[group] = [0,0, None]
ddata[group], allpmcs, health[group] = getProjectData(group)
rdata[group] = getReleaseData(group)
+ if group in bugzillastats:
+ bdata[group] = bugzillastats[group]
+ else:
+ bdata[group] = [0,0,{}]
jiraname = group.upper()
if group in jmap:
for jiraname in jmap[group]:
@@ -352,6 +364,7 @@ if m:
'mail': mlstats,
'delivery': emails,
'jira': jdata,
+ 'bugzilla': bdata,
'changes': cdata,
'dates': dates,
'pdata': ddata,
Modified: comdev/reporter.apache.org/trunk/site/render.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/render.js?rev=1707542&r1=1707541&r2=1707542&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/render.js (original)
+++ comdev/reporter.apache.org/trunk/site/render.js Thu Oct 8 13:36:42 2015
@@ -646,6 +646,10 @@ function renderFrontPage(json) {
+ if (json.bugzilla[pmc][0] || json.bugzilla[pmc][1] > 0) {
+ renderBZ(pmc)
+ }
+
if (json.jira[pmc][0] > 0 || json.jira[pmc][1] > 0) {
renderJIRA(pmc)
}
@@ -737,7 +741,7 @@ function mergeData(json, pmc) {
}
}
- var todo = new Array('count', 'mail', 'delivery', 'jira', 'changes', 'dates', 'pdata', 'releases', 'keys', 'health')
+ var todo = new Array('count', 'mail', 'delivery', 'bugzilla', 'jira', 'changes', 'dates', 'pdata', 'releases', 'keys', 'health')
for (i in todo) {
var key = todo[i]
jsdata[key][pmc] = json[key][pmc];
@@ -765,6 +769,19 @@ function renderJIRA(pmc) {
}
+function renderBZ(pmc) {
+ var obj = buildPanel(pmc, "Bugzilla Statistics")
+
+ addLine(pmc, "## Bugzilla Statistics:")
+ addLine(pmc)
+ addLine(pmc, " - " + jsdata.bugzilla[pmc][0] + " Bugzilla tickets created in the last 3 months");
+ addLine(pmc, " - " + jsdata.bugzilla[pmc][1] + " Bugzilla tickets resolved in the last 3 months");
+ addLine(pmc)
+ obj.innerHTML += jsdata.bugzilla[pmc][0] + " Bugzilla tickets created in the last 3 months<br>";
+ obj.innerHTML += jsdata.bugzilla[pmc][1] + " Bugzilla tickets resolved in the last 3 months<br>";
+ obj.innerHTML += "Tickets were found for the following products:<br><kbd>" + Object.keys(jsdata.bugzilla[pmc][2]).sort().join(", ") + "</kbd>"
+}
+
function renderChart(json, name, container, delivery) {
var chartDiv = document.createElement('div')