[ARVADOS] updated: 1.1.4-775-geb1c9afa9
Git user
git at public.curoverse.com
Thu Aug 16 14:49:27 EDT 2018
Summary of changes:
services/api/app/controllers/application_controller.rb | 4 ++--
.../api/app/controllers/arvados/v1/groups_controller.rb | 12 ++++++++----
services/api/test/fixtures/groups.yml | 8 ++++++++
.../test/functional/arvados/v1/groups_controller_test.rb | 16 ++++++++--------
services/fuse/arvados_fuse/fusedir.py | 9 +++++----
5 files changed, 31 insertions(+), 18 deletions(-)
via eb1c9afa9a92c1506e5d4d1161b6e74d919e8f00 (commit)
from 0ba8a53ba145475153b01dc498f85dbd2f03228b (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 eb1c9afa9a92c1506e5d4d1161b6e74d919e8f00
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Thu Aug 16 14:48:36 2018 -0400
13146: Add "include" parameter and rename return field to "included"
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 9159afed8..a30047687 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -78,7 +78,7 @@ class ApplicationController < ActionController::Base
@distinct = nil
@response_resource_name = nil
@attrs = nil
- @extra_include = nil
+ @extra_included = nil
end
def default_url_options
@@ -492,7 +492,7 @@ class ApplicationController < ActionController::Base
:offset => @offset,
:limit => @limit,
:items => @objects.as_api_response(nil, {select: @select}),
- :include => @extra_include
+ :included => @extra_included
}
case params[:count]
when nil, '', 'exact'
diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb
index daa8ad132..18a58c71f 100644
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@ -103,15 +103,19 @@ class Arvados::V1::GroupsController < ApplicationController
owners = @objects.map(&:owner_uuid).to_a
- @extra_include = []
- @extra_include += Group.readable_by(*@read_users).where(uuid: owners).to_a
- @extra_include += User.readable_by(*@read_users).where(uuid: owners).to_a
+ if params["include"] == "owner_uuid"
+ @extra_included = []
+ @extra_included += Group.readable_by(*@read_users).where(uuid: owners).to_a
+ @extra_included += User.readable_by(*@read_users).where(uuid: owners).to_a
+ end
index
end
def self._shared_requires_parameters
- self._index_requires_parameters
+ rp = self._index_requires_parameters
+ rp[:include] = { type: 'string', required: false }
+ rp
end
protected
diff --git a/services/api/test/fixtures/groups.yml b/services/api/test/fixtures/groups.yml
index 68cc76949..92a1ced52 100644
--- a/services/api/test/fixtures/groups.yml
+++ b/services/api/test/fixtures/groups.yml
@@ -152,6 +152,14 @@ group_for_sharing_tests:
description: Users who can share objects with each other
group_class: role
+project_owned_by_foo:
+ uuid: zzzzz-j7d0g-lsjm0ibr0ydwpzx
+ owner_uuid: zzzzz-tpzed-81hsbo6mk8nl05c
+ created_at: 2014-02-03T17:22:54Z
+ modified_at: 2014-02-03T17:22:54Z
+ name: project_owned_by_foo
+ group_class: project
+
empty_project:
uuid: zzzzz-j7d0g-9otoxmrksam74q6
owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
diff --git a/services/api/test/functional/arvados/v1/groups_controller_test.rb b/services/api/test/functional/arvados/v1/groups_controller_test.rb
index 885fc6637..526970190 100644
--- a/services/api/test/functional/arvados/v1/groups_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/groups_controller_test.rb
@@ -717,13 +717,13 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
head_uuid: groups(:project_owned_by_foo).uuid)
end
- get :shared, {filters: [["group_class", "=", "project"]]}
+ get :shared, {:filters => [["group_class", "=", "project"]], :include => "owner_uuid"}
assert_equal 1, json_response['items'].length
assert_equal json_response['items'][0]["uuid"], groups(:project_owned_by_foo).uuid
- assert_equal 1, json_response['include'].length
- assert_equal json_response['include'][0]["uuid"], users(:user_foo_in_sharing_group).uuid
+ assert_equal 1, json_response['included'].length
+ assert_equal json_response['included'][0]["uuid"], users(:user_foo_in_sharing_group).uuid
end
test 'get shared, owned by unreadable project' do
@@ -738,12 +738,12 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
head_uuid: groups(:project_owned_by_foo).uuid)
end
- get :shared, {filters: [["group_class", "=", "project"]]}
+ get :shared, {:filters => [["group_class", "=", "project"]], :include => "owner_uuid"}
assert_equal 1, json_response['items'].length
assert_equal json_response['items'][0]["uuid"], groups(:project_owned_by_foo).uuid
- assert_equal 0, json_response['include'].length
+ assert_equal 0, json_response['included'].length
end
test 'get shared, owned by non-project' do
@@ -753,13 +753,13 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
Group.find_by_uuid(groups(:project_owned_by_foo).uuid).update!(owner_uuid: groups(:group_for_sharing_tests).uuid)
end
- get :shared, {filters: [["group_class", "=", "project"]]}
+ get :shared, {:filters => [["group_class", "=", "project"]], :include => "owner_uuid"}
assert_equal 1, json_response['items'].length
assert_equal json_response['items'][0]["uuid"], groups(:project_owned_by_foo).uuid
- assert_equal 1, json_response['include'].length
- assert_equal json_response['include'][0]["uuid"], groups(:group_for_sharing_tests).uuid
+ assert_equal 1, json_response['included'].length
+ assert_equal json_response['included'][0]["uuid"], groups(:group_for_sharing_tests).uuid
end
end
diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py
index 90e709172..2d58012fa 100644
--- a/services/fuse/arvados_fuse/fusedir.py
+++ b/services/fuse/arvados_fuse/fusedir.py
@@ -1059,16 +1059,17 @@ class SharedDirectory(Directory):
page = []
while True:
resp = self.api.groups().shared(filters=[['group_class', '=', 'project']]+page,
- order="uuid",
- limit=10000,
- count="none").execute()
+ order="uuid",
+ limit=10000,
+ count="none",
+ include="owner_uuid").execute()
if not resp["items"]:
break
page = [["uuid", ">", resp["items"][len(resp["items"])-1]["uuid"]]]
for r in resp["items"]:
objects[r["uuid"]] = r
roots.append(r["uuid"])
- for r in resp["include"]:
+ for r in resp["included"]:
objects[r["uuid"]] = r
root_owners.add(r["uuid"])
else:
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list