[ARVADOS] updated: 1.3.1-5-g7533ce8c1

Git user git at public.curoverse.com
Mon Apr 22 15:06:04 UTC 2019


Summary of changes:
 services/api/app/models/arvados_model.rb  |  2 ++
 services/api/app/models/collection.rb     |  4 +++-
 services/api/lib/arvados_model_updates.rb | 17 +++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

       via  7533ce8c161f3f02ae356b524b332b6740967e89 (commit)
       via  232b4e63bbfa5b398a35a2e952968d643605272f (commit)
      from  1514cff070fbd6479dc17d1108acdbaaa8203b82 (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 7533ce8c161f3f02ae356b524b332b6740967e89
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Thu Dec 13 15:08:53 2018 -0500

    14595: Fix comment.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/api/lib/arvados_model_updates.rb b/services/api/lib/arvados_model_updates.rb
index 0a07574a5..7f0d7c290 100644
--- a/services/api/lib/arvados_model_updates.rb
+++ b/services/api/lib/arvados_model_updates.rb
@@ -20,7 +20,7 @@ module ArvadosModelUpdates
   end
 
   # ArvadosModel checks this to decide whether it should update the
-  # 'modified_at_uuid' field.
+  # 'modified_at' field.
   def timeless_updater
     Thread.current[:timeless_updater] || false
   end

commit 232b4e63bbfa5b398a35a2e952968d643605272f
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Thu Dec 13 14:37:29 2018 -0500

    14595: Add leave_modified_at_alone
    
    leave_modified_by_user_alone does not affect modified_at
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index 93d5b9a02..eea95e2be 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -557,6 +557,8 @@ class ArvadosModel < ActiveRecord::Base
     self.owner_uuid ||= current_default_owner if self.respond_to? :owner_uuid=
     if !anonymous_updater
       self.modified_by_user_uuid = current_user ? current_user.uuid : nil
+    end
+    if !timeless_updater
       self.modified_at = current_time
     end
     self.modified_by_client_uuid = current_api_client ? current_api_client.uuid : nil
diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 33c811319..6147b79f9 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -288,7 +288,9 @@ class Collection < ArvadosModel
       # Use a different validation context to skip the 'old_versions_cannot_be_updated'
       # validator, as on this case it is legal to update some fields.
       leave_modified_by_user_alone do
-        c.save(context: :update_old_versions)
+        leave_modified_at_alone do
+          c.save(context: :update_old_versions)
+        end
       end
     end
   end
diff --git a/services/api/lib/arvados_model_updates.rb b/services/api/lib/arvados_model_updates.rb
index b456bd395..0a07574a5 100644
--- a/services/api/lib/arvados_model_updates.rb
+++ b/services/api/lib/arvados_model_updates.rb
@@ -18,4 +18,21 @@ module ArvadosModelUpdates
       Thread.current[:anonymous_updater] = anonymous_updater_was
     end
   end
+
+  # ArvadosModel checks this to decide whether it should update the
+  # 'modified_at_uuid' field.
+  def timeless_updater
+    Thread.current[:timeless_updater] || false
+  end
+
+  def leave_modified_at_alone
+    timeless_updater_was = timeless_updater
+    begin
+      Thread.current[:timeless_updater] = true
+      yield
+    ensure
+      Thread.current[:timeless_updater] = timeless_updater_was
+    end
+  end
+
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list