[ARVADOS] updated: 1.3.0-549-gcecb9918b

Git user git at public.curoverse.com
Fri Mar 22 13:21:40 UTC 2019


Summary of changes:
 .../api/app/controllers/application_controller.rb  | 38 +++++++++++-----------
 .../v1/api_client_authorizations_controller.rb     |  8 ++---
 .../arvados/v1/api_clients_controller.rb           |  2 +-
 .../arvados/v1/containers_controller.rb            |  4 +--
 .../controllers/arvados/v1/groups_controller.rb    |  4 +--
 .../arvados/v1/healthcheck_controller.rb           | 20 ++++++------
 .../app/controllers/arvados/v1/jobs_controller.rb  |  4 +--
 .../arvados/v1/keep_disks_controller.rb            |  4 +--
 .../arvados/v1/keep_services_controller.rb         |  6 ++--
 .../app/controllers/arvados/v1/nodes_controller.rb |  6 ++--
 .../arvados/v1/repositories_controller.rb          |  6 ++--
 .../controllers/arvados/v1/schema_controller.rb    | 18 +++++-----
 .../arvados/v1/user_agreements_controller.rb       |  6 ++--
 .../app/controllers/arvados/v1/users_controller.rb |  6 ++--
 .../arvados/v1/virtual_machines_controller.rb      |  6 ++--
 .../api/app/controllers/database_controller.rb     |  6 ++--
 services/api/app/controllers/static_controller.rb  |  6 ++--
 .../app/controllers/user_sessions_controller.rb    |  8 ++---
 services/api/config/application.rb                 |  2 --
 19 files changed, 79 insertions(+), 81 deletions(-)

       via  cecb9918b556f52218f9ff31e73cb78b0f48eaa4 (commit)
      from  3cc37a0ba2c572731ef998a7f5724294c9415fdb (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 cecb9918b556f52218f9ff31e73cb78b0f48eaa4
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Fri Mar 22 10:20:54 2019 -0300

    14873: Replaces *_filter with *_action
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 7a9b7a67e..814b4cd8f 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -33,24 +33,24 @@ class ApplicationController < ActionController::Base
 
   ERROR_ACTIONS = [:render_error, :render_not_found]
 
-  around_filter :set_current_request_id
-  before_filter :disable_api_methods
-  before_filter :set_cors_headers
-  before_filter :respond_with_json_by_default
-  before_filter :remote_ip
-  before_filter :load_read_auths
-  before_filter :require_auth_scope, except: ERROR_ACTIONS
-
-  before_filter :catch_redirect_hint
-  before_filter(:find_object_by_uuid,
+  around_action :set_current_request_id
+  before_action :disable_api_methods
+  before_action :set_cors_headers
+  before_action :respond_with_json_by_default
+  before_action :remote_ip
+  before_action :load_read_auths
+  before_action :require_auth_scope, except: ERROR_ACTIONS
+
+  before_action :catch_redirect_hint
+  before_action(:find_object_by_uuid,
                 except: [:index, :create] + ERROR_ACTIONS)
-  before_filter :load_required_parameters
-  before_filter :load_limit_offset_order_params, only: [:index, :contents]
-  before_filter :load_where_param, only: [:index, :contents]
-  before_filter :load_filters_param, only: [:index, :contents]
-  before_filter :find_objects_for_index, :only => :index
-  before_filter :reload_object_before_update, :only => :update
-  before_filter(:render_404_if_no_object,
+  before_action :load_required_parameters
+  before_action :load_limit_offset_order_params, only: [:index, :contents]
+  before_action :load_where_param, only: [:index, :contents]
+  before_action :load_filters_param, only: [:index, :contents]
+  before_action :find_objects_for_index, :only => :index
+  before_action :reload_object_before_update, :only => :update
+  before_action(:render_404_if_no_object,
                 except: [:index, :create] + ERROR_ACTIONS)
 
   theme Rails.configuration.arvados_theme
@@ -481,7 +481,7 @@ class ApplicationController < ActionController::Base
   end
 
   def self.accept_attribute_as_json(attr, must_be_class=nil)
-    before_filter lambda { accept_attribute_as_json attr, must_be_class }
+    before_action lambda { accept_attribute_as_json attr, must_be_class }
   end
   accept_attribute_as_json :properties, Hash
   accept_attribute_as_json :info, Hash
@@ -499,7 +499,7 @@ class ApplicationController < ActionController::Base
   end
 
   def self.accept_param_as_json(key, must_be_class=nil)
-    prepend_before_filter lambda { load_json_value(params, key, must_be_class) }
+    prepend_before_action lambda { load_json_value(params, key, must_be_class) }
   end
   accept_param_as_json :reader_tokens, Array
 
diff --git a/services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb b/services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb
index 826ced1cf..cd466cf1f 100644
--- a/services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb
+++ b/services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb
@@ -6,10 +6,10 @@ require 'safe_json'
 
 class Arvados::V1::ApiClientAuthorizationsController < ApplicationController
   accept_attribute_as_json :scopes, Array
-  before_filter :current_api_client_is_trusted, :except => [:current]
-  before_filter :admin_required, :only => :create_system_auth
-  skip_before_filter :render_404_if_no_object, :only => [:create_system_auth, :current]
-  skip_before_filter :find_object_by_uuid, :only => [:create_system_auth, :current]
+  before_action :current_api_client_is_trusted, :except => [:current]
+  before_action :admin_required, :only => :create_system_auth
+  skip_before_action :render_404_if_no_object, :only => [:create_system_auth, :current]
+  skip_before_action :find_object_by_uuid, :only => [:create_system_auth, :current]
 
   def self._create_system_auth_requires_parameters
     {
diff --git a/services/api/app/controllers/arvados/v1/api_clients_controller.rb b/services/api/app/controllers/arvados/v1/api_clients_controller.rb
index 5a67632fc..b459c5191 100644
--- a/services/api/app/controllers/arvados/v1/api_clients_controller.rb
+++ b/services/api/app/controllers/arvados/v1/api_clients_controller.rb
@@ -3,5 +3,5 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class Arvados::V1::ApiClientsController < ApplicationController
-  before_filter :admin_required
+  before_action :admin_required
 end
diff --git a/services/api/app/controllers/arvados/v1/containers_controller.rb b/services/api/app/controllers/arvados/v1/containers_controller.rb
index 8542096ce..fc5614d94 100644
--- a/services/api/app/controllers/arvados/v1/containers_controller.rb
+++ b/services/api/app/controllers/arvados/v1/containers_controller.rb
@@ -10,8 +10,8 @@ class Arvados::V1::ContainersController < ApplicationController
   accept_attribute_as_json :command, Array
   accept_attribute_as_json :scheduling_parameters, Hash
 
-  skip_before_filter :find_object_by_uuid, only: [:current]
-  skip_before_filter :render_404_if_no_object, only: [:current]
+  skip_before_action :find_object_by_uuid, only: [:current]
+  skip_before_action :render_404_if_no_object, only: [:current]
 
   def auth
     if @object.locked_by_uuid != Thread.current[:api_client_authorization].uuid
diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb
index 6163f893c..f7db1ef12 100644
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@ -7,8 +7,8 @@ require "trashable"
 class Arvados::V1::GroupsController < ApplicationController
   include TrashableController
 
-  skip_before_filter :find_object_by_uuid, only: :shared
-  skip_before_filter :render_404_if_no_object, only: :shared
+  skip_before_action :find_object_by_uuid, only: :shared
+  skip_before_action :render_404_if_no_object, only: :shared
 
   def self._index_requires_parameters
     (super rescue {}).
diff --git a/services/api/app/controllers/arvados/v1/healthcheck_controller.rb b/services/api/app/controllers/arvados/v1/healthcheck_controller.rb
index 6d55506bb..c12bc6e90 100644
--- a/services/api/app/controllers/arvados/v1/healthcheck_controller.rb
+++ b/services/api/app/controllers/arvados/v1/healthcheck_controller.rb
@@ -3,17 +3,17 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class Arvados::V1::HealthcheckController < ApplicationController
-  skip_before_filter :catch_redirect_hint
-  skip_before_filter :find_objects_for_index
-  skip_before_filter :find_object_by_uuid
-  skip_before_filter :load_filters_param
-  skip_before_filter :load_limit_offset_order_params
-  skip_before_filter :load_read_auths
-  skip_before_filter :load_where_param
-  skip_before_filter :render_404_if_no_object
-  skip_before_filter :require_auth_scope
+  skip_before_action :catch_redirect_hint
+  skip_before_action :find_objects_for_index
+  skip_before_action :find_object_by_uuid
+  skip_before_action :load_filters_param
+  skip_before_action :load_limit_offset_order_params
+  skip_before_action :load_read_auths
+  skip_before_action :load_where_param
+  skip_before_action :render_404_if_no_object
+  skip_before_action :require_auth_scope
 
-  before_filter :check_auth_header
+  before_action :check_auth_header
 
   def check_auth_header
     mgmt_token = Rails.configuration.ManagementToken
diff --git a/services/api/app/controllers/arvados/v1/jobs_controller.rb b/services/api/app/controllers/arvados/v1/jobs_controller.rb
index 23c059cfb..c3655272d 100644
--- a/services/api/app/controllers/arvados/v1/jobs_controller.rb
+++ b/services/api/app/controllers/arvados/v1/jobs_controller.rb
@@ -7,8 +7,8 @@ class Arvados::V1::JobsController < ApplicationController
   accept_attribute_as_json :script_parameters, Hash
   accept_attribute_as_json :runtime_constraints, Hash
   accept_attribute_as_json :tasks_summary, Hash
-  skip_before_filter :find_object_by_uuid, :only => [:queue, :queue_size]
-  skip_before_filter :render_404_if_no_object, :only => [:queue, :queue_size]
+  skip_before_action :find_object_by_uuid, :only => [:queue, :queue_size]
+  skip_before_action :render_404_if_no_object, :only => [:queue, :queue_size]
 
   include DbCurrentTime
 
diff --git a/services/api/app/controllers/arvados/v1/keep_disks_controller.rb b/services/api/app/controllers/arvados/v1/keep_disks_controller.rb
index 9b4c342a7..b8aa09650 100644
--- a/services/api/app/controllers/arvados/v1/keep_disks_controller.rb
+++ b/services/api/app/controllers/arvados/v1/keep_disks_controller.rb
@@ -3,8 +3,8 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class Arvados::V1::KeepDisksController < ApplicationController
-  skip_before_filter :require_auth_scope, only: :ping
-  skip_before_filter :render_404_if_no_object, only: :ping
+  skip_before_action :require_auth_scope, only: :ping
+  skip_before_action :render_404_if_no_object, only: :ping
 
   def self._ping_requires_parameters
     {
diff --git a/services/api/app/controllers/arvados/v1/keep_services_controller.rb b/services/api/app/controllers/arvados/v1/keep_services_controller.rb
index c7c911929..90b0a9228 100644
--- a/services/api/app/controllers/arvados/v1/keep_services_controller.rb
+++ b/services/api/app/controllers/arvados/v1/keep_services_controller.rb
@@ -4,9 +4,9 @@
 
 class Arvados::V1::KeepServicesController < ApplicationController
 
-  skip_before_filter :find_object_by_uuid, only: :accessible
-  skip_before_filter :render_404_if_no_object, only: :accessible
-  skip_before_filter :require_auth_scope, only: :accessible
+  skip_before_action :find_object_by_uuid, only: :accessible
+  skip_before_action :render_404_if_no_object, only: :accessible
+  skip_before_action :require_auth_scope, only: :accessible
 
   def find_objects_for_index
     # all users can list all keep services
diff --git a/services/api/app/controllers/arvados/v1/nodes_controller.rb b/services/api/app/controllers/arvados/v1/nodes_controller.rb
index a2b22ea7f..eb72b7096 100644
--- a/services/api/app/controllers/arvados/v1/nodes_controller.rb
+++ b/services/api/app/controllers/arvados/v1/nodes_controller.rb
@@ -3,9 +3,9 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class Arvados::V1::NodesController < ApplicationController
-  skip_before_filter :require_auth_scope, :only => :ping
-  skip_before_filter :find_object_by_uuid, :only => :ping
-  skip_before_filter :render_404_if_no_object, :only => :ping
+  skip_before_action :require_auth_scope, :only => :ping
+  skip_before_action :find_object_by_uuid, :only => :ping
+  skip_before_action :render_404_if_no_object, :only => :ping
 
   include DbCurrentTime
 
diff --git a/services/api/app/controllers/arvados/v1/repositories_controller.rb b/services/api/app/controllers/arvados/v1/repositories_controller.rb
index b88e10c08..9dff6227b 100644
--- a/services/api/app/controllers/arvados/v1/repositories_controller.rb
+++ b/services/api/app/controllers/arvados/v1/repositories_controller.rb
@@ -3,9 +3,9 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class Arvados::V1::RepositoriesController < ApplicationController
-  skip_before_filter :find_object_by_uuid, :only => :get_all_permissions
-  skip_before_filter :render_404_if_no_object, :only => :get_all_permissions
-  before_filter :admin_required, :only => :get_all_permissions
+  skip_before_action :find_object_by_uuid, :only => :get_all_permissions
+  skip_before_action :render_404_if_no_object, :only => :get_all_permissions
+  before_action :admin_required, :only => :get_all_permissions
 
   def get_all_permissions
     # user_aks is a map of {user_uuid => array of public keys}
diff --git a/services/api/app/controllers/arvados/v1/schema_controller.rb b/services/api/app/controllers/arvados/v1/schema_controller.rb
index 771ef2b1f..fc13f893b 100644
--- a/services/api/app/controllers/arvados/v1/schema_controller.rb
+++ b/services/api/app/controllers/arvados/v1/schema_controller.rb
@@ -3,15 +3,15 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class Arvados::V1::SchemaController < ApplicationController
-  skip_before_filter :catch_redirect_hint
-  skip_before_filter :find_objects_for_index
-  skip_before_filter :find_object_by_uuid
-  skip_before_filter :load_filters_param
-  skip_before_filter :load_limit_offset_order_params
-  skip_before_filter :load_read_auths
-  skip_before_filter :load_where_param
-  skip_before_filter :render_404_if_no_object
-  skip_before_filter :require_auth_scope
+  skip_before_action :catch_redirect_hint
+  skip_before_action :find_objects_for_index
+  skip_before_action :find_object_by_uuid
+  skip_before_action :load_filters_param
+  skip_before_action :load_limit_offset_order_params
+  skip_before_action :load_read_auths
+  skip_before_action :load_where_param
+  skip_before_action :render_404_if_no_object
+  skip_before_action :require_auth_scope
 
   include DbCurrentTime
 
diff --git a/services/api/app/controllers/arvados/v1/user_agreements_controller.rb b/services/api/app/controllers/arvados/v1/user_agreements_controller.rb
index dc08c6a03..748eb06f0 100644
--- a/services/api/app/controllers/arvados/v1/user_agreements_controller.rb
+++ b/services/api/app/controllers/arvados/v1/user_agreements_controller.rb
@@ -3,9 +3,9 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class Arvados::V1::UserAgreementsController < ApplicationController
-  before_filter :admin_required, except: [:index, :sign, :signatures]
-  skip_before_filter :find_object_by_uuid, only: [:sign, :signatures]
-  skip_before_filter :render_404_if_no_object, only: [:sign, :signatures]
+  before_action :admin_required, except: [:index, :sign, :signatures]
+  skip_before_action :find_object_by_uuid, only: [:sign, :signatures]
+  skip_before_action :render_404_if_no_object, only: [:sign, :signatures]
 
   def model_class
     Link
diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb
index d2126ec5f..f7590b464 100644
--- a/services/api/app/controllers/arvados/v1/users_controller.rb
+++ b/services/api/app/controllers/arvados/v1/users_controller.rb
@@ -5,11 +5,11 @@
 class Arvados::V1::UsersController < ApplicationController
   accept_attribute_as_json :prefs, Hash
 
-  skip_before_filter :find_object_by_uuid, only:
+  skip_before_action :find_object_by_uuid, only:
     [:activate, :current, :system, :setup, :merge]
-  skip_before_filter :render_404_if_no_object, only:
+  skip_before_action :render_404_if_no_object, only:
     [:activate, :current, :system, :setup, :merge]
-  before_filter :admin_required, only: [:setup, :unsetup, :update_uuid]
+  before_action :admin_required, only: [:setup, :unsetup, :update_uuid]
 
   def current
     if current_user
diff --git a/services/api/app/controllers/arvados/v1/virtual_machines_controller.rb b/services/api/app/controllers/arvados/v1/virtual_machines_controller.rb
index 7a1c68071..cb637c2fd 100644
--- a/services/api/app/controllers/arvados/v1/virtual_machines_controller.rb
+++ b/services/api/app/controllers/arvados/v1/virtual_machines_controller.rb
@@ -3,9 +3,9 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class Arvados::V1::VirtualMachinesController < ApplicationController
-  skip_before_filter :find_object_by_uuid, :only => :get_all_logins
-  skip_before_filter :render_404_if_no_object, :only => :get_all_logins
-  before_filter(:admin_required,
+  skip_before_action :find_object_by_uuid, :only => :get_all_logins
+  skip_before_action :render_404_if_no_object, :only => :get_all_logins
+  before_action(:admin_required,
                 :only => [:logins, :get_all_logins])
 
   # Get all login permissons (user uuid, login account, SSH key) for a
diff --git a/services/api/app/controllers/database_controller.rb b/services/api/app/controllers/database_controller.rb
index dddc3400b..b618a321e 100644
--- a/services/api/app/controllers/database_controller.rb
+++ b/services/api/app/controllers/database_controller.rb
@@ -3,9 +3,9 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class DatabaseController < ApplicationController
-  skip_before_filter :find_object_by_uuid
-  skip_before_filter :render_404_if_no_object
-  before_filter :admin_required
+  skip_before_action :find_object_by_uuid
+  skip_before_action :render_404_if_no_object
+  before_action :admin_required
   def reset
     raise ArvadosModel::PermissionDeniedError unless Rails.env == 'test'
 
diff --git a/services/api/app/controllers/static_controller.rb b/services/api/app/controllers/static_controller.rb
index f0992c183..e42715633 100644
--- a/services/api/app/controllers/static_controller.rb
+++ b/services/api/app/controllers/static_controller.rb
@@ -5,9 +5,9 @@
 class StaticController < ApplicationController
   respond_to :json, :html
 
-  skip_before_filter :find_object_by_uuid
-  skip_before_filter :render_404_if_no_object
-  skip_before_filter :require_auth_scope, only: [:home, :empty, :login_failure]
+  skip_before_action :find_object_by_uuid
+  skip_before_action :render_404_if_no_object
+  skip_before_action :require_auth_scope, only: [:home, :empty, :login_failure]
 
   def home
     respond_to do |f|
diff --git a/services/api/app/controllers/user_sessions_controller.rb b/services/api/app/controllers/user_sessions_controller.rb
index 1889d74ea..845149fc8 100644
--- a/services/api/app/controllers/user_sessions_controller.rb
+++ b/services/api/app/controllers/user_sessions_controller.rb
@@ -3,11 +3,11 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class UserSessionsController < ApplicationController
-  before_filter :require_auth_scope, :only => [ :destroy ]
+  before_action :require_auth_scope, :only => [ :destroy ]
 
-  skip_before_filter :set_cors_headers
-  skip_before_filter :find_object_by_uuid
-  skip_before_filter :render_404_if_no_object
+  skip_before_action :set_cors_headers
+  skip_before_action :find_object_by_uuid
+  skip_before_action :render_404_if_no_object
 
   respond_to :html
 
diff --git a/services/api/config/application.rb b/services/api/config/application.rb
index 24fd61871..e15a13b8c 100644
--- a/services/api/config/application.rb
+++ b/services/api/config/application.rb
@@ -58,8 +58,6 @@ module Server
     # Load entire application at startup.
     config.eager_load = true
 
-    config.active_record.raise_in_transactional_callbacks = true
-
     config.active_support.test_order = :sorted
 
     config.action_dispatch.perform_deep_munge = false

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list