[ARVADOS] updated: cd1f6c0fd2f9a91b88659b90a6fd9faee576a557
git at public.curoverse.com
git at public.curoverse.com
Tue Apr 7 10:47:14 EDT 2015
Summary of changes:
apps/workbench/app/helpers/application_helper.rb | 18 ++++
apps/workbench/app/views/layouts/body.html.erb | 19 +++++
.../pipeline_instances/_running_component.html.erb | 25 ++----
.../test/integration/anonymous_access_test.rb | 15 +++-
.../test/integration/application_layout_test.rb | 2 +
docker/arvdock | 3 +-
sdk/python/arvados/commands/arv_copy.py | 97 ++++++++++------------
services/api/script/crunch-dispatch.rb | 10 ++-
8 files changed, 115 insertions(+), 74 deletions(-)
via cd1f6c0fd2f9a91b88659b90a6fd9faee576a557 (commit)
via add9525f2f196e2490a6876fed590d1e139ea659 (commit)
via 407ac18e99051a67d4a615bfe2189d5562334f12 (commit)
via bfb34761f152b5cd5ec7f530aa354f2bd850ac4e (commit)
via 92052dc0b2f80a16420483a756fcebedc6c6ec3c (commit)
via 6520efd1dcf2c83ebe0b896d76167a8a89761931 (commit)
via 3c2372f03566fb3ce53625d3e4783eaac0fc480e (commit)
via 3cc68fc8e599002f0f0cbf8e8d8b814f8c63838d (commit)
via a2fc3a2158c3c154c3d7fc2b55eea928898cafb5 (commit)
via 675a22d7230ccf96b7c2754fc46afe4a84363379 (commit)
via e1880407060f3f5e1bd28c43b35e55c3c6622fc8 (commit)
via 7a282129315671eaf79bf2a752bf1cd0c45f2588 (commit)
via e1c423603291bf014edb6d68bd4f2247c77283a3 (commit)
via 06d9984f71a2235a4fbfb1a4d04e46f51fa47bb3 (commit)
via 2ad69e1ae15237217bf3561a14f57b66c1c5c781 (commit)
via 9108a20c409161bc5a0ed06e2d34918334846acf (commit)
via 55be42bcb7ede4e83fddefe3894828151e504c3e (commit)
from 8ad6b6ec418f83baf6906a1fd99bc1aeb9c110b7 (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 cd1f6c0fd2f9a91b88659b90a6fd9faee576a557
Merge: add9525 407ac18
Author: Radhika Chippada <radhika at curoverse.com>
Date: Tue Apr 7 10:46:55 2015 -0400
Merge branch 'master' into 5365-not-link-unreadables
commit add9525f2f196e2490a6876fed590d1e139ea659
Author: Radhika Chippada <radhika at curoverse.com>
Date: Tue Apr 7 10:46:16 2015 -0400
5365: refactor link to object if readable logic
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index a80290c..147e5a6 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -177,6 +177,24 @@ module ApplicationHelper
end
end
+ def link_to_arvados_object_if_readable(attrvalue, link_text, link_text_if_not_readable, use_friendly_name=false, resource_class=nil)
+ resource_class = resource_class_for_uuid(attrvalue) if !resource_class
+ if !resource_class
+ return link_text_if_not_readable
+ end
+
+ readable = resource_class.find?(attrvalue)
+ if readable
+ if use_friendly_name
+ link_to_if_arvados_object attrvalue, friendly_name: true
+ else
+ link_to_if_arvados_object attrvalue, link_text: link_text
+ end
+ else
+ link_text_if_not_readable
+ end
+ end
+
def render_editable_attribute(object, attr, attrvalue=nil, htmloptions={})
attrvalue = object.send(attr) if attrvalue.nil?
if not object.attribute_editable?(attr)
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 d22b1ee..09d6ab7 100644
--- a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -66,19 +66,9 @@
<%# column offset 8 %>
<div class="col-md-4 text-overflow-ellipsis">
<% if pj[:output_uuid] %>
- <% 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 %>
+ <%= link_to_arvados_object_if_readable(pj[:output_uuid], pj[:output_uuid], 'Output data not available', true) %>
<% elsif current_job[:output] %>
- <% 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 %>
+ <%= link_to_arvados_object_if_readable(current_job[:output], "Output of #{pj[:name]}", 'Output data not available') %>
<% else %>
No output.
<% end %>
@@ -158,12 +148,9 @@
</td>
<td>
<% if k == :uuid %>
- <% if 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 %>
+ <% resource_class = resource_class_for_uuid(current_component[k]) %>
+ <% if resource_class.andand.to_s == 'Job' %>
+ <%= link_to_arvados_object_if_readable(current_component[k], current_component[k], current_component[k], false, resource_class) %>
<% else %>
<%= link_to_if_arvados_object current_component[k], link_text: current_component[k] %>
<% end %>
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index c6ba020..8000e93 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -239,6 +239,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
assert_no_text 'stderr crunchstat' # log line shouldn't be seen
end
end
+ end
test "anonymous user accesses collection in shared project" do
visit "/collections/#{api_fixture('collections')['public_text_file']['uuid']}"
commit 3c2372f03566fb3ce53625d3e4783eaac0fc480e
Merge: 3cc68fc a2fc3a2
Author: Radhika Chippada <radhika at curoverse.com>
Date: Mon Apr 6 19:49:10 2015 -0400
Merge branch 'master' into 5365-not-link-unreadables
Conflicts:
apps/workbench/test/integration/anonymous_access_test.rb
diff --cc apps/workbench/test/integration/anonymous_access_test.rb
index ae347a1,4447bd3..c6ba020
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@@ -180,61 -183,13 +183,70 @@@ class AnonymousAccessTest < ActionDispa
assert_no_selector 'a', text: 'Run this pipeline'
end
+ [
+ ['pipeline_in_publicly_accessible_project', true],
+ ['pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false],
+ ['pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false, 'admin'],
+
+ ['completed_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
+ pipeline_page = true if fixture.include?('pipeline')
+
+ if pipeline_page
+ object = api_fixture('pipeline_instances')[fixture]
+ page = "/pipeline_instances/#{object['uuid']}"
+ else # job
+ object = api_fixture('jobs')[fixture]
+ page = "/jobs/#{object['uuid']}"
+ end
+
+ if user
+ visit page_with_token user, page
+ else
+ visit page
+ end
+
+ # click job link, if in pipeline page
+ click_link 'foo' if pipeline_page
+
+ if objects_readable or user
+ if pipeline_page
+ assert_text 'This pipeline was created from'
+ assert_selector 'a', object['components']['foo']['job']['uuid']
+ end
+ assert_no_text 'Output data not available'
+ assert_selector 'a[href="#Log"]', text: 'Log'
+ assert_no_selector 'a[data-toggle="disabled"]', text: 'Log'
+ else
+ 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']
+ end
+ assert_text 'Output data not available'
+ assert_text object['job']
+ assert_selector 'a[href="#Log"]', text: 'Log'
+ assert_selector 'a[data-toggle="disabled"]', text: 'Log'
+ end
+
+ click_link 'Log'
+ if objects_readable or user
+ assert_no_text 'foo' # should be in Log tab
+ assert_text 'stderr crunchstat' if pipeline_page
+ else
+ assert_text 'foo' # Log tab disabled and hence still in first tab
+ assert_no_text 'stderr crunchstat' # log line shouldn't be seen
+ end
+ end
++
+ test "anonymous user accesses collection in shared project" do
+ visit "/collections/#{api_fixture('collections')['public_text_file']['uuid']}"
+
+ # in collection page
+ assert_text 'Public Projects Unrestricted public data'
+ assert_text 'Hello world'
+ assert_text 'Content address'
+ assert_selector 'a', text: 'Provenance graph'
end
end
commit 3cc68fc8e599002f0f0cbf8e8d8b814f8c63838d
Author: Radhika Chippada <radhika at curoverse.com>
Date: Mon Apr 6 19:43:56 2015 -0400
5365: job link in pipeline instance page
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 90238bf..d22b1ee 100644
--- a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -158,12 +158,14 @@
</td>
<td>
<% if k == :uuid %>
- <% if !current_user and (resource_class_for_uuid(current_component[k]).andand.to_s == 'Job') %>
+ <% if 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 %>
+ <% else %>
+ <%= link_to_if_arvados_object current_component[k], link_text: current_component[k] %>
<% end %>
<% elsif k.to_s.end_with? 'uuid' %>
<%= link_to_if_arvados_object current_component[k], friendly_name: true %>
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index ae7dd1b..ae347a1 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -208,7 +208,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
# click job link, if in pipeline page
click_link 'foo' if pipeline_page
- if objects_readable or (!objects_readable and user)
+ if objects_readable or user
if pipeline_page
assert_text 'This pipeline was created from'
assert_selector 'a', object['components']['foo']['job']['uuid']
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list