You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2017/09/25 01:47:27 UTC

[whimsy] branch master updated (24cdd6e -> 5c31f84)

This is an automated email from the ASF dual-hosted git repository.

rubys pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git.


    from 24cdd6e  rework post-meeting actions - client
     new 1d63409  add code to update 'next month' section in committee-info.txt
     new 5c31f84  add code to update chair information in committee-info.txt

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 lib/whimsy/asf/committee.rb                  | 80 ++++++++++++++++++++++++++++
 www/board/agenda/views/actions/todos.json.rb |  9 ++--
 2 files changed, 84 insertions(+), 5 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].

[whimsy] 02/02: add code to update chair information in committee-info.txt

Posted by ru...@apache.org.
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

commit 5c31f840b876e206fa7693321dd5861619934dee
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sun Sep 24 21:47:09 2017 -0400

    add code to update chair information in committee-info.txt
---
 lib/whimsy/asf/committee.rb                  | 32 ++++++++++++++++++++++++++++
 www/board/agenda/views/actions/todos.json.rb |  9 ++++----
 2 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/lib/whimsy/asf/committee.rb b/lib/whimsy/asf/committee.rb
index 41101bd..9aa728c 100644
--- a/lib/whimsy/asf/committee.rb
+++ b/lib/whimsy/asf/committee.rb
@@ -153,6 +153,38 @@ module ASF
       contents
     end
 
+    # update chairs
+    def self.update_chairs(contents, establish, change, terminate)
+      # 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.merge(change)).each do |name, chair|
+	person = ASF::Person.find(chair)
+	committees[name] = "#{person.public_name} <#{...@apache.org>"
+      end
+
+      # remove committees based on terminate resolutions
+      terminate.each do |name|
+	committees.delete(name)
+      end
+
+      # sort and concatenate committees
+      committees = committees.sort_by {|name, chair| name.downcase}.
+	map {|name, chair| "    #{name.ljust(23)} #{chair}"}.
+	join("\n")
+
+      # replace committee info in the section, and then replace the
+      # section in the committee-info contents
+      section[/-\n(.*?)\n\n/m, 1] = committees
+      contents[/^1\..*?\n=+/m] = section
+
+      # return result
+      contents
+    end
+
     # insert (replacing if necessary) a new committee into committee-info.txt
     def self.establish(contents, pmc, date, people)
       # split into foot, sections (array) and head
diff --git a/www/board/agenda/views/actions/todos.json.rb b/www/board/agenda/views/actions/todos.json.rb
index b01abf1..760001d 100644
--- a/www/board/agenda/views/actions/todos.json.rb
+++ b/www/board/agenda/views/actions/todos.json.rb
@@ -170,7 +170,7 @@ end
 ########################################################################
 
 transitioning = {}
-establish = {}
+establish = []
 terminate = {}
 change = []
 
@@ -182,7 +182,8 @@ Agenda.parse(agenda, :full).each do |item|
       transitioning[ASF::Person.find(person)] = item['title']
     end
   elsif item['title'] =~ /^Establish\s*(.*?)\s*$/ and item['chair']
-    establish[$1] = item['title']
+    next if victims.include? $1
+    establish << {name: $1, resolution: item['title'], chair: item['chair']}
     transitioning[ASF::Person.find(item['chair'])] = item['title']
   elsif item['title'] =~ /^Terminate\s*(.*?)\s*$/
     terminate[$1] = item['title']
@@ -191,7 +192,6 @@ end
 
 add = transitioning.keys - ASF.pmc_chairs
 remove = ASF.pmc_chairs - ASF::Committee.pmcs.map(&:chair) - transitioning.keys
-victims.each {|victim| establish.delete victim}
 
 _add add.map {|person| {id: person.id, name: person.public_name, 
   email: person.mail.first, resolution: transitioning[person]}}.
@@ -199,8 +199,7 @@ _add add.map {|person| {id: person.id, name: person.public_name,
 _remove remove.map {|person| {id: person.id, name: person.public_name}}.
   sort_by {|person| person[:id]}
 _change change
-_establish establish.
-  map {|name, resolution| {name: name, resolution: resolution}}
+_establish establish
 _terminate terminate.
   map {|name, resolution| {name: name, resolution: resolution}}
 _minutes minutes

-- 
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <co...@whimsical.apache.org>.

[whimsy] 01/02: add code to update 'next month' section in committee-info.txt

Posted by ru...@apache.org.
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

commit 1d63409ed97d460130ff6c7e0a071c86f196d2cd
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sun Sep 24 20:12:29 2017 -0400

    add code to update 'next month' section in committee-info.txt
---
 lib/whimsy/asf/committee.rb | 48 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/lib/whimsy/asf/committee.rb b/lib/whimsy/asf/committee.rb
index 78d6f0b..41101bd 100644
--- a/lib/whimsy/asf/committee.rb
+++ b/lib/whimsy/asf/committee.rb
@@ -105,6 +105,54 @@ module ASF
       parse_committee_info File.read(file)
     end
 
+    # update next month section.  Remove entries that have reported or
+    # or expired; add (or update) entries that are missing; add entries
+    # for new committees.
+    def self.update_next_month(contents, date, missing, establish)
+      # extract next month section; and then extract the lines containing
+      # '#' signs from within that section
+      next_month = contents[/Next month.*?\n\n/m].chomp
+      block = next_month[/(.*#.*\n)+/] || ''
+
+      # remove expired entries
+      month = date.strftime("%B")
+      block.gsub!(/.* # new, monthly through #{month}\n/, '')
+
+      # update/remove existing 'missing' entries
+      block.gsub! /(.*?)# missing in .*\n/ do |line|
+	if missing.include? $1.strip
+	  missing.delete $1.strip
+	  "#{line.chomp}, #{month}\n"
+	else
+	  ''
+	end
+      end
+
+      # add new 'missing' entries
+      missing.each do |pmc|
+	block += "    #{pmc.ljust(22)} # missing in #{month}\n"
+      end
+
+      # add new 'established' entries
+      month = (date+91).strftime('%B')
+      establish.each do |pmc|
+	block += "    #{pmc.ljust(22)} # new, monthly through #{month}\n"
+      end
+
+      # replace/append block
+      if next_month.include? '#'
+        next_month[/(.*#.*\n)+/] = block.split("\n").sort.join("\n")
+      else
+        next_month += block
+      end
+
+      # replace next month section
+      contents[/Next month.*?\n\n/m] = next_month + "\n\n"
+
+      # return result
+      contents
+    end
+
     # insert (replacing if necessary) a new committee into committee-info.txt
     def self.establish(contents, pmc, date, people)
       # split into foot, sections (array) and head

-- 
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <co...@whimsical.apache.org>.