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 dd92e07  New mail_list_autosub syntax
dd92e07 is described below

commit dd92e0761a2b3497f19cbb0e4b8f9a98789fb9b9
Author: Sebb <[email protected]>
AuthorDate: Tue Mar 22 10:36:20 2022 +0000

    New mail_list_autosub syntax
---
 lib/whimsy/asf/mail.rb | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/lib/whimsy/asf/mail.rb b/lib/whimsy/asf/mail.rb
index e901528..209eb3d 100644
--- a/lib/whimsy/asf/mail.rb
+++ b/lib/whimsy/asf/mail.rb
@@ -49,12 +49,12 @@ module ASF
 
     def self._cannot_sub
       self._load_auto()
-      @auto[:disallowed]
+      @auto[:disallowed] + @auto[:intrinsic]
     end
 
     def self._cannot_unsub
       self._load_auto()
-      @auto[:cannotunsubscribe]
+      @auto[:intrinsic]
     end
 
     def self._committers_allowed
@@ -90,7 +90,7 @@ module ASF
     def self.cansub(member, pmc_chair, ldap_pmcs, lidonly = true)
       allowed = []
       parse_flags do |dom, list, f|
-        lid = archivelistid(dom, list)
+        lid = _autosubid(dom, list)
         next if self._deprecated.include? lid # deprecated in lid format 
currently
         next if self._cannot_sub.include? lid # probably unnecessary
 
@@ -131,7 +131,7 @@ module ASF
     def self.canmod(ldap_pmcs, lidonly = true)
       allowed = []
       parse_flags do |dom, list, _|
-        lid = archivelistid(dom, list)
+        lid = _autosubid(dom, list)
         next if self._deprecated.include? lid # deprecated in lid format 
currently
         next if self._cannot_sub.include? lid # probably unnecessary
 
@@ -192,7 +192,7 @@ module ASF
       self.archivelistid(dom, list)
     end
 
-    # Convert list name to form used in mail_list_autosub.yml
+    # Convert dom, list to form currently used in subreq.py
     def self.archivelistid(dom, list)
       return "apachecon-#{list}" if dom == 'apachecon.com'
       return list if dom == 'apache.org'
@@ -200,6 +200,12 @@ module ASF
       dom.sub(".apache.org", '-') + list
     end
 
+    # Convert dom, list to form used in mail_list_autosub.yml
+    # This changed in March 2022 from dom-list format
+    def self._autosubid(dom, list)
+      return "#{list}@#{dom}"
+    end
+
     # Canonicalise an email address, removing aliases and ignored punctuation
     # and downcasing the name if safe to do so
     #

Reply via email to