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 14:55:52 UTC

[whimsy] 01/02: establish/sync ou=project

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

commit acc206f54dbe3c62861b284a5a209c2040433d69
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Fri Jul 21 08:54:32 2017 -0600

    establish/sync ou=project
---
 www/board/agenda/views/actions/todos.json.rb | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/www/board/agenda/views/actions/todos.json.rb b/www/board/agenda/views/actions/todos.json.rb
index 87d889f..25d5c25 100644
--- a/www/board/agenda/views/actions/todos.json.rb
+++ b/www/board/agenda/views/actions/todos.json.rb
@@ -120,13 +120,28 @@ if @establish and env.password
 
     ASF::LDAP.bind(env.user, env.password) do
       chairs.add [chair] unless chairs.members.include? chair
+      guineapig = ASF::Committee::GUINEAPIGS.include?(pmc.id)
 
-      if ASF::Group.find(pmc.downcase).members.empty?
-        ASF::Group.add(pmc.downcase, members)
+      # old style definitions
+      unless guineapig
+        if ASF::Group.find(pmc.downcase).members.empty?
+          ASF::Group.add(pmc.downcase, members)
+        end
+
+        if ASF::Committee.find(pmc.downcase).members.empty?
+          ASF::Committee.add(pmc.downcase, members)
+        end
       end
 
-      if ASF::Committee.find(pmc.downcase).members.empty?
-        ASF::Committee.add(pmc.downcase, members)
+      # new style definitions
+      project = ASF::Project.find(pmc.downcase)
+      if not project
+        project.create(members, members)
+      elsif not guineapig
+        # sync project owners with new PMC list
+	project.add_owners(members)
+	project.remove_owners(project.owners - members)
+	project.add_members(members)
       end
     end 
   end

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

Re: [whimsy] 01/02: establish/sync ou=project

Posted by sebb <se...@gmail.com>.
On 21 July 2017 at 15:55,  <ru...@apache.org> wrote:
> 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
>
> commit acc206f54dbe3c62861b284a5a209c2040433d69
> Author: Sam Ruby <ru...@intertwingly.net>
> AuthorDate: Fri Jul 21 08:54:32 2017 -0600
>
>     establish/sync ou=project
> ---
>  www/board/agenda/views/actions/todos.json.rb | 23 +++++++++++++++++++----
>  1 file changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/www/board/agenda/views/actions/todos.json.rb b/www/board/agenda/views/actions/todos.json.rb
> index 87d889f..25d5c25 100644
> --- a/www/board/agenda/views/actions/todos.json.rb
> +++ b/www/board/agenda/views/actions/todos.json.rb
> @@ -120,13 +120,28 @@ if @establish and env.password
>
>      ASF::LDAP.bind(env.user, env.password) do
>        chairs.add [chair] unless chairs.members.include? chair
> +      guineapig = ASF::Committee::GUINEAPIGS.include?(pmc.id)

Seems to me that Guineapig logic belongs in the ASF library, and
should not be repeated elsewhere.

> -      if ASF::Group.find(pmc.downcase).members.empty?
> -        ASF::Group.add(pmc.downcase, members)
> +      # old style definitions
> +      unless guineapig
> +        if ASF::Group.find(pmc.downcase).members.empty?
> +          ASF::Group.add(pmc.downcase, members)
> +        end
> +
> +        if ASF::Committee.find(pmc.downcase).members.empty?
> +          ASF::Committee.add(pmc.downcase, members)
> +        end
>        end
>
> -      if ASF::Committee.find(pmc.downcase).members.empty?
> -        ASF::Committee.add(pmc.downcase, members)
> +      # new style definitions
> +      project = ASF::Project.find(pmc.downcase)
> +      if not project
> +        project.create(members, members)
> +      elsif not guineapig
> +        # sync project owners with new PMC list
> +       project.add_owners(members)
> +       project.remove_owners(project.owners - members)
> +       project.add_members(members)
>        end
>      end
>    end
>
> --
> To stop receiving notification emails like this one, please contact
> "commits@whimsical.apache.org" <co...@whimsical.apache.org>.