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 1ebfeaff Use library routines for getting private lists
1ebfeaff is described below

commit 1ebfeaff5d3ff7357a8cdcb5a1b8c4af8c4733b2
Author: Sebb <[email protected]>
AuthorDate: Thu Aug 29 23:37:32 2024 +0100

    Use library routines for getting private lists
---
 www/committers/tm-report.cgi                             | 4 ++--
 www/officers/acreq.cgi                                   | 5 ++---
 www/project/icla/views/actions/discuss.json.rb           | 2 +-
 www/project/icla/views/actions/validate.json.rb          | 2 +-
 www/project/icla/views/actions/vote.json.rb              | 2 +-
 www/roster/models/committee.rb                           | 2 +-
 www/roster/models/committer.rb                           | 2 +-
 www/roster/models/ppmc.rb                                | 2 +-
 www/roster/views/actions/authgroup.json.rb               | 3 +--
 www/roster/views/actions/committee.json.rb               | 2 +-
 www/roster/views/actions/nonpmc.json.rb                  | 3 +--
 www/secretary/workbench/views/actions/ccla.json.rb       | 2 +-
 www/secretary/workbench/views/actions/grant.json.rb      | 2 +-
 www/secretary/workbench/views/actions/icla.json.rb       | 6 +++---
 www/secretary/workbench/views/actions/incomplete.json.rb | 2 +-
 www/secretary/workbench/views/actions/pubkey.json.rb     | 2 +-
 www/secretary/workbench/views/actions/resubmit.json.rb   | 2 +-
 17 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/www/committers/tm-report.cgi b/www/committers/tm-report.cgi
index 1cd3790f..61e87821 100755
--- a/www/committers/tm-report.cgi
+++ b/www/committers/tm-report.cgi
@@ -193,8 +193,8 @@ def send_form(formdata: {})
   # Build the mail to be sent
   frm = formdata['reporteremail']
   subject = "[FORM] Misuse Report about #{formdata['project']}"
-  pmc_list = ASF::Committee.find(formdata['project']).mail_list
-  cc_list = ["private@#{pmc_list}.apache.org", frm]
+  pmc_list = ASF::Committee.find(formdata['project']).private_mail_list
+  cc_list = [private_mail_list, frm]
   to_list = BRANDLIST
 
   if true # TESTING mode
diff --git a/www/officers/acreq.cgi b/www/officers/acreq.cgi
index f6df1cb8..1854b09d 100755
--- a/www/officers/acreq.cgi
+++ b/www/officers/acreq.cgi
@@ -286,13 +286,12 @@ _html do
                     cc_list = ["[email protected]"]
                     requestor = user.id
                   else
-                    pmc_list = ASF::Committee.find(@pmc).mail_list
-                    cc_list = ["private@#{pmc_list}.apache.org"]
+                    cc_list = [ASF::Committee.find(@pmc).private_mail_list]
                     requestor = @pmc[/([\w.-]+)/, 1]
                   end
 
                   if requestor == 'incubator' and not @podling.to_s.empty?
-                    cc_list << "private@#{@podling}.#{pmc_list}.apache.org"
+                    cc_list << ASF::Podling.find(@pmc).private_mail_list
                     requestor = "#{@podling}@incubator"
                   end
 
diff --git a/www/project/icla/views/actions/discuss.json.rb 
b/www/project/icla/views/actions/discuss.json.rb
index 53f79d10..47a26b9d 100644
--- a/www/project/icla/views/actions/discuss.json.rb
+++ b/www/project/icla/views/actions/discuss.json.rb
@@ -90,7 +90,7 @@ end
 
 # add user and pmc emails to the response
 _userEmail "#{user.public_name} <#{user.mail.first}>" if user
-_pmcEmail "private@#{pmc.mail_list}.apache.org" if pmc
+_pmcEmail pmc.private_mail_list if pmc
 
 path = Pathname.new(env['REQUEST_URI']) + "../../?token=#{token}"
 scheme = env['rack.url_scheme'] || 'https'
diff --git a/www/project/icla/views/actions/validate.json.rb 
b/www/project/icla/views/actions/validate.json.rb
index 7debd211..4e9e9880 100644
--- a/www/project/icla/views/actions/validate.json.rb
+++ b/www/project/icla/views/actions/validate.json.rb
@@ -172,7 +172,7 @@ end
 
 # add user and pmc emails to the response
 _userEmail "#{user.public_name} <#{user.mail.first}>" if user
-_pmcEmail "private@#{pmc.mail_list}.apache.org" if pmc
+_pmcEmail pmc.private_mail_list if pmc
 
 # generate an invitation token
 token = Digest::MD5.hexdigest(@iclaemail)[0..15]
diff --git a/www/project/icla/views/actions/vote.json.rb 
b/www/project/icla/views/actions/vote.json.rb
index 51c9d8d8..bc8f3f15 100644
--- a/www/project/icla/views/actions/vote.json.rb
+++ b/www/project/icla/views/actions/vote.json.rb
@@ -90,7 +90,7 @@ end
 
 # add user and pmc emails to the response
 _userEmail "#{user.public_name} <#{user.mail.first}>" if user
-_pmcEmail "private@#{pmc.mail_list}.apache.org" if pmc
+_pmcEmail pmc.private_mail_list if pmc
 
 path = Pathname.new(env['REQUEST_URI']) + "../../?token=#{token}"
 scheme = env['rack.url_scheme'] || 'https'
diff --git a/www/roster/models/committee.rb b/www/roster/models/committee.rb
index 4f12c6ab..b78c17a6 100644
--- a/www/roster/models/committee.rb
+++ b/www/roster/models/committee.rb
@@ -41,7 +41,7 @@ class Committee
     unless analysePrivateSubs # not an ASF member - are we a moderator?
       # TODO match using canonical emails
       user_mail = currentUser.all_mail || []
-      pMods = moderators["private@#{pmc.mail_list}.apache.org"] || []
+      pMods = moderators[pmc.private_mail_list] || []
       analysePrivateSubs = !(pMods & user_mail).empty?
     end
 
diff --git a/www/roster/models/committer.rb b/www/roster/models/committer.rb
index be7e6f36..4c5ac245 100644
--- a/www/roster/models/committer.rb
+++ b/www/roster/models/committer.rb
@@ -223,7 +223,7 @@ class Committer
       response[:chairOf] << cttee if chairs.include?(id)
       # mailing list info is not public ...
       if response[:subscriptions] # did we get access to the mail?
-        pmail = "private@#{pmc.mail_list}.apache.org" rescue ''
+        pmail = pmc.private_mail_list rescue ''
         subbed = false
         subs = response[:subscriptions]
         digs = response[:digests]
diff --git a/www/roster/models/ppmc.rb b/www/roster/models/ppmc.rb
index 0bf6840f..b0334edc 100644
--- a/www/roster/models/ppmc.rb
+++ b/www/roster/models/ppmc.rb
@@ -37,7 +37,7 @@ class PPMC
     unless analysePrivateSubs # not an ASF member - are we a moderator?
       # TODO match using canonical emails
       user_mail = currentUser.all_mail || []
-      pMods = moderators["private@#{ppmc.mail_list}.apache.org"] || []
+      pMods = moderators[ppmc.private_mail_list] || []
       analysePrivateSubs = !(pMods & user_mail).empty?
     end
 
diff --git a/www/roster/views/actions/authgroup.json.rb 
b/www/roster/views/actions/authgroup.json.rb
index b6479153..c5b12613 100644
--- a/www/roster/views/actions/authgroup.json.rb
+++ b/www/roster/views/actions/authgroup.json.rb
@@ -34,8 +34,7 @@ if env.password
   # replace with sending to the private@pmc list if this is a pmc owned group
   pmc = ASF::Committee.find(group.id.split('-').first)
   unless pmc.owners.empty?
-    to = pmc.mail_list
-    to = "private@#{to}.apache.org" unless to.include? '@'
+    to = pmc.private_mail_list
   end
 
   # other committees
diff --git a/www/roster/views/actions/committee.json.rb 
b/www/roster/views/actions/committee.json.rb
index c252a089..32a9f0b2 100644
--- a/www/roster/views/actions/committee.json.rb
+++ b/www/roster/views/actions/committee.json.rb
@@ -68,7 +68,7 @@ if env.password
   # draft email
   mail = Mail.new do
     from "#{from.public_name} <#{from.id}@apache.org>"
-    to "private@#{pmc.mail_list}.apache.org"
+    to pmc.private_mail_list
     cc cc
     bcc '[email protected]'
     subject "#{who} #{action} #{pmc.display_name} #{list}"
diff --git a/www/roster/views/actions/nonpmc.json.rb 
b/www/roster/views/actions/nonpmc.json.rb
index 59b2e8ae..2eb76178 100644
--- a/www/roster/views/actions/nonpmc.json.rb
+++ b/www/roster/views/actions/nonpmc.json.rb
@@ -69,8 +69,7 @@ if env.password
   # draft email
   mail = Mail.new do
     from "#{from.public_name} <#{from.id}@apache.org>"
-    # TODO the email address may need fixing
-    to "private@#{pmc.mail_list}.apache.org"
+    to pmc.private_mail_list
     cc cc
     bcc '[email protected]'
     subject "#{who} #{action} #{pmc.display_name} #{list}"
diff --git a/www/secretary/workbench/views/actions/ccla.json.rb 
b/www/secretary/workbench/views/actions/ccla.json.rb
index 6e256dbf..0af1730c 100644
--- a/www/secretary/workbench/views/actions/ccla.json.rb
+++ b/www/secretary/workbench/views/actions/ccla.json.rb
@@ -86,7 +86,7 @@ task "email #@email" do
     to: "#{@contact.inspect} <#{@email}>",
     cc: [
       '[email protected]',
-      ("private@#{@pmc.mail_list}.apache.org" if @pmc), # copy pmc
+      (@pmc.private_mail_list if @pmc), # copy pmc
       (@podling.private_mail_list if @podling) # copy podling
     ],
     body: template('ccla.erb')
diff --git a/www/secretary/workbench/views/actions/grant.json.rb 
b/www/secretary/workbench/views/actions/grant.json.rb
index bc4173c0..5a945a65 100644
--- a/www/secretary/workbench/views/actions/grant.json.rb
+++ b/www/secretary/workbench/views/actions/grant.json.rb
@@ -80,7 +80,7 @@ task "email #@email" do
     to: "#{@name.inspect} <#{@email}>",
     cc: [
       '[email protected]',
-      ("private@#{@pmc.mail_list}.apache.org" if @pmc), # copy pmc
+      (@pmc.private_mail_list if @pmc), # copy pmc
       (@podling.private_mail_list if @podling) # copy podling
     ],
     body: template('grant.erb')
diff --git a/www/secretary/workbench/views/actions/icla.json.rb 
b/www/secretary/workbench/views/actions/icla.json.rb
index ec3fc64e..27ec7fc0 100644
--- a/www/secretary/workbench/views/actions/icla.json.rb
+++ b/www/secretary/workbench/views/actions/icla.json.rb
@@ -147,7 +147,7 @@ task "email #@email" do
     to: "#{@pubname.inspect} <#{@email}>",
     cc: [
       ('[email protected]' unless use_Bcc),
-      ("private@#{@pmc.mail_list}.apache.org" if @pmc), # copy pmc
+      (@pmc.private_mail_list if @pmc), # copy pmc
       (@podling.private_mail_list if @podling) # copy podling
     ],
     bcc: [ ('[email protected]' if use_Bcc)],
@@ -158,7 +158,7 @@ task "email #@email" do
   if @podling
     mail.header['Reply-To'] = @podling.private_mail_list
   elsif @pmc
-    mail.header['Reply-To'] = "private@#{@pmc.mail_list}.apache.org"
+    mail.header['Reply-To'] = @pmc.private_mail_list
   end
 
   # echo email
@@ -222,7 +222,7 @@ if @valid_user and @pmc and not @votelink.empty?
 
     # adjust copy lists
     cc = ["#{@pubname.inspect} <#{@email}>"]
-    cc << "private@#{@pmc.mail_list}.apache.org" if @pmc # copy pmc
+    cc << @pmc.private_mail_list if @pmc # copy pmc
     cc << @podling.private_mail_list if @podling # copy podling
     mail.cc = cc.uniq.map {|email| email}
 
diff --git a/www/secretary/workbench/views/actions/incomplete.json.rb 
b/www/secretary/workbench/views/actions/incomplete.json.rb
index ab3da094..8e29c2a8 100644
--- a/www/secretary/workbench/views/actions/incomplete.json.rb
+++ b/www/secretary/workbench/views/actions/incomplete.json.rb
@@ -53,7 +53,7 @@ task "email #{message.from}" do
     from: @from,
     cc: [
       '[email protected]',
-      ("private@#{@pmc.mail_list}.apache.org" if @pmc), # copy pmc
+      (@pmc.private_mail_list if @pmc), # copy pmc
       (@podling.private_mail_list if @podling) # copy podling
     ],
     body: template('incomplete.erb')
diff --git a/www/secretary/workbench/views/actions/pubkey.json.rb 
b/www/secretary/workbench/views/actions/pubkey.json.rb
index 9312bb36..7d0e0fbb 100644
--- a/www/secretary/workbench/views/actions/pubkey.json.rb
+++ b/www/secretary/workbench/views/actions/pubkey.json.rb
@@ -19,7 +19,7 @@ task "email #{message.from}" do
     from: @from,
     cc: [
       '[email protected]',
-      ("private@#{@pmc.mail_list}.apache.org" if @pmc), # copy pmc
+      (@pmc.private_mail_list if @pmc), # copy pmc
       (@podling.private_mail_list if @podling) # copy podling
     ],
     body: template('pubkey.erb')
diff --git a/www/secretary/workbench/views/actions/resubmit.json.rb 
b/www/secretary/workbench/views/actions/resubmit.json.rb
index c5a206a9..bd4d924e 100644
--- a/www/secretary/workbench/views/actions/resubmit.json.rb
+++ b/www/secretary/workbench/views/actions/resubmit.json.rb
@@ -23,7 +23,7 @@ task "email #{message.from}" do
     from: @from,
     cc: [
       '[email protected]',
-      ("private@#{@pmc.mail_list}.apache.org" if @pmc), # copy pmc
+      (@pmc.private_mail_list if @pmc), # copy pmc
       (@podling.private_mail_list if @podling) # copy podling
     ],
     body: template('resubmit.erb')

Reply via email to