[ARVADOS] updated: 2.1.0-447-g1378a4432

Git user git at public.arvados.org
Wed Mar 3 15:35:30 UTC 2021


Summary of changes:
 lib/controller/rpc/conn.go                         |  2 ++
 sdk/go/arvados/fs_project_test.go                  | 11 +++++++++
 sdk/go/arvados/fs_site_test.go                     |  1 +
 .../controllers/arvados/v1/groups_controller.rb    | 28 +++++++++++-----------
 services/api/lib/fix_roles_projects.rb             |  4 ++--
 services/api/test/fixtures/groups.yml              | 13 ++++++++++
 6 files changed, 43 insertions(+), 16 deletions(-)

       via  1378a4432324e68a3d09bf23fb5926b3050d0599 (commit)
      from  96370576f11dd97429dd5a2424de7a5cafaa84ca (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 1378a4432324e68a3d09bf23fb5926b3050d0599
Author: Ward Vandewege <ward at curii.com>
Date:   Tue Mar 2 20:07:23 2021 -0500

    17119: add second test.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/lib/controller/rpc/conn.go b/lib/controller/rpc/conn.go
index 6941e1487..b61dbd1b3 100644
--- a/lib/controller/rpc/conn.go
+++ b/lib/controller/rpc/conn.go
@@ -483,6 +483,8 @@ func (conn *Conn) GroupContents(ctx context.Context, options arvados.GroupConten
 				options.Filters = append(options.Filters, filter)
 			}
 		}
+		// Use the generic /groups/contents endpoint for filter groups
+		options.UUID = ""
 	}
 
 	ep := arvados.EndpointGroupContents
diff --git a/sdk/go/arvados/fs_project_test.go b/sdk/go/arvados/fs_project_test.go
index 56a2bb826..2633a16dd 100644
--- a/sdk/go/arvados/fs_project_test.go
+++ b/sdk/go/arvados/fs_project_test.go
@@ -53,6 +53,17 @@ func (s *SiteFSSuite) TestFilterGroup(c *check.C) {
 
 	_, err = s.fs.OpenFile("/fg/A Project", 0, 0)
 	c.Assert(err, check.Not(check.IsNil))
+
+	s.fs.MountProject("fg2", fixtureAFilterGroupTwoUUID)
+
+	_, err = s.fs.OpenFile("/fg2/baz_file", 0, 0)
+	c.Assert(err, check.IsNil)
+
+	_, err = s.fs.OpenFile("/fg2/A Subproject", 0, 0)
+	c.Assert(err, check.IsNil)
+
+	_, err = s.fs.OpenFile("/fg2/A Project", 0, 0)
+	c.Assert(err, check.Not(check.IsNil))
 }
 
 func (s *SiteFSSuite) TestCurrentUserHome(c *check.C) {
diff --git a/sdk/go/arvados/fs_site_test.go b/sdk/go/arvados/fs_site_test.go
index 9245023ba..02f21ded5 100644
--- a/sdk/go/arvados/fs_site_test.go
+++ b/sdk/go/arvados/fs_site_test.go
@@ -19,6 +19,7 @@ const (
 	fixtureActiveToken             = "3kg6k6lzmp9kj5cpkcoxie963cmvjahbt2fod9zru30k1jqdmi"
 	fixtureAProjectUUID            = "zzzzz-j7d0g-v955i6s2oi1cbso"
 	fixtureThisFilterGroupUUID     = "zzzzz-j7d0g-thisfiltergroup"
+	fixtureAFilterGroupTwoUUID     = "zzzzz-j7d0g-afiltergrouptwo"
 	fixtureFooAndBarFilesInDirUUID = "zzzzz-4zz18-foonbarfilesdir"
 	fixtureFooCollectionName       = "zzzzz-4zz18-fy296fx3hot09f7 added sometime"
 	fixtureFooCollectionPDH        = "1f4b0bc7583c2a7f9102c395f4ffc5e3+45"
diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb
index 79d7b2fb5..511332e46 100644
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@ -229,29 +229,29 @@ class Arvados::V1::GroupsController < ApplicationController
 
     # filter groups need to be limited to those classes mentioned in the filters
     # @object can also be a User object (virtual home project)
-    if @object and @object.is_a?(Group) and @object.group_class == "filter"
-      if request_filters.length() == 0
-        raise ArgumentError.new("Filter group needs to have filters defined")
-      end
-      request_filters.each do |col, op, val|
-        if col.index('.')
-          col = col.split('.')[0]
-          col = col.capitalize.sub(/s$/,'')
-          wanted_klasses << col
-        end
-      end
-    end
+    #if @object and @object.is_a?(Group) and @object.group_class == "filter"
+    #  if request_filters.length() == 0
+    #    raise ArgumentError.new("Filter group needs to have filters defined")
+    #  end
+    #  request_filters.each do |col, op, val|
+    #    if col.index('.')
+    #      col = col.split('.')[0]
+    #      col = col.capitalize.sub(/s$/,'')
+    #      wanted_klasses << col
+    #    end
+    #  end
+    #end
 
     filter_by_owner = {}
     if @object
       # filter groups should not have an owner_uuid filter applied
-      if ! @object.is_a?(Group) or (@object.is_a?(Group) and @object.group_class != "filter")
+      #if ! @object.is_a?(Group) or (@object.is_a?(Group) and @object.group_class != "filter")
         if params['recursive']
           filter_by_owner[:owner_uuid] = [@object.uuid] + @object.descendant_project_uuids
         else
           filter_by_owner[:owner_uuid] = @object.uuid
         end
-      end
+      #end
 
       if params['exclude_home_project']
         raise ArgumentError.new "Cannot use 'exclude_home_project' with a parent object"
diff --git a/services/api/lib/fix_roles_projects.rb b/services/api/lib/fix_roles_projects.rb
index 5bb013c9a..79fea4590 100644
--- a/services/api/lib/fix_roles_projects.rb
+++ b/services/api/lib/fix_roles_projects.rb
@@ -13,8 +13,8 @@ def fix_roles_projects
     # shouldn't be anything to do at all.
     act_as_system_user do
       ActiveRecord::Base.transaction do
-        Group.where("group_class != 'project' or group_class is null").each do |g|
-          # 1) any group not group_class != project becomes a 'role' (both empty and invalid groups)
+        Group.where("(group_class != 'project' and group_class != 'filter') or group_class is null").each do |g|
+          # 1) any group not group_class != project and != filter becomes a 'role' (both empty and invalid groups)
           old_owner = g.owner_uuid
           g.owner_uuid = system_user_uuid
           g.group_class = 'role'
diff --git a/services/api/test/fixtures/groups.yml b/services/api/test/fixtures/groups.yml
index bf0641891..c2ed42a15 100644
--- a/services/api/test/fixtures/groups.yml
+++ b/services/api/test/fixtures/groups.yml
@@ -120,6 +120,19 @@ afiltergroup:
   properties:
     filters: [[ "collections.name", "like", "baz%" ], [ "groups.name", "=", "A Subproject" ]]
 
+afiltergroup2:
+  uuid: zzzzz-j7d0g-afiltergrouptwo
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  created_at: 2014-04-21 15:37:48 -0400
+  modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  modified_at: 2014-04-21 15:37:48 -0400
+  updated_at: 2014-04-21 15:37:48 -0400
+  name: A filter group with abbreviated filters
+  group_class: filter
+  properties:
+    filters: [[ "name", "like", "baz%" ], [ "name", "=", "A Subproject" ]]
+
 future_project_viewing_group:
   uuid: zzzzz-j7d0g-futrprojviewgrp
   owner_uuid: zzzzz-tpzed-000000000000000

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list