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 2017/07/21 13:08:07 UTC

[whimsy] branch master updated: prep for dual maintenance

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

rubys 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 3218fcc  prep for dual maintenance
3218fcc is described below

commit 3218fcc59ea6b3b7f6d8fddae928207678a8d32b
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Fri Jul 21 07:00:38 2017 -0600

    prep for dual maintenance
    
    instead of having tools all having to worry about two types of definitions,
    maintain dual rosters for a period of time while still having guinea pigs
    that only have the new format LDAP rosters
---
 lib/whimsy/asf/ldap.rb | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index b680bfe..87ad57a 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -880,6 +880,12 @@ module ASF
       ASF.search_one(base, filter, 'cn').flatten.map {|cn| Project.find(cn)}
     end
 
+    # return project only if it actually exits
+    def self.[] name
+      project = super
+      project.members.empty? ? nil : project
+    end
+
     # fetch <tt>dn</tt>, <tt>member</tt>, <tt>modifyTimestamp</tt>, and
     # <tt>createTimestamp</tt> for all projects in LDAP.
     def self.preload
@@ -1091,6 +1097,8 @@ module ASF
       if GUINEAPIGS.include? name
         ASF::Project.find(name).remove_owners(people)
       else
+        project = ASF::Project['name']
+        project.remove_owners(people) if project
         remove(people)
       end
     end
@@ -1100,6 +1108,8 @@ module ASF
       if GUINEAPIGS.include? name
         ASF::Project.find(name).remove_members(people)
       else
+        project = ASF::Project['name']
+        project.remove_members(people) if project
         ASF::Group.find(name).remove(people)
       end
     end
@@ -1109,6 +1119,8 @@ module ASF
       if GUINEAPIGS.include? name
         ASF::Project.find(name).add_owners(people)
       else
+        project = ASF::Project['name']
+        project.add_owners(people) if project
         add(people)
       end
     end
@@ -1119,6 +1131,8 @@ module ASF
       if GUINEAPIGS.include? name
         ASF::Project.find(name).add_members(people)
       else
+        project = ASF::Project['name']
+        project.add_members(people) if project
         ASF::Group.find(name).add(people)
       end
     end

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].