[ARVADOS] updated: 5ea2ee645b5508c9c14cc2abe6cb8c2f24039c83

git at public.curoverse.com git at public.curoverse.com
Fri Apr 3 11:59:04 EDT 2015


Summary of changes:
 apps/workbench/app/helpers/jobs_helper.rb          |  4 +-
 .../app/views/application/_content.html.erb        | 27 ++++++++-
 .../pipeline_instances/_running_component.html.erb | 22 ++++++-
 .../api/script/migrate-gitolite-to-uuid-storage.rb |  3 +
 services/api/test/fixtures/pipeline_instances.yml  | 28 +++++++++
 services/arv-git-httpd/auth_handler.go             | 69 +++++++++++++---------
 services/arv-git-httpd/server_test.go              | 26 ++++----
 7 files changed, 130 insertions(+), 49 deletions(-)

       via  5ea2ee645b5508c9c14cc2abe6cb8c2f24039c83 (commit)
       via  6fe9234c96ecc16ccf5b683bed150c43842f90a0 (commit)
       via  2d56bd2e4722e9c664f7605b3a46b505a30782db (commit)
       via  bcd68a650d3f68feaa05a785323430a24e65b6d4 (commit)
       via  949e7250b7f575d81c2da1c74f15885b6cf1628e (commit)
      from  1a4d0158373902cac889ce5409fcae447d4a68d6 (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 5ea2ee645b5508c9c14cc2abe6cb8c2f24039c83
Merge: 6fe9234 2d56bd2
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Fri Apr 3 11:58:51 2015 -0400

    Merge branch 'master' into 5365-not-link-unreadables


commit 6fe9234c96ecc16ccf5b683bed150c43842f90a0
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Fri Apr 3 11:56:20 2015 -0400

    5365: Do not link to job, log, output in pipeline instance if the user, mainly anonymous user, cannot read those objects.
    Disable Log tab and show tooltip in such a scenario.
    Working in manual testing. Integration test updates are on the way.

diff --git a/apps/workbench/app/helpers/jobs_helper.rb b/apps/workbench/app/helpers/jobs_helper.rb
index 2403313..889dd23 100644
--- a/apps/workbench/app/helpers/jobs_helper.rb
+++ b/apps/workbench/app/helpers/jobs_helper.rb
@@ -1,9 +1,9 @@
 module JobsHelper
-  def stderr_log_history(job_uuids)
+  def stderr_log_history(job_uuids, limit=2000)
     results = []
 
     log_history = Log.where(event_type: 'stderr',
-                            object_uuid: job_uuids).limit(2000).order('id DESC')
+                            object_uuid: job_uuids).limit(limit).order('id DESC')
     if !log_history.results.empty?
       reversed_results = log_history.results.reverse
       reversed_results.each do |entry|
diff --git a/apps/workbench/app/views/application/_content.html.erb b/apps/workbench/app/views/application/_content.html.erb
index 782a6af..1f7f2d2 100644
--- a/apps/workbench/app/views/application/_content.html.erb
+++ b/apps/workbench/app/views/application/_content.html.erb
@@ -5,10 +5,33 @@
   <ul class="nav nav-tabs" data-tab-counts-url="<%= url_for(action: :tab_counts) rescue '' %>">
     <% pane_list.each_with_index do |pane, i| %>
       <% pane_name = (pane.is_a?(Hash) ? pane[:name] : pane) %>
-      <li class="<%= 'active' if i==0 %>">
+
+      <% data_toggle = "tab" %>
+      <% tab_tooltip = "" %>
+
+      <% if !current_user and pane_name == "Log"
+          if controller.model_class.to_s == 'Job'
+            if @object.log and !@object.log.empty?
+              logCollection = Collection.find? @object.log
+              if !logCollection
+                data_toggle = "disabled"
+                tab_tooltip = "Log data is not available"
+              end
+            end
+          elsif controller.model_class.to_s == 'PipelineInstance'
+            log_uuids = [@object.uuid] + pipeline_jobs(@object).collect{|x|x[:job].andand[:uuid]}.compact
+            if stderr_log_history(log_uuids, 1).empty?
+              data_toggle = "disabled"
+              tab_tooltip = "Log data is not available"
+            end
+          end
+        end
+      %>
+
+      <li class="<%= 'active' if i==0 %>" data-toggle="tooltip" data-placement="top" title="<%=tab_tooltip%>">
         <a href="#<%= pane_name %>"
            id="<%= pane_name %>-tab"
-           data-toggle="tab"
+           data-toggle="<%= data_toggle %>"
            data-tab-history=true
            data-tab-history-update-url=true
            >
diff --git a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
index 018d49f..90238bf 100644
--- a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -66,9 +66,19 @@
             <%# column offset 8 %>
             <div class="col-md-4 text-overflow-ellipsis">
               <% if pj[:output_uuid] %>
-                <%= link_to_if_arvados_object pj[:output_uuid], friendly_name: true %>
+                <% output = Collection.find?(pj[:output_uuid]) %>
+                <% if output %>
+                  <%= link_to_if_arvados_object pj[:output_uuid], friendly_name: true %>
+                <% else %>
+                  Output data not available
+                <% end %>
               <% elsif current_job[:output] %>
-                <%= link_to_if_arvados_object current_job[:output], link_text: "Output of #{pj[:name]}" %>
+                <% output = Collection.find?(current_job[:output]) %>
+                <% if output %>
+                  <%= link_to_if_arvados_object current_job[:output], link_text: "Output of #{pj[:name]}" %>
+                <% else %>
+                  Output data not available
+                <% end %>
               <% else %>
                 No output.
               <% end %>
@@ -148,7 +158,13 @@
                   </td>
                   <td>
                     <% if k == :uuid %>
-                      <%= link_to_if_arvados_object current_component[k], link_text: current_component[k] %>
+                      <% if !current_user and (resource_class_for_uuid(current_component[k]).andand.to_s == 'Job') %>
+                        <% if Job.find?(current_component[k]) %>
+                          <%= link_to_if_arvados_object current_component[k], link_text: current_component[k] %>
+                        <% else %>
+                          <%= current_component[k] %>
+                        <% end %>
+                      <% end %>
                     <% elsif k.to_s.end_with? 'uuid' %>
                       <%= link_to_if_arvados_object current_component[k], friendly_name: true %>
                     <% elsif k.to_s.end_with? '_at' %>
diff --git a/services/api/test/fixtures/pipeline_instances.yml b/services/api/test/fixtures/pipeline_instances.yml
index df01035..cd2c831 100644
--- a/services/api/test/fixtures/pipeline_instances.yml
+++ b/services/api/test/fixtures/pipeline_instances.yml
@@ -254,6 +254,7 @@ pipeline_in_publicly_accessible_project:
   uuid: zzzzz-d1hrv-n68vc490mloy4fi
   owner_uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
   name: Pipeline in publicly accessible project
+  pipeline_template_uuid: zzzzz-p5p6p-tmpltpublicproj
   state: Complete
   created_at: 2014-09-15 12:00:00
   components:
@@ -265,6 +266,33 @@ pipeline_in_publicly_accessible_project:
           required: true
           dataclass: Collection
           title: foo instance input
+      job:
+        uuid: zzzzz-8i9sb-n7omg50bvt0m1nf
+        script_version: master
+        log: zzzzz-4zz18-4en62shvi99lxd4
+        output: zzzzz-4zz18-4en62shvi99lxd4
+
+pipeline_in_publicly_accessible_project_but_other_objects_elsewhere:
+  uuid: zzzzz-d1hrv-pisharednotobjs
+  owner_uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
+  name: Pipeline in publicly accessible project with job and log elsewhere
+  pipeline_template_uuid: zzzzz-p5p6p-aox0k0ofxrystgw
+  state: Complete
+  created_at: 2014-09-15 12:00:00
+  components:
+    foo:
+      script: foo
+      script_version: master
+      script_parameters:
+        input:
+          required: true
+          dataclass: Collection
+          title: foo instance input
+      job:
+        uuid: zzzzz-8i9sb-pshmckwoma9plh7
+        script_version: master
+        log: zzzzz-4zz18-bv31uwvy3neko21
+        output: zzzzz-4zz18-bv31uwvy3neko21
 
 pipeline_in_running_state:
   name: running_with_job

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list