whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Detect chair lines with missing separator
Date Thu, 10 Jan 2019 15:59:47 GMT
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 5e58e11  Detect chair lines with missing separator
5e58e11 is described below

commit 5e58e11a20fe3541d53d7d3cc6d7f094c79567ca
Author: Sebb <sebb@apache.org>
AuthorDate: Thu Jan 10 15:59:00 2019 +0000

    Detect chair lines with missing separator
---
 lib/whimsy/asf/committee.rb | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/lib/whimsy/asf/committee.rb b/lib/whimsy/asf/committee.rb
index 4427e6c..644381a 100644
--- a/lib/whimsy/asf/committee.rb
+++ b/lib/whimsy/asf/committee.rb
@@ -352,13 +352,21 @@ module ASF
 
       # extract the committee chairs (e-mail address is required here)
       # Note: this includes the non-PMC entries
-      head.scan(/^[ \t]+(\w.*?)[ \t][ \t]+(.*)[ \t]+<(.*?)@apache\.org>/).
-        each do |committee, name, id|
+
+      # Scan for entries even if there is a missing extra space before the chair column
+      head.scan(/^[ \t]+\w.*?[ \t]+.*[ \t]+<.*?@apache\.org>/).each do |line|
+        # Now weed out the malformed lines
+        m = line.match(/^[ \t]+(\w.*?)[ \t][ \t]+(.*)[ \t]+<(.*?)@apache\.org>/)
+        if m
+          committee, chair, id = m.captures
           unless list[committee].chairs.any? {|chair| chair[:id] == id}
             list[committee].chairs << {name: name, id: id}
           end
+        else
+          # not possible to determine where one name starts and the other begins
+          Wunderbar.warn "Missing separator before chair name in: '#{line}'"
         end
-
+      end
       # Extract the non-PMC committees (e-mail address may be absent)
       # first drop leading text (and Officers) so we only match non-PMCs
       @nonpmcs = head.sub(/.*?also has /m,'').sub(/ Officers:.*/m,'').
@@ -419,6 +427,13 @@ module ASF
         end
       end
       @committee_info = (list.values - @officers).uniq
+      # Check if there are duplicates.
+      @committee_info.each do |c|
+        if c.chairs.length != 1 && c.name != 'fundraising' # hack to avoid reporting
non-PMC entry
+          Wunderbar.warn "Unexpected chair count for #{c.display_name}: #{c.chairs.inspect
rescue ''}"
+        end
+      end
+      @committee_info
     end
 
     # return a list of PMC committees.  Data is obtained from


Mime
View raw message