community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From he...@apache.org
Subject svn commit: r1822114 - /comdev/reporter.apache.org/trunk/site/js/render.js
Date Wed, 24 Jan 2018 15:52:59 GMT
Author: henkp
Date: Wed Jan 24 15:52:59 2018
New Revision: 1822114

URL: http://svn.apache.org/viewvc?rev=1822114&view=rev
Log:
add dist checker section

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

Modified: comdev/reporter.apache.org/trunk/site/js/render.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/js/render.js?rev=1822114&r1=1822113&r2=1822114&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/js/render.js (original)
+++ comdev/reporter.apache.org/trunk/site/js/render.js Wed Jan 24 15:52:59 2018
@@ -679,6 +679,14 @@ function renderFrontPage(json) {
 			renderJIRA(pmc)
 		}
 
+        // HPP : handle json.checker[pmc] == undefined ; shouldn't happen
+        if ( json.checker[pmc] ) {
+             if ( json.checker[pmc]['errors'] > 0 ) { renderChecker(pmc) }
+        } else {
+             var obj = buildPanel(pmc, "Dist Checker") ;
+             obj.innerHTML += "No checker data for PMC [" + pmc + "]\n" ;
+        }
+
 
 		// Reporting example
 		var template = buildPanel(pmc, "Report template");
@@ -775,7 +783,7 @@ function mergeData(json, pmc) {
 		}
 	}
 
-	var todo = new Array('count', 'mail', 'delivery', 'bugzilla', 'jira', 'changes', 'pmcdates',
'pdata', 'releases', 'keys', 'health')
+	var todo = new Array('count', 'mail', 'delivery', 'bugzilla', 'jira', 'changes', 'pmcdates',
'pdata', 'releases', 'keys', 'health', 'checker')
 	for (i in todo) {
 		var key = todo[i]
 		jsdata[key][pmc] = json[key][pmc];
@@ -817,6 +825,53 @@ function renderBZ(pmc) {
     obj.innerHTML += "Tickets were found for the following products:<br><kbd>"
+ Object.keys(jsdata.bugzilla[pmc][2]).sort().join(", ") + "</kbd>"
 }
 
+function my_url (href) { return '<a href="' + href + '">' + href + '</a>' ; }
+function ival2str (ival) {
+  var n = ival ;
+  var m = Math.round ( n / 60 ) ;
+  var h = Math.round ( n / 60 / 60 ) ;
+  var d = Math.round ( n / 60 / 60 / 24 ) ;
+  var u ;
+  var r ;
+  if ( n < 60 )
+    { u = 'second' ; }
+  else if ( m < 60 )
+    { n = m ; u = 'minute' ; }
+  else if ( h < 24 )
+    { n = h ; u = 'hour' ; }
+  else
+    { n = d ; u = 'day' ; }
+  r = n + ' ' + u + ( ( n == 1 ) ? '' : 's' ) ;
+  if ( ival > 4 * 3600 ) { r = "<font color='red'>" + r + "</font>" ; }
+  return r ;
+}
+function renderChecker(pmc) {
+    var obj = buildPanel(pmc, "Dist Checker") ;
+    var data = jsdata.checker[pmc] ;
+    var meta = data['meta'] ;
+    var errs = data['errors'] ;
+    var base = meta['uri_base'] ;
+    var home = my_url(base) ;
+    var help = my_url(meta['uri_help']) ;
+    var proj = my_url(base + data['uri_proj']) ;
+    var dist = my_url('https://www.apache.org/dist/') ;
+    var summ = '' ;
+    for ( idx in data['summary'] ) {
+      summ += ( '<li>' + data['summary'][idx] + "</li>\n" ) ;
+    }
+    var date = new Date() ;
+    var time = Math.round ( date.getTime() / 1000 ) ;
+    var ival = time - meta['refreshed']['time'] ;
+    obj.innerHTML += "Site " + home + " checks the health of " + dist + " ;\n" ;
+    obj.innerHTML += 'for PMC <i>' + pmc + "</i> it reports these errors :\n<ul>\n"
+ summ + "</ul>\n" ;
+    obj.innerHTML += 'For details see ' + proj + "<br>\n" ;
+    obj.innerHTML += 'For help see ' + help + "<br>\n" ;
+    obj.innerHTML += 'Last update : ' + meta['refreshed']['date'] + ' ; ' + ival2str(ival)
+ ' ago [' + ival + 's].' ;
+    addLine( pmc, "## /dist/ error(s): " + errs ) ;
+    addLine( pmc, " - <font color='red'>TODO - Please fix the errors or explain why
you can't.</font>" ) ;
+    addLine( pmc ) ;
+}
+
 function renderChart(json, name, container, delivery) {
 
 	var chartDiv = document.createElement('div')



Mime
View raw message