[ARVADOS] updated: 4eb42fd91dc5e50840e0d3db5d5201561602a508

git at public.curoverse.com git at public.curoverse.com
Fri Apr 25 15:36:52 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/users_controller.rb |   29 ++++-
 apps/workbench/app/models/arvados_api_client.rb    |    2 +-
 apps/workbench/app/models/group.rb                 |    4 +
 apps/workbench/app/models/user.rb                  |    5 +
 .../app/views/layouts/application.html.erb         |    1 -
 .../app/views/users/_show_activity.html.erb        |    2 +-
 apps/workbench/app/views/users/activity.html.erb   |   16 +-
 apps/workbench/app/views/users/storage.html.erb    |   66 ++++++++
 apps/workbench/config/routes.rb                    |    1 +
 apps/workbench/test/test_helper.rb                 |   16 ++-
 apps/workbench/test/unit/user_test.rb              |   15 ++-
 doc/api/methods/groups.html.textile.liquid         |   12 ++
 doc/api/methods/users.html.textile.liquid          |   12 ++
 doc/api/schema/Group.html.textile.liquid           |    6 +-
 doc/api/schema/Link.html.textile.liquid            |    8 +-
 .../api/app/controllers/api_clients_controller.rb  |    2 -
 .../api/app/controllers/application_controller.rb  |  150 ++++++++++++-------
 .../api/app/controllers/collections_controller.rb  |    2 -
 .../app/controllers/commit_ancestors_controller.rb |    2 -
 services/api/app/controllers/commits_controller.rb |    2 -
 services/api/app/controllers/nodes_controller.rb   |   30 ----
 .../controllers/pipeline_instances_controller.rb   |    2 -
 services/api/app/controllers/users_controller.rb   |    2 -
 services/api/app/models/group.rb                   |    1 +
 services/api/app/models/pipeline_instance.rb       |  101 ++++++++++++
 services/api/config/application.rb                 |    2 +
 services/api/config/routes.rb                      |  163 ++++++--------------
 .../20140421140924_add_group_class_to_groups.rb    |    6 +
 .../migrate/20140421151940_timestamps_not_null.rb  |   13 ++
 .../20140422011506_pipeline_instance_state.rb      |   87 +++++++++++
 services/api/db/schema.rb                          |   30 ++--
 services/api/lib/assign_uuid.rb                    |   11 +-
 services/api/test/fixtures/groups.yml              |   24 +++
 services/api/test/fixtures/links.yml               |   14 ++
 services/api/test/fixtures/pipeline_instances.yml  |   20 +++
 services/api/test/fixtures/specimens.yml           |   12 ++
 .../api/test/functional/admin_notifier_test.rb     |    7 -
 .../arvados/v1/collections_controller_test.rb      |    6 +-
 .../arvados/v1/groups_controller_test.rb           |  112 ++++++++++++++
 .../arvados/v1/keep_disks_controller_test.rb       |    2 +-
 .../functional/arvados/v1/nodes_controller_test.rb |    4 +-
 .../functional/arvados/v1/users_controller_test.rb |   86 ++++++++++-
 .../functional/commit_ancestors_controller_test.rb |    7 -
 .../api/test/functional/commits_controller_test.rb |    7 -
 services/api/test/functional/user_notifier_test.rb |    7 -
 .../api_client_authorizations_api_test.rb          |    6 +-
 .../api/test/integration/collections_api_test.rb   |   52 ++++++-
 services/api/test/integration/errors_test.rb       |   27 ++++
 services/api/test/integration/jobs_api_test.rb     |    4 +-
 services/api/test/integration/permissions_test.rb  |   12 +-
 services/api/test/integration/valid_links_test.rb  |    2 +-
 services/api/test/test_helper.rb                   |    8 +-
 services/api/test/unit/pipeline_instance_test.rb   |  141 +++++++++++++++++-
 53 files changed, 1042 insertions(+), 319 deletions(-)
 create mode 100644 apps/workbench/app/views/users/storage.html.erb
 delete mode 100644 services/api/app/controllers/api_clients_controller.rb
 delete mode 100644 services/api/app/controllers/collections_controller.rb
 delete mode 100644 services/api/app/controllers/commit_ancestors_controller.rb
 delete mode 100644 services/api/app/controllers/commits_controller.rb
 delete mode 100644 services/api/app/controllers/nodes_controller.rb
 delete mode 100644 services/api/app/controllers/pipeline_instances_controller.rb
 delete mode 100644 services/api/app/controllers/users_controller.rb
 create mode 100644 services/api/db/migrate/20140421140924_add_group_class_to_groups.rb
 create mode 100644 services/api/db/migrate/20140421151940_timestamps_not_null.rb
 create mode 100644 services/api/db/migrate/20140422011506_pipeline_instance_state.rb
 create mode 100644 services/api/test/fixtures/pipeline_instances.yml
 delete mode 100644 services/api/test/functional/admin_notifier_test.rb
 delete mode 100644 services/api/test/functional/commit_ancestors_controller_test.rb
 delete mode 100644 services/api/test/functional/commits_controller_test.rb
 delete mode 100644 services/api/test/functional/user_notifier_test.rb
 create mode 100644 services/api/test/integration/errors_test.rb

       via  4eb42fd91dc5e50840e0d3db5d5201561602a508 (commit)
       via  d61f56590d4c1bc2c965b640698217a5d4af1d8c (commit)
       via  62ce10f18cb083d701471d0fe27e964c85214200 (commit)
       via  f93ebd504f60b3055c254e23ba987ed29e8987b2 (commit)
       via  416374d4bbf381f5689fe2d1c72705d0796e8382 (commit)
       via  f078a2d38f8bfe17732d171895fa23471f8217c1 (commit)
       via  288ea0d2e35bf94d8a9f0bc609bac1467c1c5b9e (commit)
       via  1ba54c139354125459f3a25ad7a2894a02c7d1f4 (commit)
       via  660ebe707d2f7c28648b38ff9be826622fbefd39 (commit)
       via  41863948b43264bbd09358d145177a7fadd864cf (commit)
       via  725b9459d878b11d8d45fa12c99a06b400171574 (commit)
       via  b6a0ff1443bb40b52df7b30fd269aa6f05591b31 (commit)
       via  4aef6531076e8c9d00252050d0757b32a22519c1 (commit)
       via  73e28547278ddff84847c12ad7f926e717ae553a (commit)
       via  6f918d1fc451f1ad72350677155a0d67f40a9628 (commit)
       via  2ed4ec45553b9931f78ca88b694f590102ed2bbd (commit)
       via  ca0d33c522fad9b3467f4a58b8fe336665ed493b (commit)
       via  c0aeec88f6507f441796d25ad2dfb49c78185731 (commit)
       via  d6399c117f03f45e83648dca6e23dd7174793253 (commit)
       via  8905037aede017ccdb66dd2850bfbd2284904e4e (commit)
       via  17e1d2d431280a8911ecd1f028de1924a7dc3aed (commit)
       via  22db59393203f550e0c77e65c650e664667492ab (commit)
       via  6a0ce3e88fc2122fe7749b6e4bc3eb01fb37b97c (commit)
       via  a955d5a89402d4b68ccec2d00c1ecf7d86334875 (commit)
       via  7f7cd27d5fc31dc5bbec7f95905fd394a5b317c7 (commit)
       via  8a0051a6fdd00f83e566cc87b88d2ac23ad5487d (commit)
       via  0e7a1577b51111a9d503f21d40582da62c2dd7b9 (commit)
       via  8072742e6557966b3e3d699e18fd3ee8656ed5b7 (commit)
       via  007a1e6edf9125990e286c71b00f51405470a4a6 (commit)
       via  c92d3fcdc2ab6bc3ec9bb03567de9203ff9b1f79 (commit)
       via  5cb205c567c312345376bcd2b7104075b5710d7f (commit)
       via  7fc48a11da8740deb01b0063faa2ceb687709205 (commit)
       via  694e4fdd124150f1b0a237ce6a698f3d00d92eb9 (commit)
       via  a3c5fac3f7849cab38bedd313b522b994be17b15 (commit)
       via  7efcc87e3cba4f03429751f9f3d109cc88e6926c (commit)
       via  75fa6afdd3f0f85d48e7a95372dd8cf094811221 (commit)
       via  d2d9ff48a6c111293340ac351f94428e5204366f (commit)
       via  d325f035a861d1421f6e2fe0d2f01e9f3e93d749 (commit)
       via  61f4536217e0beeafab54a8b66d40f859fdd1306 (commit)
       via  04e99ad773e4a47dabc7f0e1b624f67a00ff00b9 (commit)
       via  6f6c9a2c6e7b871ad9ee592f45ebfdb7f5f26ee1 (commit)
       via  deed6e331c70c4410b161f260e2b93fa71b39d50 (commit)
       via  44480d99e71e1868f61024035d7d58acd69eac50 (commit)
       via  448cff33fc343a54caa1a33f4a536d88e3e4eaa1 (commit)
       via  5588c452453499d0aa130abe6421df5e85cf5703 (commit)
      from  7c12fc4d989dd2b4c47a174280a4f9526ecb0798 (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 4eb42fd91dc5e50840e0d3db5d5201561602a508
Merge: 7c12fc4 d61f565
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Apr 25 11:25:03 2014 -0400

    Merge remote-tracking branch 'origin/master' into origin-2608-websocket-event-bus-alt2
    
    Conflicts:
    	services/api/app/controllers/application_controller.rb
    	services/api/db/schema.rb
    	services/api/test/test_helper.rb

diff --cc services/api/app/controllers/application_controller.rb
index 663baa8,6339125..5dd5b52
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@@ -108,12 -176,136 +180,17 @@@ class ApplicationController < ActionCon
  
    protected
  
 -  def load_where_param
 -    if params[:where].nil? or params[:where] == ""
 -      @where = {}
 -    elsif params[:where].is_a? Hash
 -      @where = params[:where]
 -    elsif params[:where].is_a? String
 -      begin
 -        @where = Oj.load(params[:where])
 -        raise unless @where.is_a? Hash
 -      rescue
 -        raise ArgumentError.new("Could not parse \"where\" param as an object")
 -      end
 -    end
 -    @where = @where.with_indifferent_access
 -  end
 -
 -  def load_filters_param
 -    @filters ||= []
 -    if params[:filters].is_a? Array
 -      @filters += params[:filters]
 -    elsif params[:filters].is_a? String and !params[:filters].empty?
 -      begin
 -        f = Oj.load params[:filters]
 -        raise unless f.is_a? Array
 -        @filters += f
 -      rescue
 -        raise ArgumentError.new("Could not parse \"filters\" param as an array")
 -      end
 -    end
 -  end
 -
 -  def load_limit_offset_order_params
 -    if params[:limit]
 -      unless params[:limit].to_s.match(/^\d+$/)
 -        raise ArgumentError.new("Invalid value for limit parameter")
 -      end
 -      @limit = params[:limit].to_i
 -    else
 -      @limit = DEFAULT_LIMIT
 -    end
 -
 -    if params[:offset]
 -      unless params[:offset].to_s.match(/^\d+$/)
 -        raise ArgumentError.new("Invalid value for offset parameter")
 -      end
 -      @offset = params[:offset].to_i
 -    else
 -      @offset = 0
 -    end
 -
 -    @orders = []
 -    if params[:order]
 -      params[:order].split(',').each do |order|
 -        attr, direction = order.strip.split " "
 -        direction ||= 'asc'
 -        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}"
 -        end
 -      end
 -    end
 -    if @orders.empty?
 -      @orders << "#{table_name}.modified_at desc"
 -    end
 -  end
 -
+   def find_objects_for_index
+     @objects ||= model_class.readable_by(current_user)
+     apply_where_limit_order_params
+   end
+ 
    def apply_where_limit_order_params
 -    ar_table_name = @objects.table_name
 -    if @filters.is_a? Array and @filters.any?
 -      cond_out = []
 -      param_out = []
 -      @filters.each do |filter|
 -        attr, operator, operand = filter
 -        if !filter.is_a? Array
 -          raise ArgumentError.new("Invalid element in filters array: #{filter.inspect} is not an array")
 -        elsif !operator.is_a? String
 -          raise ArgumentError.new("Invalid operator '#{operator}' (#{operator.class}) in filter")
 -        elsif !model_class.searchable_columns(operator).index attr.to_s
 -          raise ArgumentError.new("Invalid attribute '#{attr}' in filter")
 -        end
 -        case operator.downcase
 -        when '=', '<', '<=', '>', '>=', 'like'
 -          if operand.is_a? String
 -            cond_out << "#{ar_table_name}.#{attr} #{operator} ?"
 -            if (# any operator that operates on value rather than
 -                # representation:
 -                operator.match(/[<=>]/) and
 -                model_class.attribute_column(attr).type == :datetime)
 -              operand = Time.parse operand
 -            end
 -            param_out << operand
 -          elsif operand.nil? and operator == '='
 -            cond_out << "#{ar_table_name}.#{attr} is null"
 -          else
 -            raise ArgumentError.new("Invalid operand type '#{operand.class}' "\
 -                                    "for '#{operator}' operator in filters")
 -          end
 -        when 'in'
 -          if operand.is_a? Array
 -            cond_out << "#{ar_table_name}.#{attr} IN (?)"
 -            param_out << operand
 -          else
 -            raise ArgumentError.new("Invalid operand type '#{operand.class}' "\
 -                                    "for '#{operator}' operator in filters")
 -          end
 -        when 'is_a'
 -          operand = [operand] unless operand.is_a? Array
 -          cond = []
 -          operand.each do |op|
 -              cl = ArvadosModel::kind_class op
 -              if cl
 -                cond << "#{ar_table_name}.#{attr} like ?"
 -                param_out << cl.uuid_like_pattern
 -              else
 -                cond << "1=0"
 -              end
 -          end
 -          cond_out << cond.join(' OR ')
 -        end
 -      end
 -      if cond_out.any?
 -        @objects = @objects.where(cond_out.join(' AND '), *param_out)
 -      end
 +    ft = record_filters @filters
 +    if ft[:cond_out].any?
 +      @objects = @objects.where(ft[:cond_out].join(' AND '), *ft[:param_out])
      end
 +
      if @where.is_a? Hash and @where.any?
        conditions = ['1=1']
        @where.each do |attr,value|
diff --cc services/api/test/test_helper.rb
index fea983b,286cf66..70988ad
--- a/services/api/test/test_helper.rb
+++ b/services/api/test/test_helper.rb
@@@ -21,8 -21,12 +21,12 @@@ class ActiveSupport::TestCas
      self.request.headers["Accept"] = "text/json"
    end
  
+   def json_response
+     @json_response ||= ActiveSupport::JSON.decode @response.body
+   end
+ 
    def authorize_with(api_client_auth_name)
 -    self.request.env['HTTP_AUTHORIZATION'] = "OAuth2 #{api_client_authorizations(api_client_auth_name).api_token}"
 +    ArvadosApiToken.new.call ({"rack.input" => "", "HTTP_AUTHORIZATION" => "OAuth2 #{api_client_authorizations(api_client_auth_name).api_token}"})
    end
  
    # Add more helper methods to be used by all tests here...

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list