[ARVADOS] updated: c182087b563ddbb40fde2b1d0c185af481df3bc2

Git user git at public.curoverse.com
Thu May 18 15:46:51 EDT 2017


Summary of changes:
 .../api/app/controllers/arvados/v1/groups_controller.rb     |  9 +++++++--
 services/api/test/integration/groups_test.rb                | 13 +++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

       via  c182087b563ddbb40fde2b1d0c185af481df3bc2 (commit)
       via  8ac1775086e88da003b530210be1acb4c0f2c648 (commit)
      from  d121e087ad1b4e91f869dbd57534c6d6ce51d19d (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 c182087b563ddbb40fde2b1d0c185af481df3bc2
Merge: d121e08 8ac1775
Author: radhika <radhika at curoverse.com>
Date:   Thu May 18 15:46:15 2017 -0400

    refs #9587
    Merge branch '9587-include-trash-in-group-contents'


commit 8ac1775086e88da003b530210be1acb4c0f2c648
Author: radhika <radhika at curoverse.com>
Date:   Wed May 17 21:47:52 2017 -0400

    9587: add support for include_trash in groups_controller -> contents method

diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb
index 3bf91c3..fc64899 100644
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@ -136,8 +136,13 @@ class Arvados::V1::GroupsController < ApplicationController
         end
       end.compact
 
-      @objects = klass.readable_by(*@read_users).
-        order(request_order).where(where_conds)
+      if klass == Collection and params[:include_trash]
+        @objects = klass.unscoped.readable_by(*@read_users).
+          order(request_order).where(where_conds)
+      else
+        @objects = klass.readable_by(*@read_users).
+          order(request_order).where(where_conds)
+      end
       klass_limit = limit_all - all_objects.count
       @limit = klass_limit
       apply_where_limit_order_params klass
diff --git a/services/api/test/integration/groups_test.rb b/services/api/test/integration/groups_test.rb
index 2afece9..c26f6be 100644
--- a/services/api/test/integration/groups_test.rb
+++ b/services/api/test/integration/groups_test.rb
@@ -91,4 +91,17 @@ class GroupsTest < ActionDispatch::IntegrationTest
     }, auth(:active)
     assert_response 422
   end
+
+  test "group contents with include trash collections" do
+    get "/arvados/v1/groups/contents", {
+      include_trash: "true",
+      filters: [["uuid", "is_a", "arvados#collection"]].to_json
+    }, auth(:active)
+    assert_response 200
+
+    coll_uuids = []
+    json_response['items'].each { |c| coll_uuids << c['uuid'] }
+    assert_includes coll_uuids, collections(:foo_collection_in_aproject).uuid
+    assert_includes coll_uuids, collections(:expired_collection).uuid
+  end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list