[ARVADOS] updated: 0b5d04beb288175a285c36a38f255399dfe7d0d7
Git user
git at public.curoverse.com
Sat Nov 12 18:56:46 EST 2016
Summary of changes:
.../arvados/v1/collections_controller.rb | 2 +-
.../arvados/v1/collections_controller_test.rb | 43 ++++++++++++++++++++++
2 files changed, 44 insertions(+), 1 deletion(-)
via 0b5d04beb288175a285c36a38f255399dfe7d0d7 (commit)
via b86543493dffefb1ec245f48550cfa9e0119f4d1 (commit)
via 8c7a6b5bb3cf27dff61a3b2d83fd4374c7262206 (commit)
from 9640930c3934344ab64c92a5c86c1f7488a4de42 (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 0b5d04beb288175a285c36a38f255399dfe7d0d7
Merge: 9640930 b865434
Author: Tom Clegg <tom at curoverse.com>
Date: Sat Nov 12 18:55:59 2016 -0500
Merge branch '10517-consistent-select' closes #10517
commit b86543493dffefb1ec245f48550cfa9e0119f4d1
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date: Sat Nov 12 03:57:50 2016 +0000
Fixes API server to return default columns for collections
Prior to this fix, if a request has a query param `select=`
(as opposed to just omitting `select` entirely), the API
server would return a full set of columns rather than
enforcing its own defaults.
Fixes #10517, assuming this was a bug and not a feature.
diff --git a/services/api/app/controllers/arvados/v1/collections_controller.rb b/services/api/app/controllers/arvados/v1/collections_controller.rb
index 44733cd..922cf7d 100644
--- a/services/api/app/controllers/arvados/v1/collections_controller.rb
+++ b/services/api/app/controllers/arvados/v1/collections_controller.rb
@@ -182,10 +182,10 @@ class Arvados::V1::CollectionsController < ApplicationController
protected
def load_limit_offset_order_params *args
+ super
if action_name == 'index'
# Omit manifest_text from index results unless expressly selected.
@select ||= model_class.selectable_attributes - ["manifest_text"]
end
- super
end
end
commit 8c7a6b5bb3cf27dff61a3b2d83fd4374c7262206
Author: Tom Clegg <tom at curoverse.com>
Date: Sat Nov 12 17:42:50 2016 -0500
10517: Test edge cases in "deselect manifest_text by default" feature.
diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb
index a8583be..c85cc19 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -46,6 +46,49 @@ class Arvados::V1::CollectionsControllerTest < ActionController::TestCase
end
end
+ test 'index without select returns everything except manifest' do
+ authorize_with :active
+ get :index
+ assert_response :success
+ assert json_response['items'].any?
+ json_response['items'].each do |coll|
+ assert_includes(coll.keys, 'uuid')
+ assert_includes(coll.keys, 'name')
+ assert_includes(coll.keys, 'created_at')
+ refute_includes(coll.keys, 'manifest_text')
+ end
+ end
+
+ ['', nil, false, 'null'].each do |select|
+ test "index with select=#{select.inspect} returns everything except manifest" do
+ authorize_with :active
+ get :index, select: select
+ assert_response :success
+ assert json_response['items'].any?
+ json_response['items'].each do |coll|
+ assert_includes(coll.keys, 'uuid')
+ assert_includes(coll.keys, 'name')
+ assert_includes(coll.keys, 'created_at')
+ refute_includes(coll.keys, 'manifest_text')
+ end
+ end
+ end
+
+ [["uuid"],
+ ["uuid", "manifest_text"],
+ '["uuid"]',
+ '["uuid", "manifest_text"]'].each do |select|
+ test "index with select=#{select.inspect} returns no name" do
+ authorize_with :active
+ get :index, select: select
+ assert_response :success
+ assert json_response['items'].any?
+ json_response['items'].each do |coll|
+ refute_includes(coll.keys, 'name')
+ end
+ end
+ end
+
[0,1,2].each do |limit|
test "get index with limit=#{limit}" do
authorize_with :active
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list