whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: remove chair if pmc is subject of a termination resolution
Date Sun, 25 Mar 2018 16:38:27 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys 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 fc69c7d  remove chair if pmc is subject of a termination resolution
fc69c7d is described below

commit fc69c7d7b8a6caf6f9fd8ecef76430899ff004f5
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Mar 25 12:37:44 2018 -0400

    remove chair if pmc is subject of a termination resolution
---
 lib/whimsy/asf/committee.rb                  | 18 ++++++++++--------
 www/board/agenda/views/actions/todos.json.rb |  5 +----
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/lib/whimsy/asf/committee.rb b/lib/whimsy/asf/committee.rb
index d6d0574..ccfb39b 100644
--- a/lib/whimsy/asf/committee.rb
+++ b/lib/whimsy/asf/committee.rb
@@ -184,21 +184,23 @@ module ASF
     end
 
     # update chairs
-    def self.update_chairs(contents, establish_or_change, terminate)
+    def self.update_chairs(contents, todos)
       # extract committee section; and then extract the lines containing
       # committee names and chairs
       section = contents[/^1\..*?\n=+/m]
       committees = section[/-\n(.*?)\n\n/m, 1].scan(/^ +(.*?)  +(.*)/).to_h
 
-      # update/add chairs based on establish and change resolutions
-      establish_or_change.each do |name, chair|
-        person = ASF::Person.find(chair)
-        committees[name] = "#{person.public_name} <#{person.id}@apache.org>"
+      # update/add chairs based on resolutions
+      todos.each do |resolution|
+        name = resolution['display_name']
+        if resolution['action'] == 'terminate'
+          committees.delete(name)
+        elsif resulution['chair']
+          person = ASF::Person.find(resolution['chair'])
+          committees[name] = "#{person.public_name} <#{person.id}@apache.org>"
+        end
       end
 
-      # remove committees based on terminate resolutions
-      terminate.each {|name| committees.delete(name)} if terminate
-
       # sort and concatenate committees
       committees = committees.sort_by {|name, chair| name.downcase}.
         map {|name, chair| "    #{name.ljust(23)} #{chair}"}.
diff --git a/www/board/agenda/views/actions/todos.json.rb b/www/board/agenda/views/actions/todos.json.rb
index b1cebf5..56e1f9f 100644
--- a/www/board/agenda/views/actions/todos.json.rb
+++ b/www/board/agenda/views/actions/todos.json.rb
@@ -81,10 +81,7 @@ if (@change || @establish || @terminate) and env.password
     end
 
     # update chairs from establish, change, and terminate resolutions
-    chairs = todos.map do |resolution| 
-      [resolution['display_name'], resolution['chair']]
-    end.to_h
-    contents = ASF::Committee.update_chairs(contents, chairs, @terminate)
+    contents = ASF::Committee.update_chairs(contents, todos)
 
     # add people from establish resolutions
     established = Date.parse(date.gsub('_', '-'))

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.

Mime
View raw message