[ARVADOS] updated: 1.2.0-119-gced2d4772

Git user git at public.curoverse.com
Fri Sep 28 16:23:19 EDT 2018


Summary of changes:
 services/api/app/models/container.rb     | 2 +-
 services/api/test/unit/container_test.rb | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

       via  ced2d4772ac338f8f62e83dad1423194f2018c9b (commit)
      from  5e41146b32e4afd9de4eefc22b3c9fef05c471dc (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 ced2d4772ac338f8f62e83dad1423194f2018c9b
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Fri Sep 28 16:21:42 2018 -0400

    10181: Restore container's ability to update its own runtime_status.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index 3bb9cbf8e..079ac4c29 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -452,7 +452,7 @@ class Container < ArvadosModel
     if current_api_client_authorization.andand.uuid.andand == self.auth_uuid
       # The contained process itself can update progress indicators,
       # but can't change priority etc.
-      permitted = permitted & [:state, :progress, :output]
+      permitted = permitted & (progress_attrs + final_attrs + [:state] - [:log])
     elsif self.locked_by_uuid && self.locked_by_uuid != current_api_client_authorization.andand.uuid
       # When locked, progress fields cannot be updated by the wrong
       # dispatcher, even though it has admin privileges.
diff --git a/services/api/test/unit/container_test.rb b/services/api/test/unit/container_test.rb
index 03e7850a5..11ae0bfe3 100644
--- a/services/api/test/unit/container_test.rb
+++ b/services/api/test/unit/container_test.rb
@@ -697,7 +697,7 @@ class ContainerTest < ActiveSupport::TestCase
     assert_equal [logpdh_time2], Collection.where(uuid: [cr1log_uuid, cr2log_uuid]).to_a.collect(&:portable_data_hash).uniq
   end
 
-  test "auth_uuid can set output, progress on running container -- but not state, log" do
+  test "auth_uuid can set output, progress, runtime_status, state on running container -- but not log" do
     c, _ = minimal_new
     set_user_from_auth :dispatch1
     c.lock
@@ -710,9 +710,11 @@ class ContainerTest < ActiveSupport::TestCase
     Thread.current[:user] = auth.user
 
     assert c.update_attributes(output: collections(:collection_owned_by_active).portable_data_hash)
+    assert c.update_attributes(runtime_status: {'warning' => 'something happened'})
     assert c.update_attributes(progress: 0.5)
     refute c.update_attributes(log: collections(:real_log_collection).portable_data_hash)
-    refute c.update_attributes(state: Container::Complete)
+    c.reload
+    assert c.update_attributes(state: Container::Complete, exit_code: 0)
   end
 
   test "not allowed to set output that is not readable by current user" do

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list