From: Tom Clegg Date: Wed, 22 Apr 2015 18:28:10 +0000 (-0400) Subject: Merge branch '5416-browse-repo-tree' refs #5416 X-Git-Tag: 1.1.0~1664 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/1765cd327b15151c113890860dd8818c6fc44962?hp=983e7c81e1a185eda8f5c71ab78c4b207116edf3 Merge branch '5416-browse-repo-tree' refs #5416 --- diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile index 91c21f160a..9e0eef8dcb 100644 --- a/apps/workbench/Gemfile +++ b/apps/workbench/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' gem 'rails', '~> 4.1.0' -gem 'arvados', '>= 0.1.20150413172135' +gem 'arvados', '>= 0.1.20150421171838' gem 'sqlite3' diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock index 59d72f453a..df10d71de1 100644 --- a/apps/workbench/Gemfile.lock +++ b/apps/workbench/Gemfile.lock @@ -40,7 +40,7 @@ GEM andand (1.3.3) angularjs-rails (1.3.8) arel (5.0.1.20140414130214) - arvados (0.1.20150413172135) + arvados (0.1.20150421171838) activesupport (>= 3.2.13) andand (~> 1.3, >= 1.3.3) google-api-client (~> 0.6.3, >= 0.6.3) @@ -258,7 +258,7 @@ DEPENDENCIES RedCloth andand angularjs-rails - arvados (>= 0.1.20150413172135) + arvados (>= 0.1.20150421171838) bootstrap-sass (~> 3.1.0) bootstrap-tab-history-rails bootstrap-x-editable-rails diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb index 3302771814..44a1569169 100644 --- a/apps/workbench/app/controllers/projects_controller.rb +++ b/apps/workbench/app/controllers/projects_controller.rb @@ -65,7 +65,7 @@ class ProjectsController < ApplicationController { :name => 'Subprojects', :filters => [%w(uuid is_a arvados#group)] - } if current_user + } pane_list << { :name => 'Other_objects', diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index d1655b9284..d1ee6cba1c 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -165,7 +165,11 @@ module ApplicationHelper if opts[:no_link] or (resource_class == User && !current_user) raw(link_name) else - (link_to raw(link_name), { controller: resource_class.to_s.tableize, action: 'show', id: ((opts[:name_link].andand.uuid) || link_uuid) }, style_opts) + raw(tags) + controller_class = resource_class.to_s.tableize + if controller_class.eql?('groups') and object.andand.group_class.eql?('project') + controller_class = 'projects' + end + (link_to raw(link_name), { controller: controller_class, action: 'show', id: ((opts[:name_link].andand.uuid) || link_uuid) }, style_opts) + raw(tags) end else # just return attrvalue if it is not recognizable as an Arvados object or uuid. diff --git a/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb b/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb index 25f4d75be1..e6314cd158 100644 --- a/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb +++ b/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb @@ -29,7 +29,7 @@ diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb index 1b187e7b05..00ec219605 100644 --- a/apps/workbench/test/integration/anonymous_access_test.rb +++ b/apps/workbench/test/integration/anonymous_access_test.rb @@ -62,8 +62,8 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest assert_selector 'a', text: 'Data collections' assert_selector 'a', text: 'Jobs and pipelines' assert_selector 'a', text: 'Pipeline templates' + assert_selector 'a', text: 'Subprojects' assert_selector 'a', text: 'Advanced' - assert_no_selector 'a', text: 'Subprojects' assert_no_selector 'a', text: 'Other objects' assert_no_selector 'button', text: 'Add data' @@ -183,6 +183,19 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest assert_no_selector 'a', text: 'Run this pipeline' end + test "anonymous user accesses subprojects tab in shared project" do + visit PUBLIC_PROJECT + '#Subprojects' + + assert_text 'Subproject in anonymous accessible project' + + within first('tr[data-kind="arvados#group"]') do + click_link 'Show' + end + + # in subproject + assert_text 'Description for subproject in anonymous accessible project' + end + [ ['pipeline_in_publicly_accessible_project', true], ['pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false], diff --git a/doc/index.html.liquid b/doc/index.html.liquid index cbd5539872..4e951d6360 100644 --- a/doc/index.html.liquid +++ b/doc/index.html.liquid @@ -21,20 +21,25 @@ title: Arvados | Documentation
-
+
+

What is Arvados

Arvados enables you to quickly begin using cloud computing resources in your data science work. It allows you to track your methods and datasets, share them securely, and easily re-run analyses.

-

News: Read our blog updates or look through our recent developer activity. +

News +

Read our blog updates or look through our recent developer activity.

-

Questions? Email the mailing list, or chat with us on IRC: #arvados @ OFTC (you can join in your browser). +

Questions?

+

Email the mailing list, or chat with us on IRC: #arvados @ OFTC (you can join in your browser).

-

Want to contribute? Check out our developer site. We're open source, check out our code on github. +

Want to contribute?

+

Check out our developer site. We're open source, check out our code on github.

-

License: Arvados is under the copyleft GNU AGPL v3, with our SDKs under Apache License 2.0 (so that you can incorporate proprietary toolchains into your pipelines). +

License

+

Arvados is under the copyleft GNU AGPL v3, with our SDKs under Apache License 2.0 (so that you can incorporate proprietary toolchains into your pipelines).

-
+

Quickstart

Try any pipeline from the list of public pipelines. For instance, the Pathomap Pipeline links to these step-by-step instructions for trying Arvados out right in your browser using Curoverse's public Arvados instance. @@ -58,7 +63,7 @@ title: Arvados | Documentation

Want to port your pipeline to Arvados? Check out the step-by-step Port-a-Pipeline guide on the Arvados wiki.

-

Below you can also find more in-depth guides for using Arvados. +

More in-depth guides

diff --git a/doc/install/install-api-server.html.textile.liquid b/doc/install/install-api-server.html.textile.liquid index ef2e474f82..b65fe6975d 100644 --- a/doc/install/install-api-server.html.textile.liquid +++ b/doc/install/install-api-server.html.textile.liquid @@ -77,7 +77,7 @@ h3. secret_token Generate a new secret token for signing cookies: -
~/arvados/services/api$ rake secret
+
~/arvados/services/api$ ruby -e 'puts rand(2**400).to_s(36)'
 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
 
diff --git a/doc/install/install-sso.html.textile.liquid b/doc/install/install-sso.html.textile.liquid index 4f6a9771f1..b0ad8b4253 100644 --- a/doc/install/install-sso.html.textile.liquid +++ b/doc/install/install-sso.html.textile.liquid @@ -28,12 +28,12 @@ Create a secret:
~/sso-devise-omniauth-provider$ cp -i config/initializers/secret_token.rb.example config/initializers/secret_token.rb
-~/sso-devise-omniauth-provider$ rake secret
+~/sso-devise-omniauth-provider$ ruby -e 'puts rand(2**400).to_s(36)'
 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
 
-Edit @config/initializers/secret_token.rb@ to set @config.secret_token@ to the string produced by @rake secret@. +Edit @config/initializers/secret_token.rb@ to set @config.secret_token@ to the string produced by @rand@ above. h3. Configure upstream authentication provider @@ -51,7 +51,7 @@ h3(#client). Create arvados-server client Use @rails console@ to create a @Client@ record that will be used by the Arvados API server. The values of @app_id@ and @app_secret@ correspond to the @APP_ID@ and @APP_SECRET@ that must be set in in "Setting up Omniauth in the API server.":install-api-server.html#omniauth -
~/sso-devise-omniauth-provider$ rake secret
+
~/sso-devise-omniauth-provider$ ruby -e 'puts rand(2**400).to_s(36)'
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 ~/sso-devise-omniauth-provider$ RAILS_ENV=production bundle exec rails console
 :001 > c = Client.new
diff --git a/doc/install/install-workbench-app.html.textile.liquid b/doc/install/install-workbench-app.html.textile.liquid
index 43e6f41873..06e320ee07 100644
--- a/doc/install/install-workbench-app.html.textile.liquid
+++ b/doc/install/install-workbench-app.html.textile.liquid
@@ -83,7 +83,7 @@ h3. secret_token
 This application needs a secret token. Generate a new secret:
 
 
-
~/arvados/apps/workbench$ rake secret
+
~/arvados/apps/workbench$ ruby -e 'puts rand(2**400).to_s(36)'
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
diff --git a/sdk/ruby/lib/arvados/keep.rb b/sdk/ruby/lib/arvados/keep.rb index e4f62083b0..a1f418b2b5 100644 --- a/sdk/ruby/lib/arvados/keep.rb +++ b/sdk/ruby/lib/arvados/keep.rb @@ -165,6 +165,11 @@ module Keep if @files.nil? file_sizes = Hash.new(0) each_file_spec do |streamname, _, filesize, filename| + if filename.include?('/') + parts = filename.rpartition('/') + streamname = streamname + parts[1] + parts[0] # ./dir_parts + filename = parts[2] + end file_sizes[[streamname, filename]] += filesize end @files = file_sizes.each_pair.map do |(streamname, filename), size| diff --git a/sdk/ruby/test/sdk_fixtures.rb b/sdk/ruby/test/sdk_fixtures.rb index 52d7377f80..6bf6a9e613 100644 --- a/sdk/ruby/test/sdk_fixtures.rb +++ b/sdk/ruby/test/sdk_fixtures.rb @@ -54,6 +54,11 @@ module SDKFixtures NONNORMALIZED_MANIFEST = ["./dir2 #{random_block} 0:0:z 0:0:y 0:0:x", "./dir1 #{random_block} 0:0:p 0:0:o 0:0:n\n"].join("\n") + MANIFEST_WITH_DIRS_IN_FILENAMES = + [". #{random_block(10)} 0:3:file1 3:3:dir1/file1 6:3:dir1/dir2/file1\n"].join("") + MULTILEVEL_MANIFEST_WITH_DIRS_IN_FILENAMES = + [". #{random_block(10)} 0:3:file1 3:3:dir1/file1 6:4:dir1/dir2/file1\n", + "./dir1 #{random_block(10)} 0:3:file1 3:7:dir2/file1\n"].join("") ### Non-tree manifests # These manifests follow the spec, but they express a structure that can't diff --git a/sdk/ruby/test/test_keep_manifest.rb b/sdk/ruby/test/test_keep_manifest.rb index f1f1a530ce..70bae3eed1 100644 --- a/sdk/ruby/test/test_keep_manifest.rb +++ b/sdk/ruby/test/test_keep_manifest.rb @@ -208,4 +208,41 @@ class ManifestTest < Minitest::Test assert !file_name.empty?, "empty file_name in #{name} fixture" end end + + def test_collection_with_dirs_in_filenames + manifest = Keep::Manifest.new(MANIFEST_WITH_DIRS_IN_FILENAMES) + + seen = Hash.new { |this, key| this[key] = [] } + + manifest.files.each do |stream, basename, size| + refute(seen[stream].include?(basename), "each_file repeated #{stream}/#{basename}") + assert_equal(3, size, "wrong size for #{stream}/#{basename}") + seen[stream] << basename + end + + assert_equal(%w(. ./dir1 ./dir1/dir2), seen.keys) + + seen.each_pair do |stream, basenames| + assert_equal(%w(file1), basenames.sort, "wrong file list for #{stream}") + end + end + + def test_multilevel_collection_with_dirs_in_filenames + manifest = Keep::Manifest.new(MULTILEVEL_MANIFEST_WITH_DIRS_IN_FILENAMES) + + seen = Hash.new { |this, key| this[key] = [] } + expected_sizes = {'.' => 3, './dir1' => 6, './dir1/dir2' => 11} + + manifest.files.each do |stream, basename, size| + refute(seen[stream].include?(basename), "each_file repeated #{stream}/#{basename}") + assert_equal(expected_sizes[stream], size, "wrong size for #{stream}/#{basename}") + seen[stream] << basename + end + + assert_equal(%w(. ./dir1 ./dir1/dir2), seen.keys) + + seen.each_pair do |stream, basenames| + assert_equal(%w(file1), basenames.sort, "wrong file list for #{stream}") + end + end end diff --git a/services/api/test/fixtures/groups.yml b/services/api/test/fixtures/groups.yml index 7b4f8be6dc..7c3396047f 100644 --- a/services/api/test/fixtures/groups.yml +++ b/services/api/test/fixtures/groups.yml @@ -127,6 +127,14 @@ anonymously_accessible_project: group_class: project description: An anonymously accessible project +subproject_in_anonymous_accessible_project: + uuid: zzzzz-j7d0g-mhtfesvgmkolpyf + owner_uuid: zzzzz-j7d0g-zhxawtyetzwc5f0 + created_at: 2014-04-21 15:37:48 -0400 + name: Subproject in anonymous accessible project + description: Description for subproject in anonymous accessible project + group_class: project + active_user_has_can_manage: uuid: zzzzz-j7d0g-ptt1ou6a9lxrv07 owner_uuid: zzzzz-tpzed-d9tiejq69daie8f