[ARVADOS] created: 2.1.0-1221-g902f8cd25

Git user git at public.arvados.org
Mon Aug 23 18:25:04 UTC 2021


        at  902f8cd258a8dfec749a7f94d478a4027e319750 (commit)


commit 902f8cd258a8dfec749a7f94d478a4027e319750
Author: Tom Clegg <tom at curii.com>
Date:   Mon Aug 23 14:21:36 2021 -0400

    17994: Allow filtering on storage_classes_desired/confirmed fields.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 1bbe8cc66..f4c717999 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -613,7 +613,7 @@ class Collection < ArvadosModel
   end
 
   def self.searchable_columns operator
-    super - ["manifest_text"]
+    super - ["manifest_text"] + ["storage_classes_desired", "storage_classes_confirmed"]
   end
 
   def self.full_text_searchable_columns
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 1ca2dd1dc..5b77a544e 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -1455,4 +1455,18 @@ EOS
     assert_response :success
     assert_equal col.version, json_response['version'], 'Trashing a collection should not create a new version'
   end
+
+  ["storage_classes_desired", "storage_classes_confirmed"].each do |attr|
+    test "filter collections by #{attr}" do
+      authorize_with(:active)
+      get :index, params: {
+            filters: [[attr, "=", '["default"]']]
+          }
+      assert_response :success
+      assert_not_equal 0, json_response["items"].length
+      json_response["items"].each do |c|
+        assert_equal ["default"], c[attr]
+      end
+    end
+  end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list