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 2018/05/23 00:41:20 UTC
[whimsy] branch master updated: extract parsed resolutions and
minutes for those 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
The following commit(s) were added to refs/heads/master by this push:
new 603dad0 extract parsed resolutions and minutes for those resolutions
603dad0 is described below
commit 603dad0782327bb82bf510741035a23348abee41
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Tue May 22 20:41:00 2018 -0400
extract parsed resolutions and minutes for those resolutions
---
www/board/agenda/views/committers_report.text.rb | 88 ++++++------------------
1 file changed, 21 insertions(+), 67 deletions(-)
diff --git a/www/board/agenda/views/committers_report.text.rb b/www/board/agenda/views/committers_report.text.rb
index da796cf..b632241 100644
--- a/www/board/agenda/views/committers_report.text.rb
+++ b/www/board/agenda/views/committers_report.text.rb
@@ -1,9 +1,6 @@
require 'chronic'
-## This is a script to generate an email for committers@apache.org from
-## an agenda file. It also requires the calendar.txt so it can determine
-## the next meeting's date and committee-info.txt so it can determine
-## who the VP is for a project.
+## This is a script to generate an email for committers@apache.org
# Add the right prefix to a number
def prefixNumber(number)
@@ -23,7 +20,7 @@ minutes_file = Dir[File.join(AGENDA_WORK, 'board_minutes_*.yml')].sort.
agenda_file = File.join(board_svn, File.basename(minutes_file).
sub('_minutes_', '_agenda_').sub('.yml', '.txt'))
minutes = YAML.load_file(minutes_file)
-agenda = Agenda.parse(File.basename(agenda_file), :quick)
+agenda = Agenda.parse(File.basename(agenda_file), :full)
# extract attendance from minutes and people from agenda
attendance = minutes['attendance'].select {|name, info| info[:present]}.
@@ -65,32 +62,19 @@ agenda.each do |item|
end
end
-##### Parse the agenda to find the data items above
-
-# Data items from agenda
-resolutions = Array.new
-
-# State variables
-parsing_resolutions = false
-
-File.open(agenda_file).each do |line|
-
- # 5: Get the list of resolutions
- if line =~ /\d. Special Orders/
- parsing_resolutions = true
- next
- end
- if parsing_resolutions
- if line =~ /\d. Discussion Items/
- parsing_resolutions = false
- next
- end
- if line =~ /^\s*[A-Z]\. /
- resolutions << line.strip
- next
- end
+# get list of resolutions
+approved_resolutions = Array.new
+other_resolutions = Array.new
+agenda.each do |item|
+ next unless item[:attach] =~ /^7[A-Z]/
+ title = item['fulltitle']
+ if minutes[item['title']] == 'unanimous'
+ chair = item['chair']
+ title += " (#{item['people'][chair][:name]}, VP)" if chair
+ approved_resolutions << title
+ else
+ other_resolutions << "The #{item['fulltitle']} resolution was #{minutes[item['title']]}."
end
-
end
##### 7: Find out the date of the next board report
@@ -99,36 +83,6 @@ next_meeting = ASF::Board.nextMeeting
next_meeting = prefixNumber(next_meeting.day) + " of " +
next_meeting.strftime('%B')
-##### 8: Find names of the VPs of TLPs in resolutions
-
-## this does not work, since new TLPs are not yet in committee-info.txt
-## instead we should parse this from the resolution
-
-committee_file = File.join(ASF::SVN['board'], 'committee-info.txt')
-parsing_projects = false
-resolution_to_chair = Hash.new
-File.open(committee_file).each do |line|
- if line =~ /\d. APACHE SOFTWARE FOUNDATION COMMITTEES/
- parsing_projects = true
- end
- if parsing_projects
- if line =~ /^\s+([\w\s]+)\s\s+([^<]*)<[^>]*>\s*$/
- project = $1
- chair = $2
- project = project.strip
- resolutions.each() do |resolution|
- if resolution =~ /#{project}/
- resolution_to_chair[resolution] = chair.strip
- end
- end
- end
- if line =~ /={76}/
- parsing_projects = false
- break
- end
- end
-end
-
##### Prepare the arrays for output
t_directors = attendance[:director].join(", ")
t_officers = attendance[:officer].join(", ")
@@ -152,19 +106,19 @@ else
t_missing_reports = ""
end
-if !resolutions.empty?
+if !approved_resolutions.empty?
t_resolutions = "The following resolutions were passed unanimously: \n\n"
- resolutions.each() do |resolution|
- t_resolutions += " #{resolution}";
- # if(resolution_to_chair[resolution])
- # t_resolutions += " (" + resolution_to_chair[resolution] +", VP)"
- # end
- t_resolutions += " (???, VP)\n"
+ approved_resolutions.each() do |resolution|
+ t_resolutions += " #{resolution}\n";
end
else
t_resolutions = ""
end
+if !other_resolutions.empty?
+ t_resolutions += "\n" + other_resolutions.join("\n") + "\n"
+end
+
##### Write the report
report = <<REPORT
PLEASE EDIT THIS, IT IS ONLY AN ESTIMATE.
--
To stop receiving notification emails like this one, please contact
rubys@apache.org.