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 502909e Show unknown subs to security@
502909e is described below
commit 502909e16c5ada4883ee6b2951b1df3230b57650
Author: Sebb <[email protected]>
AuthorDate: Tue Dec 18 21:07:22 2018 +0000
Show unknown subs to security@
---
lib/whimsy/asf/mlist.rb | 4 ++++
www/roster/models/committee.rb | 25 +++++++++++++++++++++++--
www/roster/views/pmc/pmc.js.rb | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 65 insertions(+), 2 deletions(-)
diff --git a/lib/whimsy/asf/mlist.rb b/lib/whimsy/asf/mlist.rb
index d4dc8f4..386160e 100644
--- a/lib/whimsy/asf/mlist.rb
+++ b/lib/whimsy/asf/mlist.rb
@@ -28,6 +28,10 @@ module ASF
return list_filter('sub', "#{pmc}.apache.org", 'private', archivers),
(File.mtime(LIST_TIME) rescue File.mtime(LIST_SUBS))
end
+ def self.security_subscribers(pmc, archivers=false)
+ return list_filter('sub', "#{pmc}.apache.org", 'security', archivers),
(File.mtime(LIST_TIME) rescue File.mtime(LIST_SUBS))
+ end
+
# return a hash of subscriptions for the list of emails provided
# the following keys are added to the response hash:
# :subtime - the timestamp when the data was last updated
diff --git a/www/roster/models/committee.rb b/www/roster/models/committee.rb
index 4d4a790..bc4adf4 100644
--- a/www/roster/models/committee.rb
+++ b/www/roster/models/committee.rb
@@ -27,6 +27,7 @@ class Committee
subtime = nil
pSubs = Array.new # private@ subscribers
unMatchedSubs = [] # unknown private@ subscribers
+ unMatchedSecSubs = [] # unknown security@ subscribers
currentUser = ASF::Person.find(env.user)
analysePrivateSubs = false # whether to show missing private@ subscriptions
if pmc.roster.include? env.user or currentUser.asf_member?
@@ -43,6 +44,8 @@ class Committee
pSubs = ASF::MLIST.private_subscribers(pmc.mail_list)[0]||[]
unMatchedSubs=Set.new(pSubs) # init ready to remove matched mails
pSubs.map!{|m| m.downcase} # for matching
+ sSubs = ASF::MLIST.security_subscribers(pmc.mail_list)[0]||[]
+ unMatchedSecSubs=Set.new(sSubs) # init ready to remove matched mails
end
else
lists = lists.select {|list, mode| mode == 'public'}
@@ -60,6 +63,7 @@ class Committee
allMail = person.all_mail.map{|m| m.downcase}
roster[person.id]['notSubbed'] = (allMail & pSubs).empty?
unMatchedSubs.delete_if {|k| allMail.include? k.downcase}
+ unMatchedSecSubs.delete_if {|k| allMail.include? k.downcase}
end
roster[person.id]['ldap'] = true
roster[person.id]['githubUsername'] = (person.attrs['githubUsername'] ||
[]).join(', ')
@@ -80,14 +84,15 @@ class Committee
end
# separate out the known ASF members and extract any matching committer
details
- unknownSubs = []
+ unknownSubs = [] # unknown private@ subscribers: not PMC or ASF
asfMembers = []
+ unknownSecSubs = [] # unknown security@ subscribers: not PMC or ASF
# Also look for non-ASF mod emails
nonASFmails=Hash.new
if moderators
moderators.each { |list,mods| mods.each {|m| nonASFmails[m]='' unless
m.end_with? '@apache.org'} }
end
- if unMatchedSubs.length > 0 or nonASFmails.length > 0
+ if unMatchedSubs.length > 0 or nonASFmails.length > 0 or
unMatchedSecSubs.length > 0
load_emails # set up @people
unMatchedSubs.each{ |addr|
who = nil
@@ -113,6 +118,21 @@ class Committee
end
end
}
+ unMatchedSecSubs.each{ |addr|
+ who = nil
+ @people.each do |person|
+ if person[:mail].any? {|mail| mail.downcase == addr.downcase}
+ who = person
+ end
+ end
+ if who
+ unless who[:member]
+ unknownSubs << { addr: addr, person: who }
+ end
+ else
+ unknownSecSubs << { addr: addr, person: nil }
+ end
+ }
end
pmc_chair = false
@@ -146,6 +166,7 @@ class Committee
analysePrivateSubs: analysePrivateSubs,
unknownSubs: unknownSubs,
asfMembers: asfMembers,
+ unknownSecSubs: unknownSecSubs,
}
response
diff --git a/www/roster/views/pmc/pmc.js.rb b/www/roster/views/pmc/pmc.js.rb
index d4774b0..6c7f711 100644
--- a/www/roster/views/pmc/pmc.js.rb
+++ b/www/roster/views/pmc/pmc.js.rb
@@ -39,6 +39,7 @@ class PMCMembers < Vue
# separate out the known ASF members and extract any matching committer
details
unknownSubs = @@committee.unknownSubs
asfMembers = @@committee.asfMembers
+ unknownSecSubs = @@committee.unknownSecSubs
# Any unknown subscribers?
if unknownSubs.length > 0
_p {
@@ -101,6 +102,43 @@ class PMCMembers < Vue
}
}
end
+ # Any unknown security@ subscribers?
+ if unknownSecSubs.length > 0
+ _h2.crosscheck! 'Check of security@ list subscriptions'
+ _p {
+ # We don't use the short-hand name: value syntax here to work-round
Eclipse Ruby editor parsing bug
+ _span.glyphicon.glyphicon_lock aria_hidden: true, :class =>
'text-primary', 'aria-label' => 'ASF Members and private@ moderators'
+ _ 'The following subscribers to the security@ list do not match the
known emails for any of the existing PMC (or ASF) members.'
+ _br
+ _ 'They could be PMC (or ASF) members whose emails are not listed in
their LDAP record.'
+ _br
+ _ 'Or they could be ex-PMC members who are still subscribed.'
+ _br
+ _ '(Note that digest subscriptions are not currently included)'
+ _br
+ _br
+ _ul {
+ unknownSecSubs.each do |sub|
+ person = sub['person']
+ if person
+ _li {
+ _ sub['addr']
+ _ ' '
+ _ person['name']
+ _ ' '
+ _a person['id'], href: "committer/#{person['id']}"
+ }
+ else
+ _li {
+ _ sub['addr']
+ _ ' '
+ _ '(not recognised)'
+ }
+ end
+ end
+ }
+ }
+ end
end
end