You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sebastian Bazley <se...@apache.org> on 2016/03/13 14:52:03 UTC

[whimsy.git] [1/1] Commit ac22751: More checks for icla presence

Commit ac227514d192687ff0295d3fa8cf322ae5630a46:
    More checks for icla presence


Branch: refs/heads/master
Author: Sebb <se...@apache.org>
Committer: Sebb <se...@apache.org>
Pusher: sebb <se...@apache.org>

------------------------------------------------------------
www/roster/models/committer.rb                               | +++++++ ------
------------------------------------------------------------
24 changes: 13 additions, 11 deletions.
------------------------------------------------------------


diff --git a/www/roster/models/committer.rb b/www/roster/models/committer.rb
index fea585a..3f3317d 100644
--- a/www/roster/models/committer.rb
+++ b/www/roster/models/committer.rb
@@ -73,7 +73,7 @@ def self.serialize(id, env)
     if ASF::Person.find(env.user).asf_member?
       response[:forms] = {}
 
-      if person.icla.claRef # Not all people have iclas
+      if person.icla and person.icla.claRef # Not all people have iclas
         iclas = ASF::SVN['private/documents/iclas']
         if File.exist? File.join(iclas, person.icla.claRef + '.pdf')
           response[:forms][:icla] = person.icla.claRef + '.pdf'
@@ -84,19 +84,21 @@ def self.serialize(id, env)
 
       member = {}
 
-      if person.asf_member?
+      if person.asf_member? # TODO is this the correct check? it includes people in members unix group
         member[:info] = person.members_txt
         member[:status] = ASF::Member.status[id] || 'Active'
 
-        apps = ASF::SVN['private/documents/member_apps']
-        [
-          person.icla.legal_name, 
-          person.icla.name,
-          member[:info].split("\n").first.strip
-        ].uniq.each do |name|
-          memapp = name.downcase.gsub(/\s/, '-')
-          if apps and File.exist? File.join(apps, memapp + '.pdf')
-            response[:forms][:member] = memapp + '.pdf'
+        if person.icla # not all members have iclas
+          apps = ASF::SVN['private/documents/member_apps']
+          [
+            person.icla.legal_name, 
+            person.icla.name,
+            member[:info].split("\n").first.strip
+          ].uniq.each do |name|
+            memapp = name.downcase.gsub(/\s/, '-')
+            if apps and File.exist? File.join(apps, memapp + '.pdf')
+              response[:forms][:member] = memapp + '.pdf'
+            end
           end
         end
       else

Re: [whimsy.git] [1/1] Commit ac22751: More checks for icla presence

Posted by Sam Ruby <ru...@intertwingly.net>.
On Sun, Mar 13, 2016 at 10:36 AM, sebb <se...@gmail.com> wrote:
> On 13 March 2016 at 14:16, sebb <se...@gmail.com> wrote:
>> On 13 March 2016 at 14:09, Sam Ruby <ru...@intertwingly.net> wrote:
>>> On Sun, Mar 13, 2016 at 9:52 AM, Sebastian Bazley <se...@apache.org> wrote:
>>>>
>>>> -      if person.asf_member?
>>>> +      if person.asf_member? # TODO is this the correct check? it includes people in members unix group
>>>>          member[:info] = person.members_txt
>>>
>>> In this particular case, I think so.  It will only include information
>>> from members.txt in the view if you have read access to members.txt.
>>
>> Yes, but not everyone in the members unix group is an actual ASF
>> member with info in members.txt.
>> e.g. pono and other contractors
>>
>> Have a look at
>>
>> https://whimsy.apache.org/roster/committer/pono
>
> More to the point, the member_nomination details are only set up if
> the person is not a person.asf_member.
>
> I.e. had pono been nominated, the code would assume he was already a
> member and not show the info.
>
> I wonder whether ASF::Person::asf_member?() should include Unix members at all.
> Or perhaps there need to be two methods:
> asf_isMember?
> asf_hasMemberKarma?

I'm fine with these changes, though I would probably leave the
original name in for a period of time as an alias.

I would prefer if pages such as pono's continued to reflect his status
as being a part of the members group but not being listed in
members.txt.

- Sam Ruby

Re: [whimsy.git] [1/1] Commit ac22751: More checks for icla presence

Posted by sebb <se...@gmail.com>.
On 13 March 2016 at 14:16, sebb <se...@gmail.com> wrote:
> On 13 March 2016 at 14:09, Sam Ruby <ru...@intertwingly.net> wrote:
>> On Sun, Mar 13, 2016 at 9:52 AM, Sebastian Bazley <se...@apache.org> wrote:
>>>
>>> -      if person.asf_member?
>>> +      if person.asf_member? # TODO is this the correct check? it includes people in members unix group
>>>          member[:info] = person.members_txt
>>
>> In this particular case, I think so.  It will only include information
>> from members.txt in the view if you have read access to members.txt.
>
> Yes, but not everyone in the members unix group is an actual ASF
> member with info in members.txt.
> e.g. pono and other contractors
>
> Have a look at
>
> https://whimsy.apache.org/roster/committer/pono

More to the point, the member_nomination details are only set up if
the person is not a person.asf_member.

I.e. had pono been nominated, the code would assume he was already a
member and not show the info.

I wonder whether ASF::Person::asf_member?() should include Unix members at all.
Or perhaps there need to be two methods:
asf_isMember?
asf_hasMemberKarma?

>> - Sam Ruby

Re: [whimsy.git] [1/1] Commit ac22751: More checks for icla presence

Posted by sebb <se...@gmail.com>.
On 13 March 2016 at 14:09, Sam Ruby <ru...@intertwingly.net> wrote:
> On Sun, Mar 13, 2016 at 9:52 AM, Sebastian Bazley <se...@apache.org> wrote:
>>
>> -      if person.asf_member?
>> +      if person.asf_member? # TODO is this the correct check? it includes people in members unix group
>>          member[:info] = person.members_txt
>
> In this particular case, I think so.  It will only include information
> from members.txt in the view if you have read access to members.txt.

Yes, but not everyone in the members unix group is an actual ASF
member with info in members.txt.
e.g. pono and other contractors

Have a look at

https://whimsy.apache.org/roster/committer/pono

> - Sam Ruby

Re: [whimsy.git] [1/1] Commit ac22751: More checks for icla presence

Posted by Sam Ruby <ru...@intertwingly.net>.
On Sun, Mar 13, 2016 at 9:52 AM, Sebastian Bazley <se...@apache.org> wrote:
>
> -      if person.asf_member?
> +      if person.asf_member? # TODO is this the correct check? it includes people in members unix group
>          member[:info] = person.members_txt

In this particular case, I think so.  It will only include information
from members.txt in the view if you have read access to members.txt.

- Sam Ruby