[ARVADOS] updated: b907947d2ce1e2fa44b11ebc1c8a2108bc499d95

git at public.curoverse.com git at public.curoverse.com
Thu Nov 12 11:59:12 EST 2015


Summary of changes:
 .../test/controllers/collections_controller_test.rb        | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

  discards  451932825673c60dbb0a3ac93c42fbbfbb340af5 (commit)
  discards  f36224ae5f8c2e68cabea4aa6aa3b58f7eb58b73 (commit)
       via  b907947d2ce1e2fa44b11ebc1c8a2108bc499d95 (commit)
       via  7efd2bc23c0e72f42a70e6bd968cdae1bf11a366 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (451932825673c60dbb0a3ac93c42fbbfbb340af5)
            \
             N -- N -- N (b907947d2ce1e2fa44b11ebc1c8a2108bc499d95)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 b907947d2ce1e2fa44b11ebc1c8a2108bc499d95
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Nov 11 18:32:50 2015 -0500

    5824: Fix clear-download-dir helper.

diff --git a/apps/workbench/test/helpers/download_helper.rb b/apps/workbench/test/helpers/download_helper.rb
index 21fb4cd..8f387f4 100644
--- a/apps/workbench/test/helpers/download_helper.rb
+++ b/apps/workbench/test/helpers/download_helper.rb
@@ -6,7 +6,7 @@ module DownloadHelper
   end
 
   def clear
-    FileUtils.rm_f path
+    FileUtils.rm_r path
     begin
       Dir.mkdir path
     rescue Errno::EEXIST

commit 7efd2bc23c0e72f42a70e6bd968cdae1bf11a366
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Nov 11 18:32:23 2015 -0500

    5824: Fix path and query escapes.
    
    Paths encode spaces as "%20", not "+".
    
    Rails to_query helper does undesirable things like
    "disposition[]=attachment".

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index 0806a0a..f8b359c 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -1,6 +1,5 @@
 require "arvados/keep"
 require "uri"
-require "cgi"
 
 class CollectionsController < ApplicationController
   include ActionController::Live
@@ -369,9 +368,9 @@ class CollectionsController < ApplicationController
       uri.path += 't=' + opts[:path_token] + '/'
     end
     uri.path += '_/'
-    uri.path += CGI::escape(file)
+    uri.path += URI.escape(file)
 
-    query = CGI::parse(uri.query || '')
+    query = Hash[URI.decode_www_form(uri.query || '')]
     { query_token: 'api_token',
       disposition: 'disposition' }.each do |opt, param|
       if opts.include? opt
@@ -379,7 +378,7 @@ class CollectionsController < ApplicationController
       end
     end
     unless query.empty?
-      uri.query = query.to_query
+      uri.query = URI.encode_www_form(query)
     end
 
     uri.to_s
diff --git a/apps/workbench/test/controllers/collections_controller_test.rb b/apps/workbench/test/controllers/collections_controller_test.rb
index 8c42145..978a513 100644
--- a/apps/workbench/test/controllers/collections_controller_test.rb
+++ b/apps/workbench/test/controllers/collections_controller_test.rb
@@ -534,7 +534,7 @@ class CollectionsControllerTest < ActionController::TestCase
       id = api_fixture('collections')['w_a_z_file'][id_type]
       get :show_file, {uuid: id, file: "w a z"}, session_for(:active)
       assert_response :redirect
-      assert_equal "https://#{id.sub '+', '-'}.example/_/w+a+z?api_token=#{tok}", @response.redirect_url
+      assert_equal "https://#{id.sub '+', '-'}.example/_/w%20a%20z?api_token=#{tok}", @response.redirect_url
     end
 
     test "Redirect to keep_web_url via #{id_type} with reader token" do
@@ -543,7 +543,7 @@ class CollectionsControllerTest < ActionController::TestCase
       id = api_fixture('collections')['w_a_z_file'][id_type]
       get :show_file, {uuid: id, file: "w a z", reader_token: tok}, session_for(:expired)
       assert_response :redirect
-      assert_equal "https://#{id.sub '+', '-'}.example/t=#{tok}/_/w+a+z", @response.redirect_url
+      assert_equal "https://#{id.sub '+', '-'}.example/t=#{tok}/_/w%20a%20z", @response.redirect_url
     end
 
     test "Redirect to keep_web_url via #{id_type} with no token" do
@@ -552,7 +552,7 @@ class CollectionsControllerTest < ActionController::TestCase
       id = api_fixture('collections')['public_text_file'][id_type]
       get :show_file, {uuid: id, file: "Hello World.txt"}
       assert_response :redirect
-      assert_equal "https://#{id.sub '+', '-'}.example/_/Hello+World.txt", @response.redirect_url
+      assert_equal "https://#{id.sub '+', '-'}.example/_/Hello%20World.txt", @response.redirect_url
     end
 
     test "Redirect to keep_web_url via #{id_type} with disposition param" do
@@ -565,7 +565,7 @@ class CollectionsControllerTest < ActionController::TestCase
         disposition: 'attachment',
       }
       assert_response :redirect
-      assert_equal "https://#{id.sub '+', '-'}.example/_/Hello+World.txt?disposition=attachment", @response.redirect_url
+      assert_equal "https://#{id.sub '+', '-'}.example/_/Hello%20World.txt?disposition=attachment", @response.redirect_url
     end
 
     test "Redirect to keep_web_download_url via #{id_type}" do
@@ -575,7 +575,7 @@ class CollectionsControllerTest < ActionController::TestCase
       id = api_fixture('collections')['w_a_z_file'][id_type]
       get :show_file, {uuid: id, file: "w a z"}, session_for(:active)
       assert_response :redirect
-      assert_equal "https://download.example/c=#{id.sub '+', '-'}/_/w+a+z?api_token=#{tok}", @response.redirect_url
+      assert_equal "https://download.example/c=#{id.sub '+', '-'}/_/w%20a%20z?api_token=#{tok}", @response.redirect_url
     end
   end
 
@@ -600,7 +600,7 @@ class CollectionsControllerTest < ActionController::TestCase
         disposition: 'attachment',
       }, session_for(:active)
       assert_response :redirect
-      expect_url = "https://download.example/c=#{id.sub '+', '-'}/_/Hello+world.txt"
+      expect_url = "https://download.example/c=#{id.sub '+', '-'}/_/Hello%20world.txt"
       if not anon
         expect_url += "?api_token=#{tok}"
       end
@@ -623,6 +623,6 @@ class CollectionsControllerTest < ActionController::TestCase
     id = api_fixture('collections')['w_a_z_file']['uuid']
     get :show_file, {uuid: id, file: "w a z"}, session_for(:active)
     assert_response :redirect
-    assert_equal "https://download.example/c=#{id.sub '+', '-'}/_/w+a+z?api_token=#{tok}", @response.redirect_url
+    assert_equal "https://download.example/c=#{id.sub '+', '-'}/_/w%20a%20z?api_token=#{tok}", @response.redirect_url
   end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list