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 2016/04/21 16:39:40 UTC

[whimsy] branch master updated: track completed todos

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

rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  363e8ac   track completed todos
363e8ac is described below

commit 363e8acc5958d87a87918042161e7bcc3b2fc96d
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Apr 21 10:39:24 2016 -0400

    track completed todos
---
 www/board/agenda/views/actions/feedback.json.rb | 10 +++++++++
 www/board/agenda/views/actions/todos.json.rb    | 29 +++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/www/board/agenda/views/actions/feedback.json.rb b/www/board/agenda/views/actions/feedback.json.rb
index d014531..73a1dad 100644
--- a/www/board/agenda/views/actions/feedback.json.rb
+++ b/www/board/agenda/views/actions/feedback.json.rb
@@ -80,4 +80,14 @@ Agenda.parse(@agenda, :full).each do |item|
   }
 end
 
+# indicate that feedback has been sent
+unless @dryrun
+  minutes[:todos] ||= {}
+  minutes[:todos][:feedback_sent] ||= []
+  minutes[:todos][:feedback_sent] += output.map {|item| item[:title]}
+  File.write minutes_file, YAML.dump(minutes)
+  IPC.post type: :minutes, agenda: @agenda, value: minutes
+end
+
+# return output to client
 output
diff --git a/www/board/agenda/views/actions/todos.json.rb b/www/board/agenda/views/actions/todos.json.rb
index 8b9c4fb..08a1e9b 100644
--- a/www/board/agenda/views/actions/todos.json.rb
+++ b/www/board/agenda/views/actions/todos.json.rb
@@ -10,6 +10,20 @@ agenda = "board_agenda_#{date}.txt"
 victims = Dir["#{TLPREQ}/victims-#{date}.*.txt"].
   map {|name| File.read(name.untaint).lines().map(&:chomp)}.flatten
 
+# fetch minutes
+@minutes = agenda.sub('_agenda_', '_minutes_')
+minutes_file = "#{AGENDA_WORK}/#{@minutes.sub('.txt', '.yml')}"
+minutes_file.untaint if @minutes =~ /^board_minutes_\d+_\d+_\d+\.txt$/
+
+if File.exist? minutes_file
+  minutes = YAML.load_file(minutes_file) || {}
+else
+  minutes = {}
+end
+
+minutes[:todos] ||= {}
+todos = minutes[:todos].dup
+
 ########################################################################
 #                               Actions                                #
 ########################################################################
@@ -23,6 +37,9 @@ if @remove and env.password
   ASF::LDAP.bind(env.user, env.password) do
     chairs.remove people
   end
+
+  minutes[:todos][:removed] ||= []
+  minutes[:todos][:removed] += people.map {|person| person.id}
 end
 
 if @add and env.password
@@ -34,6 +51,9 @@ if @add and env.password
   ASF::LDAP.bind(env.user, env.password) do
     chairs.add people
   end
+
+  minutes[:todos][:added] ||= []
+  minutes[:todos][:added] += people.map {|person| person.id}
 end
 
 if @establish and env.password
@@ -54,6 +74,14 @@ if @establish and env.password
       system "svn rm --force #{filename}"
     end
   end
+
+  minutes[:todos][:established] ||= []
+  minutes[:todos][:established] += establish
+end
+
+unless todos == minutes[:todos]
+  File.write minutes_file, YAML.dump(minutes)
+  IPC.post type: :minutes, agenda: @agenda, value: minutes
 end
 
 ########################################################################
@@ -91,3 +119,4 @@ _establish establish.
   map {|name, resolution| {name: name, resolution: resolution}}
 _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>'].