community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1708147 - in /comdev/reporter.apache.org/trunk/site: jiraversions.py render.js
Date Mon, 12 Oct 2015 16:08:06 GMT
Author: sebb
Date: Mon Oct 12 16:08:06 2015
New Revision: 1708147

URL: http://svn.apache.org/viewvc?rev=1708147&view=rev
Log:
Report the actual number of versions added, not the number now in the database

Modified:
    comdev/reporter.apache.org/trunk/site/jiraversions.py
    comdev/reporter.apache.org/trunk/site/render.js

Modified: comdev/reporter.apache.org/trunk/site/jiraversions.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/jiraversions.py?rev=1708147&r1=1708146&r2=1708147&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/jiraversions.py (original)
+++ comdev/reporter.apache.org/trunk/site/jiraversions.py Mon Oct 12 16:08:06 2015
@@ -49,6 +49,7 @@ if jiraname and user and (isMember(user)
     jiraname = jiraname.upper()
     base64string = base64.encodestring('%s:%s' % ('githubbot', jirapass))[:-1]
     rdata = getReleaseData(project)
+    added = 0
     try:
         req = urllib2.Request("https://issues.apache.org/jira/rest/api/2/project/%s/versions"
% jiraname)
         req.add_header("Authorization", "Basic %s" % base64string)
@@ -59,6 +60,7 @@ if jiraname and user and (isMember(user)
                 if prepend:
                     entry['name'] = "%s-%s" % (prepend, entry['name'])
                 rdata[entry['name']] = date
+                added += 1
     except Exception as err:
         pass
     try:
@@ -70,7 +72,7 @@ if jiraname and user and (isMember(user)
         print("Content-Type: application/json\r\n\r\n%s\r\n" % json.dumps({"status": str(e)}))
     else:
         print("Content-Type: application/json\r\n\r\n")
-        print(json.dumps({'status': 'Fetched', 'versions': rdata}, indent=1))
+        print(json.dumps({'status': 'Fetched', 'versions': rdata, 'added': added}, indent=1))
 
 else:
     if jiraname and user:

Modified: comdev/reporter.apache.org/trunk/site/render.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/render.js?rev=1708147&r1=1708146&r2=1708147&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/render.js (original)
+++ comdev/reporter.apache.org/trunk/site/render.js Mon Oct 12 16:08:06 2015
@@ -973,14 +973,12 @@ function fetchJIRA(pmc, project, prepend
 	if (project && project.length > 1) {
 		GetAsyncJSON("jiraversions.py?project=" + pmc + "&jiraname=" + project + "&prepend="
+ prepend, null, function(json) {
 			if (json && json.versions) {
-				var n = 0;
 				for (version in json.versions) {
-					n++;
 					jsdata.releases[pmc][version] = json.versions[version]
 				}
 				$('#dialog_' + pmc).dialog("close")
 				nproject = pmc
-				alert("Fetched " + n + " releases from JIRA!")
+				alert("Fetched " + json.added + " releases from JIRA!")
 				renderFrontPage(jsdata)
 
             } else if (json && json.status){



Mime
View raw message