5365: preload output collection uuids and jobs to help improve performance when loadi...
authorRadhika Chippada <radhika@curoverse.com>
Wed, 8 Apr 2015 13:35:55 +0000 (09:35 -0400)
committerRadhika Chippada <radhika@curoverse.com>
Wed, 8 Apr 2015 13:35:55 +0000 (09:35 -0400)
apps/workbench/app/helpers/application_helper.rb
apps/workbench/app/views/application/_content.html.erb
apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
services/api/test/fixtures/pipeline_instances.yml

index 5fc541c1715665088dcf9b25e8a8696c691cc22b..420ffbaf117a599a4ad1a8d31ee2a764197c0ddd 100644 (file)
@@ -184,7 +184,11 @@ module ApplicationHelper
     end
 
     if resource_class.andand.to_s == 'Collection'
-      readable = resource_class.find?(attrvalue)
+      if CollectionsHelper.match(attrvalue)
+        readable = Collection.find? attrvalue
+      else
+        readable = collections_for_object(attrvalue).any?
+      end
     else
       readable = object_for_dataclass(resource_class, attrvalue)
     end
index 1f7f2d29c50d7e4538872fcdf28d6df4c2f484dd..03dff654640facf47c7c3cfd8a86e6ac856a4b44 100644 (file)
@@ -9,7 +9,7 @@
       <% data_toggle = "tab" %>
       <% tab_tooltip = "" %>
 
-      <% if !current_user and pane_name == "Log"
+      <% if (pane_name == "Log") and (@object.owner_uuid != current_user)
           if controller.model_class.to_s == 'Job'
             if @object.log and !@object.log.empty?
               logCollection = Collection.find? @object.log
index e112a05473826e1653b92cd717a3fdda76fc212b..a1d3296d1466efdaecac722efd0dcf0cb51ca6ca 100644 (file)
     resource_class = resource_class_for_uuid(job_uuids.first, friendly_name: true)
     preload_objects_for_dataclass resource_class, job_uuids
   end
+
+  job_outputs = pipeline_jobs.collect {|j| j[:job][:output]}.compact
+  job_output_pdhs = job_outputs.select {|x| !(m = CollectionsHelper.match(x)).nil?}.compact
+  job_output_uuids = job_outputs - job_output_pdhs
+  preload_collections_for_objects job_output_uuids if job_output_uuids.any?
 %>
 
 <% pipeline_jobs.each_with_index do |pj, i| %>
index d71585f94a3c5934053a23e110f62de3b8a36799..c1ec91723dd2c427223846483b08c9795d903dad 100644 (file)
@@ -268,7 +268,13 @@ pipeline_in_publicly_accessible_project:
           title: foo instance input
       job:
         uuid: zzzzz-8i9sb-jyq01m7in1jlofj
+        repository: active/foo
+        script: foo
         script_version: master
+        script_parameters:
+          input:
+            dataclass: Collection
+            title: foo instance input
         log: zzzzz-4zz18-4en62shvi99lxd4
         output: b519d9cb706a29fc7ea24dbea2f05851+93
         state: Complete
@@ -291,7 +297,13 @@ pipeline_in_publicly_accessible_project_but_other_objects_elsewhere:
           title: foo instance input
       job:
         uuid: zzzzz-8i9sb-aceg2bnq7jt7kon
+        repository: active/foo
+        script: foo
         script_version: master
+        script_parameters:
+          input:
+            dataclass: Collection
+            title: foo instance input
         log: zzzzz-4zz18-bv31uwvy3neko21
         output: zzzzz-4zz18-bv31uwvy3neko21
         state: Complete