[ARVADOS] updated: 11e1ee67236b1dda5dac5e871ecfedd7de8faccf

git at public.curoverse.com git at public.curoverse.com
Mon Feb 16 03:28:34 EST 2015


Summary of changes:
 sdk/python/arvados/commands/put.py                     | 18 +++++++++++-------
 .../20150206230342_rename_replication_attributes.rb    |  2 +-
 services/api/test/unit/arvados_model_test.rb           |  2 +-
 services/api/test/unit/collection_test.rb              |  4 +++-
 4 files changed, 16 insertions(+), 10 deletions(-)

       via  11e1ee67236b1dda5dac5e871ecfedd7de8faccf (commit)
       via  1e423bd9887adad61999503771b0794fc62efc28 (commit)
       via  938338a385a96066552aea6230d773a17cbf3c3e (commit)
      from  1f7a6b50cabab4c8645dd6db92e456c080f2a81c (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 11e1ee67236b1dda5dac5e871ecfedd7de8faccf
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Feb 16 03:12:43 2015 -0500

    3410: Update comments.

diff --git a/sdk/python/arvados/commands/put.py b/sdk/python/arvados/commands/put.py
index 4e7acca..f556e7e 100644
--- a/sdk/python/arvados/commands/put.py
+++ b/sdk/python/arvados/commands/put.py
@@ -408,12 +408,16 @@ def main(arguments=None, stdout=sys.stdout, stderr=sys.stderr):
         print >>stderr, error
         sys.exit(1)
 
-    # write_copies is how many copies of each data block we write to
-    # Keep. args.replication is how many copies we instruct Arvados to
-    # maintain (by passing it in collections().create() after all data
-    # is written).  If args.replication is given as None, it should
-    # stay None, but we still need to write a suitable number of
-    # copies to Keep.
+    # write_copies diverges from args.replication here.
+    # args.replication is how many copies we will instruct Arvados to
+    # maintain (by passing it in collections().create()) after all
+    # data is written -- and if None was given, we'll use None there.
+    # Meanwhile, write_copies is how many copies of each data block we
+    # write to Keep, which has to be a number.
+    #
+    # If we simply changed args.replication from None to a default
+    # here, we'd end up erroneously passing the default replication
+    # level (instead of None) to collections().create().
     write_copies = (args.replication or
                     api_client._rootDesc.get('defaultCollectionReplication', 2))
 
@@ -485,7 +489,7 @@ def main(arguments=None, stdout=sys.stdout, stderr=sys.stderr):
                 manifest_text = CollectionReader(manifest_text).manifest_text(normalize=True)
             replication_attr = 'replication_desired'
             if api_client._schema.schemas['Collection']['properties'].get(replication_attr, None) is None:
-                # API calls it 'redundancy' until #3410.
+                # API called it 'redundancy' before #3410.
                 replication_attr = 'redundancy'
             # Register the resulting collection in Arvados.
             collection = api_client.collections().create(
diff --git a/services/api/test/unit/collection_test.rb b/services/api/test/unit/collection_test.rb
index f158cfe..10ef2b4 100644
--- a/services/api/test/unit/collection_test.rb
+++ b/services/api/test/unit/collection_test.rb
@@ -214,7 +214,9 @@ class CollectionTest < ActiveSupport::TestCase
       new_manifest = c.signed_manifest_text
       new_manifest.sub!(/ \S+:bar/, '')
       new_manifest.sub!(/ acbd\S+/, '')
-      # We really deleted a block there, right?
+
+      # Confirm that we did just remove a block from the manifest (if
+      # not, this test would pass without testing the relevant case):
       assert_operator new_manifest.length+40, :<, c.signed_manifest_text.length
 
       assert c.update_attributes(manifest_text: new_manifest)

commit 1e423bd9887adad61999503771b0794fc62efc28
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Feb 16 03:12:32 2015 -0500

    3410: Fix search index so [old versions of] tests pass after down-migration.

diff --git a/services/api/db/migrate/20150206230342_rename_replication_attributes.rb b/services/api/db/migrate/20150206230342_rename_replication_attributes.rb
index 23f0ffc..58572d7 100644
--- a/services/api/db/migrate/20150206230342_rename_replication_attributes.rb
+++ b/services/api/db/migrate/20150206230342_rename_replication_attributes.rb
@@ -25,6 +25,6 @@ class RenameReplicationAttributes < ActiveRecord::Migration
     Collection.reset_column_information
 
     execute "CREATE INDEX collections_full_text_search_idx ON collections USING gin(#{Collection.full_text_tsvector});"
-    add_index :collections, ["owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "portable_data_hash", "redundancy_confirmed_by_client_uuid", "uuid", "name", "file_names"], name: 'collections_search_index'
+    add_index :collections, ["owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "portable_data_hash", "uuid", "name", "file_names", "redundancy_confirmed_by_client_uuid"], name: 'collections_search_index'
   end
 end

commit 938338a385a96066552aea6230d773a17cbf3c3e
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Feb 16 03:11:23 2015 -0500

    3410: Fix overly sensitive test.

diff --git a/services/api/test/unit/arvados_model_test.rb b/services/api/test/unit/arvados_model_test.rb
index 750b933..09dece2 100644
--- a/services/api/test/unit/arvados_model_test.rb
+++ b/services/api/test/unit/arvados_model_test.rb
@@ -136,7 +136,7 @@ class ArvadosModelTest < ActiveSupport::TestCase
 
         indexes = ActiveRecord::Base.connection.indexes(table)
         search_index_by_columns = indexes.select do |index|
-          index.columns == search_index_columns
+          index.columns.sort == search_index_columns.sort
         end
         search_index_by_name = indexes.select do |index|
           index.name == "#{table}_search_index"

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list