[ARVADOS] updated: 9fa70c844ccc36a8c9543a8fafd2b56388c7a957

git at public.curoverse.com git at public.curoverse.com
Fri Oct 31 09:05:25 EDT 2014


Summary of changes:
 .../workbench/app/assets/javascripts/filterable.js | 51 +++++++++++
 .../app/assets/javascripts/infinite_scroll.js      |  2 +-
 .../app/controllers/application_controller.rb      |  4 +-
 .../app/controllers/projects_controller.rb         | 25 +++++-
 apps/workbench/app/models/pipeline_instance.rb     |  6 +-
 .../app/views/collections/_show_files.html.erb     | 33 +++++++-
 .../pipeline_instances/_running_component.html.erb |  2 +-
 .../projects/_show_jobs_and_pipelines.html.erb     |  1 +
 .../app/views/projects/_show_tab_contents.html.erb |  3 +-
 .../workbench/test/integration/collections_test.rb | 39 +++++++++
 apps/workbench/test/integration/projects_test.rb   |  2 +-
 apps/workbench/test/unit/pipeline_instance_test.rb | 42 ++++++---
 docker/api/Dockerfile                              |  9 +-
 docker/arvdock                                     | 11 ++-
 docker/base/Dockerfile                             | 15 ++--
 docker/compute/Dockerfile                          | 11 ++-
 docker/compute/supervisor.conf                     |  5 ++
 docker/doc/Dockerfile                              |  4 +-
 docker/java-bwa-samtools/Dockerfile                |  4 +-
 docker/passenger/Dockerfile                        | 13 +--
 docker/shell/Dockerfile                            |  7 +-
 docker/slurm/Dockerfile                            |  3 +-
 docker/workbench/Dockerfile                        |  3 +-
 sdk/cli/arvados-cli.gemspec                        |  2 +-
 sdk/cli/bin/crunch-job                             | 99 ++++++++++++++--------
 sdk/ruby/arvados.gemspec                           |  2 +-
 .../controllers/arvados/v1/groups_controller.rb    |  4 +-
 services/api/lib/load_param.rb                     | 14 ++-
 services/api/test/fixtures/collections.yml         |  4 +-
 services/api/test/fixtures/groups.yml              |  4 +-
 services/api/test/fixtures/jobs.yml                | 10 +--
 services/api/test/fixtures/pipeline_instances.yml  |  4 +-
 services/fuse/tests/test_mount.py                  |  2 +
 services/nodemanager/tests/test_computenode.py     |  3 +-
 34 files changed, 332 insertions(+), 111 deletions(-)

       via  9fa70c844ccc36a8c9543a8fafd2b56388c7a957 (commit)
       via  4d195ee9ed6a0d05dbdc31c40b6e899a49cb77ec (commit)
       via  b28531cd8051a2c9ae794ac2d3a2b7140e357407 (commit)
       via  e3e54264e8bc767e1ec773cff4e5bdf4c4934a36 (commit)
       via  c6a03a7abff947dc8242e8be18b4b5e6920a3e4a (commit)
       via  4cbb39443fdd218773b4d192330e5e3632fdaaf7 (commit)
       via  b39e2b4e3f791d0c0afe9682183bd31d8341cea3 (commit)
       via  6dabd04bf356cccdb2a7d366a6edd2146b90519a (commit)
       via  92822dd390f4b3efeb183452b7ddf866c41bda17 (commit)
       via  a95a81202b12a79467018157afe54ed09deb9bda (commit)
       via  c199c0cf4a2fe22ce3e1dd0e6219937588711c50 (commit)
       via  ce6f044cfd55f761ec37112554aeab578b3ab476 (commit)
       via  1bcfc05de27282f239de4124225e27d05a1d149a (commit)
       via  fd0ca9211847806adb2e97c0ae78e9312ef89ca1 (commit)
       via  9b959a512c8cca0df65b2bf36ca4baf8eb7a809b (commit)
       via  da6674e4560229457d45abbb8a8aff9d4e305459 (commit)
       via  51e79a3be745cfd37efc49471ae21a1d54662e7f (commit)
       via  1bcf9398f365411b2a82388dbd2eb1fd1d570fe5 (commit)
       via  1d2cdef7174db30cb926d42e321ccb8957d890f2 (commit)
       via  e2fe6c0e5c1c62a37e03519590c04a5186a2cc9b (commit)
       via  c105f3566ef117227dae65396425618c586d9e10 (commit)
       via  78fc6d80639659e30e4f15562c382c002ed6e1ef (commit)
       via  7d8d1b78a10a7045d7ef2367a45c07b023272548 (commit)
       via  9ee4a125d1796dd7b71ef1b9f255133e5cf0becc (commit)
       via  5560cdf37024ba98bb0367a65bc2176c1577496b (commit)
       via  c19bb2a3554f8bcb17cadd9c133b6fb260e70513 (commit)
       via  1edad4ad7a8c239b36b6f10565ee36cbeab67ddb (commit)
       via  550997435f03118e51571994acc07273907bc6fd (commit)
       via  f549c9f05860abfb394b550c0b2c30a5a7c33283 (commit)
       via  fb2ee4033abfae93e8f9a9af367569e7f4fa3793 (commit)
       via  cbc29982e30fd776c194c47dc584710ff1b340c4 (commit)
       via  e34135f6779f58852558e03b1b95534c11ca07ae (commit)
       via  81bb05b5a18c9501057876bf5b0e1923778dad26 (commit)
       via  f78b6578bc950b72f0ffac516bde9c8fde2416be (commit)
       via  fb1bf9fde205adb90386c81214e667823708a9f1 (commit)
       via  97f3db9cb084efce35ef6a24c25d14308785a49a (commit)
       via  e1020f4ad01b6f583a9d3c2bf6d146cd9e0d9331 (commit)
       via  337a0bdb43f518fbf716ed5ecd66eb5e569b8fdf (commit)
       via  c330d58918b7c631307ec11bd584824bf0da7f47 (commit)
       via  30bdc9b4fd57e2291f2ace690412d1775eb6e6ab (commit)
       via  c79874f462520568509bd8a880b8dacab8036489 (commit)
       via  c0943b24a1deb33ef2d866e722f77bc4e564ead5 (commit)
       via  0f9aaf18f1931984dcb34920515877d74d362841 (commit)
       via  3a47eb915b3865bea6d2e6536c7bc1f4a1afc8b4 (commit)
       via  4e148ec9b5db231b22f8d9bd04527023fdbc23ba (commit)
       via  2c16f4fbf9408bb758a0f54cae4058dccef4c2a5 (commit)
       via  c1efd42bfbb5bc7ff9ac275643ee7a0c4e44012b (commit)
       via  1bde97d8aa4d670c25015284e97281e1af163dda (commit)
       via  f8dab15791a8f19839f9db529a820b41f10440ae (commit)
       via  d501ef45757f78f5c1d2843eccf8016e8978345e (commit)
      from  c10b68e95cd648caade631ca9bdeceba8e707384 (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 9fa70c844ccc36a8c9543a8fafd2b56388c7a957
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date:   Fri Oct 31 14:04:51 2014 +0100

    3618: improve api security for sorting to make sure each column we sort by is for a real table and a real column in the db

diff --git a/services/api/lib/load_param.rb b/services/api/lib/load_param.rb
index fb580f2..8d5a9d2 100644
--- a/services/api/lib/load_param.rb
+++ b/services/api/lib/load_param.rb
@@ -89,11 +89,22 @@ module LoadParam
         order = order.to_s
         attr, direction = order.strip.split " "
         direction ||= 'asc'
+        # The attr can have its table unspecified if it happens to be for the current "model_class" (the first case)
+        # or it can be fully specified with the database tablename (the second case) (e.g. "collections.name").
+        # NB that the security check for the second case table_name will not work if the model
+        # has used set_table_name to use an alternate table name from the Rails standard.
+        # I could not find a perfect way to handle this well, but ActiveRecord::Base.send(:descendants)
+        # would be a place to start if this ever becomes necessary.
         if attr.match /^[a-z][_a-z0-9]+$/ and
             model_class.columns.collect(&:name).index(attr) and
             ['asc','desc'].index direction.downcase
           @orders << "#{table_name}.#{attr} #{direction.downcase}"
-        elsif attr.match /^([a-z][_a-z0-9]+)\.([a-z][_a-z0-9]+)$/
+        elsif attr.match /^([a-z][_a-z0-9]+)\.([a-z][_a-z0-9]+)$/ and
+            ['asc','desc'].index(direction.downcase) and
+            ActiveRecord::Base.connection.tables.include?($1) and
+            $1.classify.constantize.columns.collect(&:name).index($2)
+          # $1 in the above checks references the first match from the regular expression, which is expected to be the database table name
+          # $2 is of course the actual database column name
           @orders << "#{attr} #{direction.downcase}"
         end
       end
@@ -128,5 +139,4 @@ module LoadParam
     @distinct = false if (params[:distinct] == false || params[:distinct] == "false")
   end
 
-
 end

commit 4d195ee9ed6a0d05dbdc31c40b6e899a49cb77ec
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date:   Fri Oct 31 14:04:07 2014 +0100

    3618: make sure something happens if the order param is actually detected as an array

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 3d82b23..27e388b 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -118,7 +118,9 @@ class ApplicationController < ActionController::Base
   def load_filters_and_paging_params
     if params[:order].blank?
       @order = 'created_at desc'
-    elsif !params[:order].is_a? Array
+    elsif params[:order].is_a? Array
+      @order = params[:order]
+    else
       begin
         @order = JSON.load(params[:order])
       rescue

commit b28531cd8051a2c9ae794ac2d3a2b7140e357407
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date:   Fri Oct 31 14:03:25 2014 +0100

    3618: bug fix: was confusing the "desc" meaning a "descending sort" with the "desc" that is the beginning of the column name "description"

diff --git a/apps/workbench/app/assets/javascripts/infinite_scroll.js b/apps/workbench/app/assets/javascripts/infinite_scroll.js
index f07cd09..0472576 100644
--- a/apps/workbench/app/assets/javascripts/infinite_scroll.js
+++ b/apps/workbench/app/assets/javascripts/infinite_scroll.js
@@ -201,7 +201,7 @@ $(document).
                 if( hasHTML5History() && history.state !== undefined && history.state !== null && history.state.order !== undefined && history.state.order[tabId] !== undefined ) {
                     // we will use the list of one or more table columns associated with this header to find the right element
                     // see sortable_columns as it is passed to render_pane in the various tab .erbs (e.g. _show_jobs_and_pipelines.html.erb)
-                    var strippedColumns = history.state.order[tabId].replace(/\s|asc|desc/g,'');
+                    var strippedColumns = history.state.order[tabId].replace(/\s|\basc\b|\bdesc\b/g,'');
                     var sortDirection = history.state.order[tabId].split(" ")[1].replace(/,/,'');
                     $columnHeader = $(this).closest('table').find('[data-sort-order="'+ strippedColumns +'"]');
                     setColumnSort( $(this), $columnHeader, sortDirection );

commit e3e54264e8bc767e1ec773cff4e5bdf4c4934a36
Merge: c10b68e c6a03a7
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date:   Fri Oct 31 13:56:01 2014 +0100

    Merge branch 'master' into 3618-column-ordering
    
    Conflicts (all resolved including fixes):
    	apps/workbench/app/controllers/projects_controller.rb
    	apps/workbench/app/views/projects/_show_jobs_and_pipelines.html.erb
    	apps/workbench/app/views/projects/_show_tab_contents.html.erb
    	services/api/app/controllers/arvados/v1/groups_controller.rb

diff --cc apps/workbench/app/views/projects/_show_jobs_and_pipelines.html.erb
index 230e111,9b3755f..3637ef4
--- a/apps/workbench/app/views/projects/_show_jobs_and_pipelines.html.erb
+++ b/apps/workbench/app/views/projects/_show_jobs_and_pipelines.html.erb
@@@ -1,4 -1,4 +1,5 @@@
  <%= render_pane 'tab_contents', to_string: true, locals: {
 -    limit: 50,
 -    filters: [['uuid', 'is_a', ["arvados#job", "arvados#pipelineInstance"]]]
++        limit: 50,
 +	    filters: [['uuid', 'is_a', ["arvados#job", "arvados#pipelineInstance"]]],
 +	    sortable_columns: { 'name' => 'jobs.script, pipeline_instances.name', 'description' => 'jobs.description, pipeline_instances.description' }
      }.merge(local_assigns) %>
diff --cc apps/workbench/app/views/projects/_show_tab_contents.html.erb
index 622b7c1,1e16f41..1ef7fbd
--- a/apps/workbench/app/views/projects/_show_tab_contents.html.erb
+++ b/apps/workbench/app/views/projects/_show_tab_contents.html.erb
@@@ -1,5 -1,3 +1,4 @@@
- <% order = nil if local_assigns[:order].nil? %>
 +<% sortable_columns = {} if local_assigns[:sortable_columns].nil? %>
  <div class="selection-action-container">
    <div class="row">
      <div class="col-sm-5">
@@@ -77,7 -75,7 +76,7 @@@
        <col width="60%" style="width: 60%;" />
        <col width="40%" style="width: 40%;" />
      </colgroup>
-     <tbody data-infinite-scroller="#<%= tab_pane %>-scroll" data-infinite-content-href="<%= url_for partial: :contents_rows %>" data-infinite-content-params-projecttab="<%= {filters: filters, order: order}.to_json %>" data-infinite-content-params-attr="projecttab">
 -    <tbody data-infinite-scroller="#<%= tab_pane %>-scroll" data-infinite-content-href="<%= url_for partial: :contents_rows %>" data-infinite-content-params-projecttab="<%= local_assigns.to_json %>">
++    <tbody data-infinite-scroller="#<%= tab_pane %>-scroll" data-infinite-content-href="<%= url_for partial: :contents_rows %>" data-infinite-content-params-projecttab="<%= local_assigns.select{|k| [:order, :limit, :filters].include? k }.to_json %>" data-infinite-content-params-attr="projecttab">
      </tbody>
      <thead>
        <tr>
diff --cc services/api/app/controllers/arvados/v1/groups_controller.rb
index be873fb,8f96010..b88f254
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@@ -96,15 -92,7 +96,15 @@@ class Arvados::V1::GroupsController < A
          end
        end
  
 -      @objects = @objects.order("#{klass.table_name}.created_at desc")
 +      # If the currently requested orders specifically match the table_name for the current klass, apply the order
 +      request_order = request_orders && request_orders.find{ |r| r =~ /^#{klass.table_name}\./i }
 +      if request_order
 +        @objects = @objects.order(request_order)
 +      else
-         # default to UUID, ignoring any currently requested ordering because it doesn't apply to this klass
-         @objects = @objects.order("#{klass.table_name}.uuid")
++        # default to created_at desc, ignoring any currently requested ordering because it doesn't apply to this klass
++        @objects = @objects.order("#{klass.table_name}.created_at desc")
 +      end
 +
        @limit = limit_all - all_objects.count
        apply_where_limit_order_params klass
        klass_items_available = @objects.

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list