whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Get chairs from ASF::Committee data
Date Sat, 27 Mar 2021 17:49:48 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb 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 2241fe9  Get chairs from ASF::Committee data
2241fe9 is described below

commit 2241fe9aa5f943e46d5cb96768fb9df4b1df951f
Author: Sebb <sebb@apache.org>
AuthorDate: Sat Mar 27 17:49:41 2021 +0000

    Get chairs from ASF::Committee data
---
 lib/whimsy/asf/orgchart.rb | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/lib/whimsy/asf/orgchart.rb b/lib/whimsy/asf/orgchart.rb
index fc17eef..087e0c4 100644
--- a/lib/whimsy/asf/orgchart.rb
+++ b/lib/whimsy/asf/orgchart.rb
@@ -3,6 +3,8 @@
 # data.
 module ASF # :nodoc:
 
+  ASF::Committee.load_committee_metadata
+
   ##
   # Reads and provides access to the
   # <tt>officers/personnel-duties/ROLENAME.yaml</tt> files.
@@ -19,6 +21,26 @@ module ASF # :nodoc:
         data = Hash[*File.read(file).split(/^\[(.*)\]\n/)[1..-1].map(&:strip)]
         next unless data['info']
         data['info'] = YAML.safe_load(data['info'])
+        # fix up data items available from elsewhere
+        if name =~ %r{^vp-(.+)$} or name =~ %r{^(security)$}
+          post = $1
+          begin
+            data['info']['id'] = ASF::Committee[post].chairs.first[:id]
+          rescue
+            begin
+              data['info']['id'] = ASF::Committee.officers.select{|o| o.name == post}.first.chairs.first[:id]
+            rescue
+              Wunderbar.warn "Cannot find chair for #{name}"
+            end
+          end
+        else
+          tmp = ASF::Committee.officers.select{|o| o.name == name}.first
+          if tmp
+            data['info']['id'] = tmp.chairs.first[:id]
+          else
+            Wunderbar.warn "Cannot find chair for #{name}"
+          end
+        end
         data['mtime'] = File.mtime(file).to_f
         @@duties[name] = data
       end

Mime
View raw message