This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  f80fdea   Show which entries are warnings
f80fdea is described below

commit f80fdea4765c61c18b7b7ed6d7fb3641a5b25a7f
Author: Sebb <s...@apache.org>
AuthorDate: Thu Apr 27 00:41:47 2017 +0100

    Show which entries are warnings
---
 www/test/site-check.cgi | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/www/test/site-check.cgi b/www/test/site-check.cgi
index 0a82f6b..41933e3 100755
--- a/www/test/site-check.cgi
+++ b/www/test/site-check.cgi
@@ -12,6 +12,7 @@ cols = %w( events foundation license sponsorship security 
thanks )
 DATAURI = 'https://whimsy.apache.org/public/site-scan.json'
 
 def analyze(sites)
+    success = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
     counts = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
     { 
       'events' => %r{apache.org/events/current-event}i,
@@ -20,7 +21,8 @@ def analyze(sites)
       'security' => %r{apache.org/security}i,
       'thanks' => %r{apache.org/foundation/thanks}i
     }.each do |nam, pat|
-      counts[nam]['label-success'] = sites.select{ |k, site| site[nam] =~ pat  
}.count
+      success[nam] = sites.select{ |k, site| site[nam] =~ pat  }.keys
+      counts[nam]['label-success'] = success[nam].count
       counts[nam]['label-warning'] = 0 # Reorder output 
       counts[nam]['label-danger'] = sites.select{ |k, site| site[nam].nil? 
}.count
       counts[nam]['label-warning'] = sites.size - counts[nam]['label-success'] 
- counts[nam]['label-danger']
@@ -31,7 +33,7 @@ def analyze(sites)
       'label-success' => '# Sites with links to primary ASF page',
       'label-warning' => '# Sites with link, but not an expected ASF one',
       'label-danger' => '# Sites with no link for this topic'
-      }
+      }, success
     ]
 end
 
@@ -105,8 +107,13 @@ _html do
                   _td ''
                 elsif links[c] =~ /^http/
                   _td do
+                    if ! analysis[2].include? c or analysis[2][c].include? n
+                      cls = '' # link not present or link OK
+                    else
+                      cls = 'label-warning'
+                    end
                     _a links[c].sub(/https?:\/\//, '').
-                      sub(/(www\.)?apache\.org/i, 'a.o'), href: links[c]
+                      sub(/(www\.)?apache\.org/i, 'a.o'), href: links[c], 
class: cls
                   end
                 else
                   _td links[c]

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Reply via email to