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/02/22 18:03:49 UTC

[1/2] whimsy git commit: quick and dirty cross-check

Repository: whimsy
Updated Branches:
  refs/heads/master c283f6795 -> 2075b050e


quick and dirty cross-check


Project: https://git-dual.apache.org/repos/asf/whimsy/repo
Commit: https://git-dual.apache.org/repos/asf/whimsy/commit/2075b050
Tree: https://git-dual.apache.org/repos/asf/whimsy/tree/2075b050
Diff: https://git-dual.apache.org/repos/asf/whimsy/diff/2075b050

Branch: refs/heads/master
Commit: 2075b050ed8cfbd65fdbbc945b5a569f828af859
Parents: 5c728a6
Author: Sam Ruby <ru...@intertwingly.net>
Authored: Mon Feb 22 12:02:53 2016 -0500
Committer: Sam Ruby <ru...@intertwingly.net>
Committed: Mon Feb 22 12:03:36 2016 -0500

----------------------------------------------------------------------
 www/members/attendance-xcheck.cgi | 38 ++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
----------------------------------------------------------------------


https://git-dual.apache.org/repos/asf/whimsy/blob/2075b050/www/members/attendance-xcheck.cgi
----------------------------------------------------------------------
diff --git a/www/members/attendance-xcheck.cgi b/www/members/attendance-xcheck.cgi
new file mode 100755
index 0000000..1010801
--- /dev/null
+++ b/www/members/attendance-xcheck.cgi
@@ -0,0 +1,38 @@
+#!/usr/bin/ruby1.9.1
+$LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
+
+require 'whimsy/asf'
+require 'json'
+
+# read in attendance
+meetings = ASF::SVN['private/foundation/Meetings']
+json = JSON.parse(IO.read "#{meetings}/attendance.json")
+attend = json['matrix'].keys
+
+# cross check against members.txt
+missing = []
+ASF::Member.list.each do |id, info|
+  missing << info[:name] unless attend.delete info[:name] or info['status']
+end
+missing.delete ''
+
+# produce HTML
+_html do
+  _h1_ 'members.txt vs attendance.json cross-check'
+
+  _h2_ 'Listed as attending a members meeting, but not in members.txt'
+
+  _ul do
+    attend.sort.each do |name|
+      _li name
+    end
+  end
+  
+  _h2_ 'Listed in members.txt but not listed as attending a members meeting'
+
+  _ul do
+    missing.sort.each do |name|
+      _li name
+    end
+  end
+end


Re: [1/2] whimsy git commit: quick and dirty cross-check

Posted by sebb <se...@gmail.com>.
Fixed.

On 22 February 2016 at 18:21, sebb <se...@gmail.com> wrote:
> On 22 February 2016 at 17:03,  <ru...@apache.org> wrote:
>> Repository: whimsy
>> Updated Branches:
>>   refs/heads/master c283f6795 -> 2075b050e
>>
>>
>> quick and dirty cross-check
>>
>>
>> Project: https://git-dual.apache.org/repos/asf/whimsy/repo
>> Commit: https://git-dual.apache.org/repos/asf/whimsy/commit/2075b050
>> Tree: https://git-dual.apache.org/repos/asf/whimsy/tree/2075b050
>> Diff: https://git-dual.apache.org/repos/asf/whimsy/diff/2075b050
>>
>> Branch: refs/heads/master
>> Commit: 2075b050ed8cfbd65fdbbc945b5a569f828af859
>> Parents: 5c728a6
>> Author: Sam Ruby <ru...@intertwingly.net>
>> Authored: Mon Feb 22 12:02:53 2016 -0500
>> Committer: Sam Ruby <ru...@intertwingly.net>
>> Committed: Mon Feb 22 12:03:36 2016 -0500
>>
>> ----------------------------------------------------------------------
>>  www/members/attendance-xcheck.cgi | 38 ++++++++++++++++++++++++++++++++++
>>  1 file changed, 38 insertions(+)
>> ----------------------------------------------------------------------
>>
>>
>> https://git-dual.apache.org/repos/asf/whimsy/blob/2075b050/www/members/attendance-xcheck.cgi
>> ----------------------------------------------------------------------
>> diff --git a/www/members/attendance-xcheck.cgi b/www/members/attendance-xcheck.cgi
>> new file mode 100755
>> index 0000000..1010801
>> --- /dev/null
>> +++ b/www/members/attendance-xcheck.cgi
>> @@ -0,0 +1,38 @@
>> +#!/usr/bin/ruby1.9.1
>> +$LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
>> +
>> +require 'whimsy/asf'
>> +require 'json'
>> +
>> +# read in attendance
>> +meetings = ASF::SVN['private/foundation/Meetings']
>> +json = JSON.parse(IO.read "#{meetings}/attendance.json")
>> +attend = json['matrix'].keys
>> +
>> +# cross check against members.txt
>
> Unfortunately members.txt is not a good source for canonical public names.
>
> Also names with (nick) comments are truncated.
> This is presumably to cater for (deceased...) entries.
> I'll try to fix that.
>
>> +missing = []
>> +ASF::Member.list.each do |id, info|
>> +  missing << info[:name] unless attend.delete info[:name] or info['status']
>> +end
>> +missing.delete ''
>> +
>> +# produce HTML
>> +_html do
>> +  _h1_ 'members.txt vs attendance.json cross-check'
>> +
>> +  _h2_ 'Listed as attending a members meeting, but not in members.txt'
>> +
>> +  _ul do
>> +    attend.sort.each do |name|
>> +      _li name
>> +    end
>> +  end
>> +
>> +  _h2_ 'Listed in members.txt but not listed as attending a members meeting'
>> +
>> +  _ul do
>> +    missing.sort.each do |name|
>> +      _li name
>> +    end
>> +  end
>> +end
>>

Re: [1/2] whimsy git commit: quick and dirty cross-check

Posted by sebb <se...@gmail.com>.
On 22 February 2016 at 17:03,  <ru...@apache.org> wrote:
> Repository: whimsy
> Updated Branches:
>   refs/heads/master c283f6795 -> 2075b050e
>
>
> quick and dirty cross-check
>
>
> Project: https://git-dual.apache.org/repos/asf/whimsy/repo
> Commit: https://git-dual.apache.org/repos/asf/whimsy/commit/2075b050
> Tree: https://git-dual.apache.org/repos/asf/whimsy/tree/2075b050
> Diff: https://git-dual.apache.org/repos/asf/whimsy/diff/2075b050
>
> Branch: refs/heads/master
> Commit: 2075b050ed8cfbd65fdbbc945b5a569f828af859
> Parents: 5c728a6
> Author: Sam Ruby <ru...@intertwingly.net>
> Authored: Mon Feb 22 12:02:53 2016 -0500
> Committer: Sam Ruby <ru...@intertwingly.net>
> Committed: Mon Feb 22 12:03:36 2016 -0500
>
> ----------------------------------------------------------------------
>  www/members/attendance-xcheck.cgi | 38 ++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> ----------------------------------------------------------------------
>
>
> https://git-dual.apache.org/repos/asf/whimsy/blob/2075b050/www/members/attendance-xcheck.cgi
> ----------------------------------------------------------------------
> diff --git a/www/members/attendance-xcheck.cgi b/www/members/attendance-xcheck.cgi
> new file mode 100755
> index 0000000..1010801
> --- /dev/null
> +++ b/www/members/attendance-xcheck.cgi
> @@ -0,0 +1,38 @@
> +#!/usr/bin/ruby1.9.1
> +$LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
> +
> +require 'whimsy/asf'
> +require 'json'
> +
> +# read in attendance
> +meetings = ASF::SVN['private/foundation/Meetings']
> +json = JSON.parse(IO.read "#{meetings}/attendance.json")
> +attend = json['matrix'].keys
> +
> +# cross check against members.txt

Unfortunately members.txt is not a good source for canonical public names.

Also names with (nick) comments are truncated.
This is presumably to cater for (deceased...) entries.
I'll try to fix that.

> +missing = []
> +ASF::Member.list.each do |id, info|
> +  missing << info[:name] unless attend.delete info[:name] or info['status']
> +end
> +missing.delete ''
> +
> +# produce HTML
> +_html do
> +  _h1_ 'members.txt vs attendance.json cross-check'
> +
> +  _h2_ 'Listed as attending a members meeting, but not in members.txt'
> +
> +  _ul do
> +    attend.sort.each do |name|
> +      _li name
> +    end
> +  end
> +
> +  _h2_ 'Listed in members.txt but not listed as attending a members meeting'
> +
> +  _ul do
> +    missing.sort.each do |name|
> +      _li name
> +    end
> +  end
> +end
>

[2/2] whimsy git commit: start to decouple from 2015

Posted by ru...@apache.org.
start to decouple from 2015


Project: https://git-dual.apache.org/repos/asf/whimsy/repo
Commit: https://git-dual.apache.org/repos/asf/whimsy/commit/5c728a62
Tree: https://git-dual.apache.org/repos/asf/whimsy/tree/5c728a62
Diff: https://git-dual.apache.org/repos/asf/whimsy/diff/5c728a62

Branch: refs/heads/master
Commit: 5c728a62986f78577cfaec8111d6beac1210d033
Parents: c283f67
Author: Sam Ruby <ru...@intertwingly.net>
Authored: Mon Feb 22 10:11:27 2016 -0500
Committer: Sam Ruby <ru...@intertwingly.net>
Committed: Mon Feb 22 12:03:36 2016 -0500

----------------------------------------------------------------------
 www/members/nominations.cgi | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


https://git-dual.apache.org/repos/asf/whimsy/blob/5c728a62/www/members/nominations.cgi
----------------------------------------------------------------------
diff --git a/www/members/nominations.cgi b/www/members/nominations.cgi
index 8c6d738..67c8413 100755
--- a/www/members/nominations.cgi
+++ b/www/members/nominations.cgi
@@ -6,16 +6,19 @@ require 'wunderbar'
 require 'whimsy/asf'
 
 # link to members private-arch
-MBOX = "https://mail-search.apache.org/members/private-arch/members/201503.mbox/"
+MBOX = 'https://mail-search.apache.org/members/private-arch/members/'
 
 # get a list of current members messages
 archive = Dir['/home/apmail/members/archive/*/*']
 
 # select messages that have a subject line starting with [MEMBER NOMINATION]
 emails = []
+year = Time.new.year.to_s
 archive.each do |email|
   next if email.end_with? '/index'
   message = IO.read(email, mode: 'rb')
+  puts message[/^Date: .*/]
+  next unless message[/^Date: .*/].to_s.include? year
   subject = message[/^Subject: .*/]
   next unless subject.include? "[MEMBER NOMINATION]"
   mail = Mail.new(message)
@@ -28,7 +31,8 @@ meeting = Dir["#{MEETINGS}/2*"].sort.last
 nominations = IO.read("#{meeting}/nominated-members.txt").
   scan(/^-+--\s+(.*?)\n/).flatten.
   map {|name| name.gsub(/<.*|\(\w+@.*/, '').strip}
-nominations.shift
+nominations.shift if nominations.first.empty?
+nominations.pop if nominations.last.empty?
 
 
 url = `cd #{meeting}; svn info`[/URL: (.*)/, 1]
@@ -58,7 +62,8 @@ _html do
   # output an unordered list of subjects linked to the message archive
   _ul emails do |mail|
     _li do
-      href = MBOX + URI.escape('<' + mail.message_id + '>')
+      href = MBOX + mail.date.strftime('%Y%m') + '.mbox/' + 
+        URI.escape('<' + mail.message_id + '>')
 
       if nominations.any? {|name| mail.subject.downcase =~ /\b#{name}\b/}
         _a.present mail.subject, href: href