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/23 20:01:32 UTC
[whimsy] 03/03: parse change chair resolutions
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 9a970963779351036c6dd41fdd0db9220fa20a25
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sat Sep 23 16:01:11 2017 -0400
parse change chair resolutions
---
lib/whimsy/asf/agenda/special.rb | 59 ++++++++++++++++------------
www/board/agenda/views/actions/todos.json.rb | 5 ++-
2 files changed, 38 insertions(+), 26 deletions(-)
diff --git a/lib/whimsy/asf/agenda/special.rb b/lib/whimsy/asf/agenda/special.rb
index 812e067..31a4064 100644
--- a/lib/whimsy/asf/agenda/special.rb
+++ b/lib/whimsy/asf/agenda/special.rb
@@ -68,6 +68,8 @@ class ASF::Board::Agenda
people += text.scan(/#{list_item}<(#{asfid})(?:@|\s*at\s*)
(?:\.\.\.|apache\.org|apache\sdot\sorg)>\s*$/xi)
+ need_chair = false
+
whimsy = 'https://whimsy.apache.org'
if title =~ /Change (.*?) Chair/ or title =~ /Terminate (\w+)$/
people.clear
@@ -95,36 +97,13 @@ class ASF::Board::Agenda
attrs['warnings'] ||= ['Unable to match expected number of names']
attrs['names'] = committee.names
end
+
+ need_chair = true
else
if title =~ /Establish (.*)/
name = $1
attrs['prior_reports'] =
"#{whimsy}/board/minutes/#{name.gsub(/\W/,'_')}"
- if text =~ /FURTHER RESOLVED, that\s+([^,]*?),?\s+be\b/
- chairname = $1.gsub(/\s+/, ' ').strip
-
- if chairname =~ /\s\(([-.\w]+)\)$/
- # if chair's id is present in parens, use that value
- attrs['chair'] = $1 unless $1.empty?
- chairname.sub! /\s+\(.*\)$/, ''
- else
- # match chair's name against people in the committee
- chair = people.find {|person| person.first == chairname}
- attrs['chair'] = (chair ? chair.last : nil)
- end
-
- unless people.include? [chairname, attrs['chair']]
- if people.empty?
- attrs['warnings'] ||= ['Unable to locate PMC email addresses']
- elsif attrs['chair']
- attrs['warnings'] ||= ['Chair not member of PMC']
- else
- attrs['warnings'] ||= ['Chair not found in resolution']
- end
- end
- else
- attrs['warnings'] ||= ['Chair not found in resolution']
- end
if text.scan(/[<(][-.\w]+@(?:[-\w]+\.)+\w+[>)]/).
any? {|email| not email.include? 'apache.org'}
@@ -132,6 +111,36 @@ class ASF::Board::Agenda
attrs['warnings'] ||= ['non apache.org email address found']
end
end
+
+ need_chair = true
+ end
+
+ if need_chair
+ if text =~ /FURTHER RESOLVED, that\s+([^,]*?),?\s+be\b/
+ chairname = $1.gsub(/\s+/, ' ').strip
+
+ if chairname =~ /\s\(([-.\w]+)\)$/
+ # if chair's id is present in parens, use that value
+ attrs['chair'] = $1 unless $1.empty?
+ chairname.sub! /\s+\(.*\)$/, ''
+ else
+ # match chair's name against people in the committee
+ chair = people.find {|person| person.first == chairname}
+ attrs['chair'] = (chair ? chair.last : nil)
+ end
+
+ unless people.include? [chairname, attrs['chair']]
+ if people.empty?
+ attrs['warnings'] ||= ['Unable to locate PMC email addresses']
+ elsif attrs['chair']
+ attrs['warnings'] ||= ['Chair not member of PMC']
+ else
+ attrs['warnings'] ||= ['Chair not found in resolution']
+ end
+ end
+ else
+ attrs['warnings'] ||= ['Chair not found in resolution']
+ end
end
people.map! do |name, id|
diff --git a/www/board/agenda/views/actions/todos.json.rb b/www/board/agenda/views/actions/todos.json.rb
index ded1848..b01abf1 100644
--- a/www/board/agenda/views/actions/todos.json.rb
+++ b/www/board/agenda/views/actions/todos.json.rb
@@ -172,10 +172,12 @@ end
transitioning = {}
establish = {}
terminate = {}
+change = []
Agenda.parse(agenda, :full).each do |item|
next unless item[:attach] =~ /^7\w$/
- if item['title'] =~ /^Change .*? Chair$/ and item['people']
+ if item['title'] =~ /^Change (.*?) Chair$/ and item['people']
+ change << {name: $1, resolution: item['title'], chair: item['chair']}
item['people'].keys.each do |person|
transitioning[ASF::Person.find(person)] = item['title']
end
@@ -196,6 +198,7 @@ _add add.map {|person| {id: person.id, name: person.public_name,
sort_by {|person| person[:id]}
_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}}
_terminate terminate.
--
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <co...@whimsical.apache.org>.