You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2016/08/20 17:16:51 UTC

[whimsy] branch master updated: Move maillist matching logic to Podling class and allow for aliases

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

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

The following commit(s) were added to refs/heads/master by this push:
       new  12da425   Move maillist matching logic to Podling class and allow for aliases
12da425 is described below

commit 12da4254035e62fe164d7e30c16ce8e818a20d28
Author: Sebb <se...@apache.org>
AuthorDate: Sat Aug 20 18:16:43 2016 +0100

    Move maillist matching logic to Podling class and allow for aliases
---
 lib/whimsy/asf/podlings.rb | 20 ++++++++++++++++++++
 www/incubator/maillist.cgi |  2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/podlings.rb b/lib/whimsy/asf/podlings.rb
index 06be452..7107623 100644
--- a/lib/whimsy/asf/podlings.rb
+++ b/lib/whimsy/asf/podlings.rb
@@ -20,6 +20,9 @@ module ASF
     def initialize(node)
       @name = node['name']
       @resource = node['resource']
+      # Needed for matching against mailing list names 
+      @resourceAliases = []
+      @resourceAliases = node['resourceAliases'].split(/,\s*/) if node['resourceAliases']
       @status = node['status']
       @enddate = node['enddate']
       @startdate = node['startdate']
@@ -147,6 +150,23 @@ module ASF
         "dev@#{name}.apache.org"
       end
     end
+
+    # Is this a podling mailing list?
+    def mail_list?(list)
+      return true if _match_mailname?(list, name())
+      # Also check aliases
+      @resourceAliases.each {|name|
+        return true if _match_mailname?(list, name)
+      }
+      return false
+    end
+
+    # Match against new and old list types
+    def _match_mailname?(list, _name)
+      return true if list.start_with?("#{_name}-")
+      return true if list.start_with?("incubator-#{_name}-")
+    end
+
   end
 
   # more backwards compatibility
diff --git a/www/incubator/maillist.cgi b/www/incubator/maillist.cgi
index 541ffe0..43a2a26 100755
--- a/www/incubator/maillist.cgi
+++ b/www/incubator/maillist.cgi
@@ -27,7 +27,7 @@ _html do
 
         _td podling.status
         _td podling.reporting.join(', ')
-        _td lists.select {|list| list.start_with?("#{podling.name}-") || list.start_with?("incubator-#{podling.name}-") }.join(', ')
+        _td lists.select {|list| podling.mail_list?(list) }.join(', ')
       end
     end
   end

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