You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2018/04/03 14:01:12 UTC

[whimsy] branch master updated: Sample script to summarize all easily parseable board agendas

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

curcuru 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 8176675  Sample script to summarize all easily parseable board agendas
8176675 is described below

commit 8176675df9cc65ae723ccf120cffa899fe15cc70
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Tue Apr 3 10:00:59 2018 -0400

    Sample script to summarize all easily parseable board agendas
    
    Future use: called from monthly board meeting minutes publish script
    (only needs JSON updated monthly, after minutes approved)
---
 tools/agenda_summary.rb | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/tools/agenda_summary.rb b/tools/agenda_summary.rb
new file mode 100644
index 0000000..43dc29e
--- /dev/null
+++ b/tools/agenda_summary.rb
@@ -0,0 +1,49 @@
+#!/usr/bin/env ruby
+# Parse board meeting minutes and emit statistics
+$LOAD_PATH.unshift File.realpath(File.expand_path('../../lib', __FILE__))
+require 'whimsy/asf'
+require 'whimsy/asf/agenda'
+require 'json'
+require 'set'
+
+BOARD = ASF::SVN['private/foundation/board']
+STATS_ROLLUP = 'stats'
+
+# Create summary of statistics from 2007->up board minutes (includes private data)
+# Note that for F2F meetings or meetings before preapps, this won't parse reliably
+# @param dir pointing to /foundation/board/archived_agendas
+# @return stats hash of of various statistics from minutes
+def summarize_all(dir = BOARD)
+  summaries = Hash.new{|h,k| h[k] = {} }
+  Dir[File.join(dir, 'archived_agendas', "board_agenda_2007*.txt"), 
+    File.join(dir, 'archived_agendas', "board_agenda_2008*.txt"), 
+    File.join(dir, 'archived_agendas', "board_agenda_2009*.txt"), 
+    File.join(dir, 'archived_agendas', "board_agenda_201*.txt")].each do |f|
+      summaries[File.basename(f, '.*')] = ASF::Board::Agenda.summarize(f)
+  end
+  allpmcs = Set.new()
+  allpeople = Set.new()
+  summaries.each do |month, summary|
+    if summary['pmcs']
+      summary['pmcs'].each do |title, data|
+        allpmcs << title
+      end
+    end
+    if summary['people']
+      summary['people'].each do |id, pers|
+        allpeople << pers[:name] # Note: some keys are symbols from ASF::Board::Agenda.parse
+      end
+    end
+  end
+  summaries[STATS_ROLLUP]['allpmcs'] = allpmcs.to_a
+  summaries[STATS_ROLLUP]['allpeople'] = allpeople.to_a
+  return summaries
+end
+
+#### Main method - process default files and output JSON
+outfile = "meeting-summary.json"
+summaries = summarize_all()
+File.open(outfile, "w") do |f|
+  f.puts JSON.pretty_generate(summaries)
+end
+puts "DONE: emitted #{outfile}"

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