[ARVADOS] updated: 10db502ac06ae4566895cf2b5ffdf52db94181eb

Git user git at public.curoverse.com
Tue Oct 11 10:47:53 EDT 2016


Summary of changes:
 .../app/controllers/application_controller.rb      | 12 ++++----
 .../app/views/projects/_show_dashboard.html.erb    |  4 +--
 .../views/work_units/_component_detail.html.erb    |  2 +-
 .../app/views/work_units/_show_component.html.erb  |  2 +-
 apps/workbench/config/application.default.yml      | 10 +++----
 .../install-dispatch.html.textile.liquid           | 33 +++++++++++++++++++---
 .../crunch-dispatch-slurm/crunch-dispatch-slurm.go |  2 +-
 services/crunch-dispatch-slurm/usage.go            |  1 +
 8 files changed, 47 insertions(+), 19 deletions(-)

       via  10db502ac06ae4566895cf2b5ffdf52db94181eb (commit)
       via  a6e485dc05d0d7556bb6f109991d04a9d2e278dc (commit)
       via  87473fd874bfc6fe954089b74bef915543a48d60 (commit)
       via  fd36117b416e1190334d108058dc0c16ef24e964 (commit)
       via  24bcfa0b87b87e4510fffe8a961a5d4a9fd34948 (commit)
       via  8a6b627da64ece11c70dfee769c08055684979e6 (commit)
       via  77e64115189779a3d91f968946dfa82fa504d4c1 (commit)
       via  18de85806e3717421accb89b093fc2bd56822100 (commit)
       via  62a5bae0cf096fee69add487cd28a8bdbd4fa17c (commit)
       via  25236212b8f726335ede5d4aa5da120b81ef19a4 (commit)
       via  f853c2c7f2283b57a4f215aeb288b2842e3d1843 (commit)
       via  f678c1f5a1b03a49eb0a40f614990b0fbcad3436 (commit)
       via  d70adee422f8f68debdf4425fea8afd53a488556 (commit)
       via  6757824d984496469cd929cdbb62643c1cede7fd (commit)
       via  e25a377ed38698cb3eebbd0f43b80a5276595240 (commit)
       via  8e6d577f1381da0d42481ef8dd0479241e3c50bf (commit)
       via  bd7dc68d12f1d134106fd21afe9cbf2d0512c831 (commit)
       via  ffe1fe1c77743147ee82aacdc50edde3672cd748 (commit)
       via  f300b641735aa2657cfdcc4303050095c3bd60d5 (commit)
       via  a229ee1c2da50d247c5e7de12096f0f9d6ea3943 (commit)
       via  27b732adbd4d2331436a433394658a0cfcf5fd94 (commit)
       via  4da754586b4529a4480951218a69ec6f41fee98d (commit)
       via  84f3d7048e63fc88b39f329ac5472238df2edc3d (commit)
      from  b6552a6b3c1202eafebfc630ee7e9d6c919b811e (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 10db502ac06ae4566895cf2b5ffdf52db94181eb
Author: radhika <radhika at curoverse.com>
Date:   Tue Oct 11 10:46:45 2016 -0400

    10144: Rename :by_name as "by_attr" for preload_objects_for_dataclass

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index d0ecfe9..d8dc852 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -1180,15 +1180,15 @@ class ApplicationController < ActionController::Base
 
   # helper method to get object of a given dataclass and uuid
   helper_method :object_for_dataclass
-  def object_for_dataclass dataclass, uuid, by_name=nil
+  def object_for_dataclass dataclass, uuid, by_attr=nil
     raise ArgumentError, 'No input argument dataclass' unless (dataclass && uuid)
-    preload_objects_for_dataclass(dataclass, [uuid], by_name)
+    preload_objects_for_dataclass(dataclass, [uuid], by_attr)
     @objects_for[uuid]
   end
 
   # helper method to preload objects for given dataclass and uuids
   helper_method :preload_objects_for_dataclass
-  def preload_objects_for_dataclass dataclass, uuids, by_name=nil
+  def preload_objects_for_dataclass dataclass, uuids, by_attr=nil
     @objects_for ||= {}
 
     raise ArgumentError, 'Argument is not a data class' unless dataclass.is_a? Class
@@ -1205,7 +1205,9 @@ class ApplicationController < ActionController::Base
     uuids.each do |x|
       @objects_for[x] = nil
     end
-    if by_name
+    if by_attr and ![:uuid, :name].include?(by_attr)
+      raise ArgumentError, "Preloading only using lookups by uuid or name are supported: #{by_attr}"
+    elsif by_attr and by_attr == :name
       dataclass.where(name: uuids).each do |obj|
         @objects_for[obj.name] = obj
       end
diff --git a/apps/workbench/app/views/work_units/_component_detail.html.erb b/apps/workbench/app/views/work_units/_component_detail.html.erb
index 45ae978..f66ff07 100644
--- a/apps/workbench/app/views/work_units/_component_detail.html.erb
+++ b/apps/workbench/app/views/work_units/_component_detail.html.erb
@@ -43,7 +43,7 @@
             <table>
               <% # link to repo tree/file only if the repo is readable and the commit is a sha1
                  repo = (/^[0-9a-f]{40}$/ =~ current_obj.script_version and
-                         object_for_dataclass(Repository, current_obj.repository, :by_name))
+                         object_for_dataclass(Repository, current_obj.repository, :name))
                  repo = nil unless repo.andand.http_fetch_url
                  %>
               <% [:script, :repository, :script_version, :supplied_script_version, :nondeterministic,
diff --git a/apps/workbench/app/views/work_units/_show_component.html.erb b/apps/workbench/app/views/work_units/_show_component.html.erb
index 9bf751f..08405b3 100644
--- a/apps/workbench/app/views/work_units/_show_component.html.erb
+++ b/apps/workbench/app/views/work_units/_show_component.html.erb
@@ -68,7 +68,7 @@
   end
 
   repos = wu.children.collect {|c| c.repository}.uniq.compact
-  preload_objects_for_dataclass(Repository, repos, :by_name) if repos.any?
+  preload_objects_for_dataclass(Repository, repos, :name) if repos.any?
 %>
 
 <% if wu.has_unreadable_children %>

commit a6e485dc05d0d7556bb6f109991d04a9d2e278dc
Merge: 8a6b627 87473fd
Author: radhika <radhika at curoverse.com>
Date:   Tue Oct 11 10:13:46 2016 -0400

    Merge branch 'master' into 10144-pipeline-display-perf


commit 8a6b627da64ece11c70dfee769c08055684979e6
Merge: b6552a6 77e6411
Author: radhika <radhika at curoverse.com>
Date:   Tue Oct 11 09:56:04 2016 -0400

    Merge branch 'master' into 10144-pipeline-display-perf


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


hooks/post-receive
-- 




More information about the arvados-commits mailing list