[ARVADOS] updated: dae3f71243933d142eb3c1e8d15e18e3764bfb2e

git at public.curoverse.com git at public.curoverse.com
Fri Dec 4 16:01:08 EST 2015


Summary of changes:
 apps/workbench/app/models/pipeline_instance.rb     |  4 +++
 .../pipeline_instances/_running_component.html.erb | 29 ++++++++++++++++++++--
 .../_show_components_running.html.erb              |  2 +-
 .../views/pipeline_instances/_show_log.html.erb    |  3 ++-
 .../test/integration/anonymous_access_test.rb      | 19 ++++++++------
 apps/workbench/test/integration/jobs_test.rb       |  4 +--
 .../test/integration/pipeline_instances_test.rb    | 12 ++++-----
 services/api/test/fixtures/jobs.yml                |  2 +-
 8 files changed, 55 insertions(+), 20 deletions(-)

       via  dae3f71243933d142eb3c1e8d15e18e3764bfb2e (commit)
       via  4482be7a145c1bd87b0793520c95478cb7d0ea54 (commit)
       via  4dcf4e849f242a929ce03b5d529e0e1a63fbaeb0 (commit)
       via  98378a9a3d5d5b1dc726e0a02c0057f93e79bab8 (commit)
       via  e265f2b3b4da3c5988374c2f3209b10eb974c66e (commit)
       via  6d38a42c2b7b9b4d4ecffe75f1f3a4f0815d4ada (commit)
      from  58f60163b826a04085cbc69a6be1660c37174d7c (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 dae3f71243933d142eb3c1e8d15e18e3764bfb2e
Merge: 58f6016 4482be7
Author: radhika <radhika at curoverse.com>
Date:   Fri Dec 4 16:00:55 2015 -0500

    closes #7753
    Merge branch '7753-job-log-accessibility'


commit 4482be7a145c1bd87b0793520c95478cb7d0ea54
Author: radhika <radhika at curoverse.com>
Date:   Fri Dec 4 13:48:48 2015 -0500

    7753: show the job Log link in the component panel header only when it is a pipeline_instance display; hide it for job#show

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 6a24f1f..cb27f1c 100644
--- a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -19,26 +19,28 @@
 
         <% if current_job %>
           <%# column offset 4 %>
-          <% if current_job[:state].in? ["Complete", "Failed", "Cancelled"] %>
-            <div class="col-md-1">
-            <% if current_job[:log] %>
-                <% logCollection = Collection.find? current_job[:log] %>
-                <% if logCollection %>
+          <% if(pipeline_display rescue nil) %>
+            <% if current_job[:state].in? ["Complete", "Failed", "Cancelled"] %>
+              <div class="col-md-1">
+              <% if current_job[:log] %>
+                  <% logCollection = Collection.find? current_job[:log] %>
+                  <% if logCollection %>
+                    <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
+                  <% else %>
+                    Log unavailable
+                  <% end %>
+              <% end %>
+              </div>
+            <% elsif current_job[:state] == "Running" %>
+              <div class="col-md-1">
+                <% job = Job.find? current_job[:uuid] %>
+                <% if job %>
                   <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
                 <% else %>
                   Log unavailable
                 <% end %>
+              </div>
             <% end %>
-            </div>
-          <% elsif current_job[:state] == "Running" %>
-            <div class="col-md-1">
-              <% job = Job.find? current_job[:uuid] %>
-              <% if job %>
-                <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
-              <% else %>
-                Log unavailable
-              <% end %>
-            </div>
           <% end %>
 
           <%# column offset 5 %>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb b/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
index 566e3d7..4343f2e 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
@@ -97,5 +97,5 @@
 %>
 
 <% pipeline_jobs.each_with_index do |pj, i| %>
-  <%= render partial: 'running_component', locals: {pj: pj, i: i, expanded: false} %>
+  <%= render partial: 'running_component', locals: {pj: pj, i: i, expanded: false, pipeline_display: true} %>
 <% end %>
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index f962821..d58a031 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -251,17 +251,15 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
           # Function.prototype.bind, which is used by job_log_graph.js.
           find(:xpath, "//a[@href='#Log']").click
           assert_text expect_log_text
-        else
-          assert_selector "a[href=\"/jobs/#{object['uuid']}#Log\"]", text: 'Log'
         end
       else
         assert_selector 'a[data-toggle="disabled"]', text: 'Log'
-        assert_text 'Log unavailable'
         assert_text 'Output data not available'
         assert_text object['job']
         if pipeline_page
           assert_no_text 'This pipeline was created from'  # template is not readable
           assert_no_selector 'a', text: object['components']['foo']['job']['uuid']
+          assert_text 'Log unavailable'
         end
         find(:xpath, "//a[@href='#Log']").click
         assert_text 'Output data not available'

commit 4dcf4e849f242a929ce03b5d529e0e1a63fbaeb0
Author: radhika <radhika at curoverse.com>
Date:   Fri Dec 4 10:56:19 2015 -0500

    7753: when a job is in "Running" state, the Log link still should be shown in the Component display panel header.

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 6cfb017..6a24f1f 100644
--- a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -19,8 +19,8 @@
 
         <% if current_job %>
           <%# column offset 4 %>
-          <% if current_job[:state].in? ["Running", "Complete", "Failed", "Cancelled"] %>
-          <div class="col-md-1">
+          <% if current_job[:state].in? ["Complete", "Failed", "Cancelled"] %>
+            <div class="col-md-1">
             <% if current_job[:log] %>
                 <% logCollection = Collection.find? current_job[:log] %>
                 <% if logCollection %>
@@ -29,7 +29,16 @@
                   Log unavailable
                 <% end %>
             <% end %>
-          </div>
+            </div>
+          <% elsif current_job[:state] == "Running" %>
+            <div class="col-md-1">
+              <% job = Job.find? current_job[:uuid] %>
+              <% if job %>
+                <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
+              <% else %>
+                Log unavailable
+              <% end %>
+            </div>
           <% end %>
 
           <%# column offset 5 %>
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index 14dda0c..f962821 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -211,6 +211,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
     ['pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', true, 'admin'],
 
     ['completed_job_in_publicly_accessible_project', true],
+    ['running_job_in_publicly_accessible_project', true],
     ['job_in_publicly_accessible_project_but_other_objects_elsewhere', false],
   ].each do |fixture, objects_readable, user=nil|
     test "access #{fixture} in public project with objects readable=#{objects_readable} with user #{user}" do
@@ -243,15 +244,15 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
           assert_text 'This pipeline was created from'
           job_id = object['components']['foo']['job']['uuid']
           assert_selector 'a', text: job_id
-          if object['components']['foo']['job']['log']
-            assert_selector "a[href=\"/jobs/#{job_id}#Log\"]", text: 'Log'
-          end
+          assert_selector "a[href=\"/jobs/#{job_id}#Log\"]", text: 'Log'
 
           # We'd like to test the Log tab on job pages too, but we can't right
           # now because Poltergeist 1.x doesn't support JavaScript's
           # Function.prototype.bind, which is used by job_log_graph.js.
           find(:xpath, "//a[@href='#Log']").click
           assert_text expect_log_text
+        else
+          assert_selector "a[href=\"/jobs/#{object['uuid']}#Log\"]", text: 'Log'
         end
       else
         assert_selector 'a[data-toggle="disabled"]', text: 'Log'

commit 98378a9a3d5d5b1dc726e0a02c0057f93e79bab8
Author: radhika <radhika at curoverse.com>
Date:   Fri Dec 4 09:49:22 2015 -0500

    7753: Now that there are 1+ "Log" links in the pipeline instance page, update tests to address capybara ambigous match error.

diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index 5a685b3..14dda0c 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -237,7 +237,6 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
 
       if objects_readable
         assert_selector 'a[href="#Log"]', text: 'Log'
-
         assert_no_selector 'a[data-toggle="disabled"]', text: 'Log'
         assert_no_text 'Output data not available'
         if pipeline_page
diff --git a/apps/workbench/test/integration/jobs_test.rb b/apps/workbench/test/integration/jobs_test.rb
index 2cae500..b8d3890 100644
--- a/apps/workbench/test/integration/jobs_test.rb
+++ b/apps/workbench/test/integration/jobs_test.rb
@@ -41,7 +41,7 @@ class JobsTest < ActionDispatch::IntegrationTest
     visit page_with_token("active", "/jobs/#{job['uuid']}")
     assert page.has_text? job['script_version']
 
-    click_link 'Log'
+    find(:xpath, "//a[@href='#Log']").click
     wait_for_ajax
     assert page.has_text? 'Started at'
     assert page.has_text? 'Finished at'
@@ -61,7 +61,7 @@ class JobsTest < ActionDispatch::IntegrationTest
     visit page_with_token("active", "/jobs/#{job['uuid']}")
     assert page.has_text? job['script_version']
 
-    click_link 'Log'
+    find(:xpath, "//a[@href='#Log']").click
     wait_for_ajax
     assert page.has_text? 'Showing only 100 bytes of this log'
   end
diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index 612493a..2ab8beb 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -545,7 +545,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
   test "job logs linked for running pipeline" do
     pi = api_fixture("pipeline_instances", "running_pipeline_with_complete_job")
     visit(page_with_token("active", "/pipeline_instances/#{pi['uuid']}"))
-    click_on "Log"
+    find(:xpath, "//a[@href='#Log']").click
     within "#Log" do
       assert_text "Log for previous"
       log_link = find("a", text: "Log for previous")
@@ -558,7 +558,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
   test "job logs linked for complete pipeline" do
     pi = api_fixture("pipeline_instances", "complete_pipeline_with_two_jobs")
     visit(page_with_token("active", "/pipeline_instances/#{pi['uuid']}"))
-    click_on "Log"
+    find(:xpath, "//a[@href='#Log']").click
     within "#Log" do
       assert_text "Log for previous"
       pi["components"].each do |cname, cspec|
@@ -572,7 +572,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
   test "job logs linked for failed pipeline" do
     pi = api_fixture("pipeline_instances", "failed_pipeline_with_two_jobs")
     visit(page_with_token("active", "/pipeline_instances/#{pi['uuid']}"))
-    click_on "Log"
+    find(:xpath, "//a[@href='#Log']").click
     within "#Log" do
       assert_text "Log for previous"
       pi["components"].each do |cname, cspec|

commit e265f2b3b4da3c5988374c2f3209b10eb974c66e
Author: radhika <radhika at curoverse.com>
Date:   Fri Dec 4 09:19:33 2015 -0500

    7753: The name "Job log" has a little problem; on screen small screen sizes, "Job log" is displayed in two lines even when the rest of the items are displayed in single line due to the limited real estate in the panel header.

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 d4a87b3..6cfb017 100644
--- a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -24,7 +24,7 @@
             <% if current_job[:log] %>
                 <% logCollection = Collection.find? current_job[:log] %>
                 <% if logCollection %>
-                  <%= link_to "Job log", job_path(current_job[:uuid], anchor: "Log") %>
+                  <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
                 <% else %>
                   Log unavailable
                 <% end %>
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index be9799c..5a685b3 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -237,6 +237,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
 
       if objects_readable
         assert_selector 'a[href="#Log"]', text: 'Log'
+
         assert_no_selector 'a[data-toggle="disabled"]', text: 'Log'
         assert_no_text 'Output data not available'
         if pipeline_page
@@ -244,13 +245,13 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
           job_id = object['components']['foo']['job']['uuid']
           assert_selector 'a', text: job_id
           if object['components']['foo']['job']['log']
-            assert_selector "a[href=\"/jobs/#{job_id}#Log\"]", text: 'Job log'
+            assert_selector "a[href=\"/jobs/#{job_id}#Log\"]", text: 'Log'
           end
 
           # We'd like to test the Log tab on job pages too, but we can't right
           # now because Poltergeist 1.x doesn't support JavaScript's
           # Function.prototype.bind, which is used by job_log_graph.js.
-          click_link "Log"
+          find(:xpath, "//a[@href='#Log']").click
           assert_text expect_log_text
         end
       else
@@ -262,7 +263,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
           assert_no_text 'This pipeline was created from'  # template is not readable
           assert_no_selector 'a', text: object['components']['foo']['job']['uuid']
         end
-        click_link "Log"
+        find(:xpath, "//a[@href='#Log']").click
         assert_text 'Output data not available'
         assert_no_text expect_log_text
       end

commit 6d38a42c2b7b9b4d4ecffe75f1f3a4f0815d4ada
Author: radhika <radhika at curoverse.com>
Date:   Thu Dec 3 16:00:52 2015 -0500

    7753: Add a Log link to pipeline_instance component panel

diff --git a/apps/workbench/app/models/pipeline_instance.rb b/apps/workbench/app/models/pipeline_instance.rb
index 03d70b2..6e556d5 100644
--- a/apps/workbench/app/models/pipeline_instance.rb
+++ b/apps/workbench/app/models/pipeline_instance.rb
@@ -92,6 +92,10 @@ class PipelineInstance < ArvadosBase
     components_map { |cspec| cspec[:job][:log] rescue nil }
   end
 
+  def job_ids
+    components_map { |cspec| cspec[:job][:uuid] rescue nil }
+  end
+
   def stderr_log_object_uuids
     result = job_uuids.values.compact
     result << uuid
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 63a2371..d4a87b3 100644
--- a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -4,7 +4,7 @@
     <div class="container-fluid">
       <div class="row-fluid">
         <%# column offset 0 %>
-        <div class="col-md-3" style="word-break:break-all;">
+        <div class="col-md-2" style="word-break:break-all;">
           <h4 class="panel-title">
             <a data-toggle="collapse" href="#collapse<%= i %>">
               <%= pj[:name] %> <span class="caret"></span>
@@ -12,12 +12,26 @@
           </h4>
         </div>
 
-        <%# column offset 3 %>
+        <%# column offset 2 %>
         <div class="col-md-2 pipeline-instance-spacing">
           <%= pj[:progress_bar] %>
         </div>
 
         <% if current_job %>
+          <%# column offset 4 %>
+          <% if current_job[:state].in? ["Running", "Complete", "Failed", "Cancelled"] %>
+          <div class="col-md-1">
+            <% if current_job[:log] %>
+                <% logCollection = Collection.find? current_job[:log] %>
+                <% if logCollection %>
+                  <%= link_to "Job log", job_path(current_job[:uuid], anchor: "Log") %>
+                <% else %>
+                  Log unavailable
+                <% end %>
+            <% end %>
+          </div>
+          <% end %>
+
           <%# column offset 5 %>
           <% if current_job[:state] != "Queued" %>
           <div class="col-md-3">
diff --git a/apps/workbench/app/views/pipeline_instances/_show_log.html.erb b/apps/workbench/app/views/pipeline_instances/_show_log.html.erb
index 187dce7..3a4ec4e 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_log.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_log.html.erb
@@ -1,4 +1,5 @@
 <% log_ids = @object.job_log_ids
+   job_ids = @object.job_ids
    still_logging, done_logging = log_ids.keys.partition { |k| log_ids[k].nil? }
 %>
 
@@ -19,7 +20,7 @@
       <tr>
         <td><%= cname %></td>
         <td><%= link_to("Log for #{cname}",
-                {controller: "collections", action: "show", id: log_ids[cname]})
+                job_path(job_ids[cname], anchor: "Log"))
                 %></td>
       </tr>
       <% end %>
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index aabbf00..be9799c 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -218,18 +218,18 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
 
       if pipeline_page
         object = api_fixture('pipeline_instances')[fixture]
-        page = "/pipeline_instances/#{object['uuid']}"
+        page_link = "/pipeline_instances/#{object['uuid']}"
         expect_log_text = "Log for foo"
       else      # job
         object = api_fixture('jobs')[fixture]
-        page = "/jobs/#{object['uuid']}"
+        page_link = "/jobs/#{object['uuid']}"
         expect_log_text = "stderr crunchstat"
       end
 
       if user
-        visit page_with_token user, page
+        visit page_with_token user, page_link
       else
-        visit page
+        visit page_link
       end
 
       # click job link, if in pipeline page
@@ -241,7 +241,12 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
         assert_no_text 'Output data not available'
         if pipeline_page
           assert_text 'This pipeline was created from'
-          assert_selector 'a', text: object['components']['foo']['job']['uuid']
+          job_id = object['components']['foo']['job']['uuid']
+          assert_selector 'a', text: job_id
+          if object['components']['foo']['job']['log']
+            assert_selector "a[href=\"/jobs/#{job_id}#Log\"]", text: 'Job log'
+          end
+
           # We'd like to test the Log tab on job pages too, but we can't right
           # now because Poltergeist 1.x doesn't support JavaScript's
           # Function.prototype.bind, which is used by job_log_graph.js.
@@ -250,6 +255,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
         end
       else
         assert_selector 'a[data-toggle="disabled"]', text: 'Log'
+        assert_text 'Log unavailable'
         assert_text 'Output data not available'
         assert_text object['job']
         if pipeline_page
diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index 8617c37..612493a 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -550,7 +550,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
       assert_text "Log for previous"
       log_link = find("a", text: "Log for previous")
       assert_includes(log_link[:href],
-                      pi["components"]["previous"]["job"]["log"])
+                      "/jobs/#{pi["components"]["previous"]["job"]["uuid"]}#Log")
       assert_selector "#event_log_div"
     end
   end
@@ -563,7 +563,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
       assert_text "Log for previous"
       pi["components"].each do |cname, cspec|
         log_link = find("a", text: "Log for #{cname}")
-        assert_includes(log_link[:href], cspec["job"]["log"])
+        assert_includes(log_link[:href], "/jobs/#{cspec["job"]["uuid"]}#Log")
       end
       assert_no_selector "#event_log_div"
     end
@@ -577,7 +577,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
       assert_text "Log for previous"
       pi["components"].each do |cname, cspec|
         log_link = find("a", text: "Log for #{cname}")
-        assert_includes(log_link[:href], cspec["job"]["log"])
+        assert_includes(log_link[:href], "/jobs/#{cspec["job"]["uuid"]}#Log")
       end
       assert_no_selector "#event_log_div"
     end
diff --git a/services/api/test/fixtures/jobs.yml b/services/api/test/fixtures/jobs.yml
index 8a4c345..12493e3 100644
--- a/services/api/test/fixtures/jobs.yml
+++ b/services/api/test/fixtures/jobs.yml
@@ -482,7 +482,7 @@ completed_job_in_publicly_accessible_project:
   script_parameters:
     input: fa7aeb5140e2848d39b416daeef4ffc5+45
     input2: "stuff2"
-  log: ~
+  log: zzzzz-4zz18-4en62shvi99lxd4
   output: b519d9cb706a29fc7ea24dbea2f05851+93
 
 job_in_publicly_accessible_project_but_other_objects_elsewhere:

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list