[ARVADOS] updated: 1.3.0-973-gcb026a96d

Git user git at public.curoverse.com
Thu May 30 15:51:51 UTC 2019


Summary of changes:
 .../workbench/app/controllers/application_controller.rb | 17 ++++++++++-------
 apps/workbench/app/controllers/projects_controller.rb   |  1 -
 apps/workbench/app/helpers/application_helper.rb        |  8 ++++----
 apps/workbench/app/helpers/arvados_api_client_helper.rb |  2 +-
 apps/workbench/app/helpers/collections_helper.rb        |  2 +-
 apps/workbench/app/helpers/pipeline_instances_helper.rb |  2 +-
 apps/workbench/app/helpers/provenance_helper.rb         |  8 ++++----
 apps/workbench/app/models/arvados_base.rb               |  8 ++++----
 apps/workbench/app/models/arvados_resource_list.rb      | 15 +++++++++++++--
 apps/workbench/app/models/container_work_unit.rb        |  1 +
 .../app/views/application/_breadcrumbs.html.erb         |  2 +-
 apps/workbench/app/views/layouts/application.html.erb   |  2 +-
 .../app/views/projects/_show_dashboard.html.erb         |  3 ---
 apps/workbench/config/initializers/inflections.rb       |  8 ++++----
 apps/workbench/config/load_config.rb                    |  2 +-
 apps/workbench/test/integration_helper.rb               |  4 ++--
 apps/workbench/test/test_helper.rb                      |  2 +-
 services/login-sync/Gemfile.lock                        |  2 +-
 18 files changed, 50 insertions(+), 39 deletions(-)

       via  cb026a96db7c614c05ada93c5b7b1d2d22394b0c (commit)
      from  ac2785f7f3932ffa4988b6752482f0c1c6883c02 (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 cb026a96db7c614c05ada93c5b7b1d2d22394b0c
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Thu May 30 12:43:46 2019 -0300

    14946: Fixes warnings related to uninitialized instance variables, and others.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 21e9b49fd..f913a15ff 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -226,6 +226,7 @@ class ApplicationController < ActionController::Base
   end
 
   def index
+    @objects = nil if !defined?(@objects)
     find_objects_for_index if !@objects
     render_index
   end
@@ -322,6 +323,7 @@ class ApplicationController < ActionController::Base
   end
 
   def choose
+    @objects = nil if !defined?(@objects)
     params[:limit] ||= 40
     respond_to do |f|
       if params[:partial]
@@ -542,7 +544,7 @@ class ApplicationController < ActionController::Base
 
 
   def accept_uuid_as_id_param
-    if params[:id] and params[:id].match /\D/
+    if params[:id] and params[:id].match(/\D/)
       params[:uuid] = params.delete :id
     end
   end
@@ -812,6 +814,7 @@ class ApplicationController < ActionController::Base
 
   helper_method :user_notifications
   def user_notifications
+    @errors = nil if !defined?(@errors)
     return [] if @errors or not current_user.andand.is_active or not Rails.configuration.show_user_notifications
     @notifications ||= @@notification_tests.map do |t|
       t.call(self, current_user)
@@ -923,7 +926,7 @@ class ApplicationController < ActionController::Base
 
   helper_method :my_starred_projects
   def my_starred_projects user
-    return if @starred_projects
+    return if defined?(@starred_projects) && @starred_projects
     links = Link.filter([['tail_uuid', '=', user.uuid],
                          ['link_class', '=', 'star'],
                          ['head_uuid', 'is_a', 'arvados#group']]).select(%w(head_uuid))
@@ -938,7 +941,7 @@ class ApplicationController < ActionController::Base
   # That is: get toplevel projects under home, get subprojects of
   # these projects, and so on until we hit the limit.
   def my_wanted_projects(user, page_size=100)
-    return @my_wanted_projects if @my_wanted_projects
+    return @my_wanted_projects if defined?(@my_wanted_projects) && @my_wanted_projects
 
     from_top = []
     uuids = [user.uuid]
@@ -969,7 +972,7 @@ class ApplicationController < ActionController::Base
   end
 
   def build_my_wanted_projects_tree(user, page_size=100)
-    return @my_wanted_projects_tree if @my_wanted_projects_tree
+    return @my_wanted_projects_tree if defined?(@my_wanted_projects_tree) && @my_wanted_projects_tree
 
     parent_of = {user.uuid => 'me'}
     my_wanted_projects(user, page_size).each do |ob|
@@ -984,10 +987,10 @@ class ApplicationController < ActionController::Base
       children_of[parent_of[ob.uuid]] ||= []
       children_of[parent_of[ob.uuid]] << ob
     end
-    buildtree = lambda do |children_of, root_uuid=false|
+    buildtree = lambda do |chldrn_of, root_uuid=false|
       tree = {}
-      children_of[root_uuid].andand.each do |ob|
-        tree[ob] = buildtree.call(children_of, ob.uuid)
+      chldrn_of[root_uuid].andand.each do |ob|
+        tree[ob] = buildtree.call(chldrn_of, ob.uuid)
       end
       tree
     end
diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index cc657cbad..8237dc715 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -132,7 +132,6 @@ class ProjectsController < ApplicationController
 
   def remove_items
     @removed_uuids = []
-    links = []
     params[:item_uuids].collect { |uuid| ArvadosBase.find uuid }.each do |item|
       if item.class == Collection or item.class == Group
         # Use delete API on collections and projects/groups
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 3f72d5a2a..83123b26c 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -12,7 +12,7 @@ module ApplicationHelper
   end
 
   def current_api_host
-    Rails.configuration.arvados_v1_base.gsub /https?:\/\/|\/arvados\/v1/,''
+    Rails.configuration.arvados_v1_base.gsub(/https?:\/\/|\/arvados\/v1/, '')
   end
 
   def current_uuid_prefix
@@ -474,8 +474,8 @@ module ApplicationHelper
   def cwl_inputs_required(object, inputs_schema, set_attr_path)
     r = 0
     inputs_schema.each do |input|
-      required, primary_type, param_id = cwl_input_info(input)
-      dn, attrvalue = cwl_input_value(object, input, set_attr_path + [param_id])
+      required, _, param_id = cwl_input_info(input)
+      _, attrvalue = cwl_input_value(object, input, set_attr_path + [param_id])
       r += 1 if required and attrvalue.nil?
     end
     r
@@ -687,6 +687,6 @@ module ApplicationHelper
 
 private
   def is_textile?( object, attr )
-    is_textile = object.textile_attributes.andand.include?(attr)
+    object.textile_attributes.andand.include?(attr)
   end
 end
diff --git a/apps/workbench/app/helpers/arvados_api_client_helper.rb b/apps/workbench/app/helpers/arvados_api_client_helper.rb
index 5901de40b..929b64923 100644
--- a/apps/workbench/app/helpers/arvados_api_client_helper.rb
+++ b/apps/workbench/app/helpers/arvados_api_client_helper.rb
@@ -11,7 +11,7 @@ end
 # For the benefit of themes that still expect $arvados_api_client to work:
 class ArvadosClientProxyHack
   def method_missing *args
-    ArvadosApiClient.new_or_current.send *args
+    ArvadosApiClient.new_or_current.send(*args)
   end
 end
 $arvados_api_client = ArvadosClientProxyHack.new
diff --git a/apps/workbench/app/helpers/collections_helper.rb b/apps/workbench/app/helpers/collections_helper.rb
index f5f54851e..5eb1e8c76 100644
--- a/apps/workbench/app/helpers/collections_helper.rb
+++ b/apps/workbench/app/helpers/collections_helper.rb
@@ -55,7 +55,7 @@ module CollectionsHelper
     f0 = '' if f0 == '.'
     f0 = f0[2..-1] if f0[0..1] == './'
     f0 += '/' if not f0.empty?
-    file_path = "#{f0}#{file[1]}"
+    "#{f0}#{file[1]}"
   end
 
   ##
diff --git a/apps/workbench/app/helpers/pipeline_instances_helper.rb b/apps/workbench/app/helpers/pipeline_instances_helper.rb
index 214237522..ac0cbbccc 100644
--- a/apps/workbench/app/helpers/pipeline_instances_helper.rb
+++ b/apps/workbench/app/helpers/pipeline_instances_helper.rb
@@ -207,7 +207,7 @@ module PipelineInstancesHelper
         end
       else
         if step[:progress] and
-            (re = step[:progress].match /^(\d+)\+(\d+)\/(\d+)$/)
+            (re = step[:progress].match(/^(\d+)\+(\d+)\/(\d+)$/))
           pj[:progress] = (((re[1].to_f + re[2].to_f/2) / re[3].to_f) rescue 0.5)
         else
           pj[:progress] = 0.0
diff --git a/apps/workbench/app/helpers/provenance_helper.rb b/apps/workbench/app/helpers/provenance_helper.rb
index 9b4d265df..75261adbd 100644
--- a/apps/workbench/app/helpers/provenance_helper.rb
+++ b/apps/workbench/app/helpers/provenance_helper.rb
@@ -221,13 +221,13 @@ module ProvenanceHelper
                          {label: 'output'})
             end
             # Input collection nodes
-            output_pdhs = @opts[:output_collections].values.collect{|c|
-              c[:portable_data_hash]}
+            output_pdhs = @opts[:output_collections].values.collect{|oc|
+              oc[:portable_data_hash]}
             ProvenanceHelper::cr_input_pdhs(cr).each do |pdh|
               if not output_pdhs.include?(pdh)
                 # Search for collections on the same project first
-                cols = @opts[:input_collections][pdh].andand.select{|c|
-                  c[:owner_uuid] == cr[:owner_uuid]}
+                cols = @opts[:input_collections][pdh].andand.select{|ic|
+                  ic[:owner_uuid] == cr[:owner_uuid]}
                 if not cols or cols.empty?
                   # Search for any collection with this PDH
                   cols = @opts[:input_collections][pdh]
diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index 9e3ea46b1..b9162c2ae 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -107,8 +107,8 @@ class ArvadosBase
   end
 
   def self.columns
+    @discovered_columns = [] if !defined?(@discovered_columns)
     return @discovered_columns if @discovered_columns.andand.any?
-    @discovered_columns = []
     @attribute_info ||= {}
     schema = arvados_api_client.discovery[:schemas][self.to_s.to_sym]
     return @discovered_columns if schema.nil?
@@ -539,17 +539,17 @@ class ArvadosBase
     if opts[:class].is_a? Class
       return opts[:class]
     end
-    if uuid.match /^[0-9a-f]{32}(\+[^,]+)*(,[0-9a-f]{32}(\+[^,]+)*)*$/
+    if uuid.match(/^[0-9a-f]{32}(\+[^,]+)*(,[0-9a-f]{32}(\+[^,]+)*)*$/)
       return Collection
     end
     resource_class = nil
-    uuid.match /^[0-9a-z]{5}-([0-9a-z]{5})-[0-9a-z]{15}$/ do |re|
+    uuid.match(/^[0-9a-z]{5}-([0-9a-z]{5})-[0-9a-z]{15}$/) do |re|
       resource_class ||= arvados_api_client.
         kind_class(self.uuid_infix_object_kind[re[1]])
     end
     if opts[:referring_object] and
         opts[:referring_attr] and
-        opts[:referring_attr].match /_uuid$/
+        opts[:referring_attr].match(/_uuid$/)
       resource_class ||= arvados_api_client.
         kind_class(opts[:referring_object].
                    attributes[opts[:referring_attr].
diff --git a/apps/workbench/app/models/arvados_resource_list.rb b/apps/workbench/app/models/arvados_resource_list.rb
index 9ba61eaba..cbd544ebb 100644
--- a/apps/workbench/app/models/arvados_resource_list.rb
+++ b/apps/workbench/app/models/arvados_resource_list.rb
@@ -13,6 +13,17 @@ class ArvadosResourceList
     @fetch_multiple_pages = true
     @arvados_api_token = Thread.current[:arvados_api_token]
     @reader_tokens = Thread.current[:reader_tokens]
+    @results = nil
+    @count = nil
+    @offset = 0
+    @cond = nil
+    @eager = nil
+    @select = nil
+    @orderby_spec = nil
+    @filters = nil
+    @distinct = nil
+    @include_trash = nil
+    @limit = nil
   end
 
   def eager(bool=true)
@@ -90,7 +101,7 @@ class ArvadosResourceList
         end
       end
     end
-    @cond.keys.select { |x| x.match /_kind$/ }.each do |kind_key|
+    @cond.keys.select { |x| x.match(/_kind$/) }.each do |kind_key|
       if @cond[kind_key].is_a? Class
         @cond = @cond.merge({ kind_key => 'arvados#' + arvados_api_client.class_kind(@cond[kind_key]) })
       end
@@ -134,7 +145,7 @@ class ArvadosResourceList
 
   def each(&block)
     if not @results.nil?
-      @results.each &block
+      @results.each(&block)
     else
       self.each_page do |items|
         items.each do |i|
diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index ef20a7f8f..c564dc12e 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -14,6 +14,7 @@ class ContainerWorkUnit < ProxyWorkUnit
         @container = Container.find(container_uuid)
       end
     end
+    @container = nil if !defined?(@container)
     @child_proxies = child_objects
   end
 
diff --git a/apps/workbench/app/views/application/_breadcrumbs.html.erb b/apps/workbench/app/views/application/_breadcrumbs.html.erb
index fb4a1462a..7a2d08e54 100644
--- a/apps/workbench/app/views/application/_breadcrumbs.html.erb
+++ b/apps/workbench/app/views/application/_breadcrumbs.html.erb
@@ -51,7 +51,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
               } %>
             </ul>
           </li>
-          <% if @name_link or @object %>
+          <% if (defined?(@name_link) && @name_link) or (defined?(@object) && @object) %>
             <li class="nav-separator">
               <i class="fa fa-lg fa-angle-double-right"></i>
             </li>
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index b59bad4ec..638ee8970 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -33,7 +33,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
   <meta property="og:type" content="article" />
   <meta property="og:url" content="<%= request.url %>" />
   <meta property="og:site_name" content="<%= Rails.configuration.site_name %>" />
-  <% if @object %>
+  <% if defined?(@object) && @object %>
     <% if @object.respond_to?(:name) and @object.name.present? %>
       <meta property="og:title" content="<%= @object.name%>" />
     <% end %>
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index 69abf04e6..d4ea2de15 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -10,9 +10,6 @@ SPDX-License-Identifier: AGPL-3.0 %>
   recent_cr_containers = recent_crs.map {|cr| cr.container_uuid}.compact.uniq
   preload_objects_for_dataclass(Container, recent_cr_containers) if recent_cr_containers.andand.any?
 
-  # fetch children of all the active crs in one call, if there are any
-  active_crs = recent_crs.each {|cr| cr if (cr.priority.andand > 0 and cr.state != 'Final' and cr.container_uuid)}
-
   wus = {}
   outputs = []
   recent_procs.each do |p|
diff --git a/apps/workbench/config/initializers/inflections.rb b/apps/workbench/config/initializers/inflections.rb
index 01e71585e..55399f0f3 100644
--- a/apps/workbench/config/initializers/inflections.rb
+++ b/apps/workbench/config/initializers/inflections.rb
@@ -19,8 +19,8 @@
 # end
 
 ActiveSupport::Inflector.inflections do |inflect|
-  inflect.plural /^([Ss]pecimen)$/i, '\1s'
-  inflect.singular /^([Ss]pecimen)s?/i, '\1'
-  inflect.plural /^([Hh]uman)$/i, '\1s'
-  inflect.singular /^([Hh]uman)s?/i, '\1'
+  inflect.plural(/^([Ss]pecimen)$/i, '\1s')
+  inflect.singular(/^([Ss]pecimen)s?/i, '\1')
+  inflect.plural(/^([Hh]uman)$/i, '\1s')
+  inflect.singular(/^([Hh]uman)s?/i, '\1')
 end
diff --git a/apps/workbench/config/load_config.rb b/apps/workbench/config/load_config.rb
index d8d4dff56..5f0d9caf9 100644
--- a/apps/workbench/config/load_config.rb
+++ b/apps/workbench/config/load_config.rb
@@ -9,7 +9,7 @@ $application_config = {}
 
 %w(application.default application).each do |cfgfile|
   path = "#{::Rails.root.to_s}/config/#{cfgfile}.yml"
-  if File.exists? path
+  if File.exist? path
     yaml = ERB.new(IO.read path).result(binding)
     confs = YAML.load(yaml, deserialize_symbols: true)
     $application_config.merge!(confs['common'] || {})
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index 85c929fdb..9337daf4e 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -197,9 +197,9 @@ class ActionDispatch::IntegrationTest
   # exception if not found. Use this with assertions to explain that
   # the error signifies a failed test rather than an unexpected error
   # during a testing procedure.
-  def find? *args
+  def find?(*args)
     begin
-      find *args
+      find(*args)
     rescue Capybara::ElementNotFound
       false
     end
diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb
index bbd733bb4..a71d0b461 100644
--- a/apps/workbench/test/test_helper.rb
+++ b/apps/workbench/test/test_helper.rb
@@ -292,7 +292,7 @@ class ActiveSupport::TestCase
 
   def after_teardown
     if self.class.want_reset_api_fixtures[:after_each_test] and
-        @want_reset_api_fixtures != false
+        (!defined?(@want_reset_api_fixtures) or @want_reset_api_fixtures != false)
       self.class.reset_api_fixtures_now
     end
     super
diff --git a/services/login-sync/Gemfile.lock b/services/login-sync/Gemfile.lock
index e82c6b3c4..d03512d59 100644
--- a/services/login-sync/Gemfile.lock
+++ b/services/login-sync/Gemfile.lock
@@ -1,7 +1,7 @@
 PATH
   remote: .
   specs:
-    arvados-login-sync (1.3.3.20190402172810)
+    arvados-login-sync (1.3.3.20190528194843)
       arvados (~> 1.3.0, >= 1.3.0)
 
 GEM

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list