[ARVADOS] updated: 16c58b75712ad4332d55e490d20b3946d2e05008

git at public.curoverse.com git at public.curoverse.com
Mon May 5 20:44:31 EDT 2014


Summary of changes:
 .../app/controllers/actions_controller.rb          |    2 +-
 .../app/controllers/application_controller.rb      |   86 ++++++++++----
 .../app/controllers/collections_controller.rb      |   76 +++++++++++-
 .../app/controllers/folders_controller.rb          |    1 -
 apps/workbench/app/models/arvados_api_client.rb    |   16 ++--
 .../app/views/layouts/application.html.erb         |    2 +-
 .../test/functional/collections_controller_test.rb |  130 ++++++++++++++++++++
 apps/workbench/test/integration/folders_test.rb    |    6 +-
 .../api/app/controllers/application_controller.rb  |   67 ----------
 .../controllers/arvados/v1/groups_controller.rb    |   68 ++++++++++
 services/api/app/models/arvados_model.rb           |    2 +-
 services/api/app/models/log.rb                     |    6 +-
 services/keep/src/keep/perms.go                    |  104 ++++++++++++++++
 services/keep/src/keep/perms_test.go               |  104 ++++++++++++++++
 14 files changed, 560 insertions(+), 110 deletions(-)
 create mode 100644 services/keep/src/keep/perms.go
 create mode 100644 services/keep/src/keep/perms_test.go

       via  16c58b75712ad4332d55e490d20b3946d2e05008 (commit)
       via  722e0c17507cc1fd21df7fafa43cc88965c092d8 (commit)
       via  79f70f03efbfca59ea80b344e56aa29ac1e72c47 (commit)
       via  1b1ddccffecf6e3d44aa2e1a632b54601ce282b6 (commit)
       via  aa0e6250280b5ac587b816f92127bae079d62dbc (commit)
       via  db1e389b74e37ecf4915168acdc72ea9ef624d9c (commit)
       via  43bcfeaa2d9953ff03f34c65b95be9e386152362 (commit)
       via  d8de76141cbe9a9af10dfc408b6d656cc727bbe5 (commit)
       via  6b21bd450e8b8ed968a965290e641a75660cd695 (commit)
       via  8dbf8bd4d53c200ca81494556326c03abae74581 (commit)
       via  3398985fa7f0997c225b55efaa97dc000a8234fa (commit)
       via  5ab27a2c4889609669f6b04bd9dfd2e403e43441 (commit)
       via  256142bddd532e2834b4e7f79c3146009e23059e (commit)
       via  c47ada5e06a91a0283bd779d17ad7e6403e1c223 (commit)
       via  77f1f9eb6f2d03b53c0bb4567ef07718b934e8ea (commit)
       via  395b4e72d33c5b4df931c029a45870d354c32312 (commit)
       via  4d1c7f9514163b6e6949dda814bb524eeff586d9 (commit)
       via  8c5b4f6d87cec17f915802e3c5f14695611eba7f (commit)
       via  aeff59bfaf199eec6884ccf3ff60968bec81f581 (commit)
       via  8023ae393e2c9ce115bf67bbcf632798a3d17b87 (commit)
      from  7871e324112f24527031f4100e4131ff2c6ab245 (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 16c58b75712ad4332d55e490d20b3946d2e05008
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon May 5 20:31:45 2014 -0400

    Remove duplicate ERROR_ACTIONS constant from merge.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 0ee26f5..a3576bc 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -1,5 +1,4 @@
 class ApplicationController < ActionController::Base
-  ERROR_ACTIONS = [:render_exception, :render_not_found]
   respond_to :html, :json, :js
   protect_from_forgery
 

commit 722e0c17507cc1fd21df7fafa43cc88965c092d8
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon May 5 20:31:18 2014 -0400

    Ensure edited description really gets saved.

diff --git a/apps/workbench/test/integration/folders_test.rb b/apps/workbench/test/integration/folders_test.rb
index c8753ac..a199808 100644
--- a/apps/workbench/test/integration/folders_test.rb
+++ b/apps/workbench/test/integration/folders_test.rb
@@ -16,8 +16,12 @@ class FoldersTest < ActionDispatch::IntegrationTest
       find('.btn', text: 'Edit description').click
       find('.editable-input textarea').set('I just edited this.')
       find('.editable-submit').click
+      # Wait for editable popup to go away
+      page.assert_no_selector '.editable-submit'
     end
-    #find('.panel', text: 'I just edited this.')
+    visit current_path
+    assert(find('.panel', text: 'I just edited this.'),
+           "Description should stay updated after editing and refreshing page.")
   end
 
   test 'Add a new name, then edit it, without creating a duplicate' do

commit 79f70f03efbfca59ea80b344e56aa29ac1e72c47
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon May 5 20:22:38 2014 -0400

    Use send(symbol) instead of send(string).

diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb
index 87b1448..2dab6dd 100644
--- a/apps/workbench/app/controllers/actions_controller.rb
+++ b/apps/workbench/app/controllers/actions_controller.rb
@@ -13,7 +13,7 @@ class ActionsController < ApplicationController
   def post
     params.keys.collect(&:to_sym).each do |param|
       if @@exposed_actions[param]
-        return self.send(param.to_s)
+        return self.send(param)
       end
     end
     redirect_to :back

commit 1b1ddccffecf6e3d44aa2e1a632b54601ce282b6
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon May 5 20:21:08 2014 -0400

    Change icon for virtual machines nav.

diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index 7582ec7..2b5ec88 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -102,7 +102,7 @@
                 <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
             </a></li>
             <li><a href="/virtual_machines">
-                <i class="fa fa-lg fa-cloud fa-fw"></i> Virtual machines
+                <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
             </a></li>
             <li><a href="/humans">
                 <i class="fa fa-lg fa-male fa-fw"></i> Humans

commit aa0e6250280b5ac587b816f92127bae079d62dbc
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon May 5 20:20:46 2014 -0400

    Remove confusing return value.

diff --git a/apps/workbench/app/controllers/folders_controller.rb b/apps/workbench/app/controllers/folders_controller.rb
index 906ef27..86ee42b 100644
--- a/apps/workbench/app/controllers/folders_controller.rb
+++ b/apps/workbench/app/controllers/folders_controller.rb
@@ -65,7 +65,6 @@ class FoldersController < ApplicationController
         @shared_with_me << folder
       end
     end
-    @object
   end
 
   def show

commit db1e389b74e37ecf4915168acdc72ea9ef624d9c
Merge: 7871e32 43bcfea
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon May 5 18:33:04 2014 -0400

    Merge branch '2640-folder-api' into 1970-folder-view
    
    Conflicts:
    	apps/workbench/app/controllers/application_controller.rb
    	services/api/app/controllers/application_controller.rb

diff --cc apps/workbench/app/controllers/application_controller.rb
index 784c06a,f9de62d..0ee26f5
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@@ -1,14 -1,17 +1,19 @@@
  class ApplicationController < ActionController::Base
 +  ERROR_ACTIONS = [:render_exception, :render_not_found]
    respond_to :html, :json, :js
    protect_from_forgery
+ 
+   ERROR_ACTIONS = [:render_error, :render_not_found]
+ 
    around_filter :thread_clear
-   around_filter :thread_with_mandatory_api_token, :except => [:render_exception, :render_not_found]
+   around_filter(:thread_with_mandatory_api_token,
+                 except: [:index, :show] + ERROR_ACTIONS)
    around_filter :thread_with_optional_api_token
-   before_filter :find_object_by_uuid, :except => [:index] + ERROR_ACTIONS
-   before_filter :check_user_agreements, :except => ERROR_ACTIONS
-   before_filter :check_user_notifications, :except => ERROR_ACTIONS
+   before_filter :check_user_agreements, except: ERROR_ACTIONS
+   before_filter :check_user_notifications, except: ERROR_ACTIONS
+   around_filter :using_reader_tokens, only: [:index, :show]
+   before_filter :find_object_by_uuid, except: [:index] + ERROR_ACTIONS
 +  before_filter :check_my_folders, :except => ERROR_ACTIONS
    theme :select_theme
  
    begin
diff --cc services/api/app/controllers/arvados/v1/groups_controller.rb
index f742fa9,ebf6cf8..49f0b02
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@@ -1,2 -1,70 +1,70 @@@
  class Arvados::V1::GroupsController < ApplicationController
+ 
+   def self._contents_requires_parameters
+     _index_requires_parameters.
+       merge({
+               include_linked: {
+                 type: 'boolean', required: false, default: false
+               },
+             })
+   end
+ 
+   def contents
+     all_objects = []
+     all_available = 0
+ 
+     # Trick apply_where_limit_order_params into applying suitable
+     # per-table values. *_all are the real ones we'll apply to the
+     # aggregate set.
+     limit_all = @limit
+     offset_all = @offset
+     @orders = []
+ 
+     ArvadosModel.descendants.reject(&:abstract_class?).sort_by(&:to_s).
+       each do |klass|
+       case klass.to_s
+         # We might expect klass==Link etc. here, but we would be
+         # disappointed: when Rails reloads model classes, we get two
+         # distinct classes called Link which do not equal each
+         # other. But we can still rely on klass.to_s to be "Link".
 -      when 'ApiClientAuthorization', 'UserAgreement'
++      when 'ApiClientAuthorization', 'UserAgreement', 'Link'
+         # Do not want.
+       else
+         @objects = klass.readable_by(*@read_users)
+         cond_sql = "#{klass.table_name}.owner_uuid = ?"
+         cond_params = [@object.uuid]
+         if params[:include_linked]
+           cond_sql += " OR #{klass.table_name}.uuid IN (SELECT head_uuid FROM links WHERE link_class=#{klass.sanitize 'name'} AND links.tail_uuid=#{klass.sanitize @object.uuid})"
+         end
+         @objects = @objects.where(cond_sql, *cond_params).order("#{klass.table_name}.uuid")
+         @limit = limit_all - all_objects.count
+         apply_where_limit_order_params
+         items_available = @objects.
+           except(:limit).except(:offset).
+           count(:id, distinct: true)
+         all_available += items_available
+         @offset = [@offset - items_available, 0].max
+ 
+         all_objects += @objects.to_a
+       end
+     end
+     @objects = all_objects || []
+     @links = Link.where('link_class=? and tail_uuid=?'\
+                         ' and head_uuid in (?)',
+                         'name',
+                         @object.uuid,
+                         @objects.collect(&:uuid))
+     @object_list = {
+       :kind  => "arvados#objectList",
+       :etag => "",
+       :self_link => "",
+       :links => @links.as_api_response(nil),
+       :offset => offset_all,
+       :limit => limit_all,
+       :items_available => all_available,
+       :items => @objects.as_api_response(nil)
+     }
+     render json: @object_list
+   end
+ 
  end

commit 43bcfeaa2d9953ff03f34c65b95be9e386152362
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon May 5 17:30:11 2014 -0400

    Move contents action to GroupsController.

diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 97b2819..9a54abe 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -77,73 +77,6 @@ class ApplicationController < ActionController::Base
     show
   end
 
-  def self._contents_requires_parameters
-    _index_requires_parameters.
-      merge({
-              include_linked: {
-                type: 'boolean', required: false, default: false
-              },
-            })
-  end
-
-  def contents
-    all_objects = []
-    all_available = 0
-
-    # Trick apply_where_limit_order_params into applying suitable
-    # per-table values. *_all are the real ones we'll apply to the
-    # aggregate set.
-    limit_all = @limit
-    offset_all = @offset
-    @orders = []
-
-    ArvadosModel.descendants.reject(&:abstract_class?).sort_by(&:to_s).
-      each do |klass|
-      case klass.to_s
-        # We might expect klass==Link etc. here, but we would be
-        # disappointed: when Rails reloads model classes, we get two
-        # distinct classes called Link which do not equal each
-        # other. But we can still rely on klass.to_s to be "Link".
-      when 'ApiClientAuthorization', 'UserAgreement'
-        # Do not want.
-      else
-        @objects = klass.readable_by(*@read_users)
-        cond_sql = "#{klass.table_name}.owner_uuid = ?"
-        cond_params = [@object.uuid]
-        if params[:include_linked]
-          cond_sql += " OR #{klass.table_name}.uuid IN (SELECT head_uuid FROM links WHERE link_class=#{klass.sanitize 'name'} AND links.tail_uuid=#{klass.sanitize @object.uuid})"
-        end
-        @objects = @objects.where(cond_sql, *cond_params).order("#{klass.table_name}.uuid")
-        @limit = limit_all - all_objects.count
-        apply_where_limit_order_params
-        items_available = @objects.
-          except(:limit).except(:offset).
-          count(:id, distinct: true)
-        all_available += items_available
-        @offset = [@offset - items_available, 0].max
-
-        all_objects += @objects.to_a
-      end
-    end
-    @objects = all_objects || []
-    @links = Link.where('link_class=? and tail_uuid=?'\
-                        ' and head_uuid in (?)',
-                        'name',
-                        @object.uuid,
-                        @objects.collect(&:uuid))
-    @object_list = {
-      :kind  => "arvados#objectList",
-      :etag => "",
-      :self_link => "",
-      :links => @links.as_api_response(nil),
-      :offset => offset_all,
-      :limit => limit_all,
-      :items_available => all_available,
-      :items => @objects.as_api_response(nil)
-    }
-    render json: @object_list
-  end
-
   def catch_redirect_hint
     if !current_user
       if params.has_key?('redirect_to') then
diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb
index f742fa9..ebf6cf8 100644
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@ -1,2 +1,70 @@
 class Arvados::V1::GroupsController < ApplicationController
+
+  def self._contents_requires_parameters
+    _index_requires_parameters.
+      merge({
+              include_linked: {
+                type: 'boolean', required: false, default: false
+              },
+            })
+  end
+
+  def contents
+    all_objects = []
+    all_available = 0
+
+    # Trick apply_where_limit_order_params into applying suitable
+    # per-table values. *_all are the real ones we'll apply to the
+    # aggregate set.
+    limit_all = @limit
+    offset_all = @offset
+    @orders = []
+
+    ArvadosModel.descendants.reject(&:abstract_class?).sort_by(&:to_s).
+      each do |klass|
+      case klass.to_s
+        # We might expect klass==Link etc. here, but we would be
+        # disappointed: when Rails reloads model classes, we get two
+        # distinct classes called Link which do not equal each
+        # other. But we can still rely on klass.to_s to be "Link".
+      when 'ApiClientAuthorization', 'UserAgreement'
+        # Do not want.
+      else
+        @objects = klass.readable_by(*@read_users)
+        cond_sql = "#{klass.table_name}.owner_uuid = ?"
+        cond_params = [@object.uuid]
+        if params[:include_linked]
+          cond_sql += " OR #{klass.table_name}.uuid IN (SELECT head_uuid FROM links WHERE link_class=#{klass.sanitize 'name'} AND links.tail_uuid=#{klass.sanitize @object.uuid})"
+        end
+        @objects = @objects.where(cond_sql, *cond_params).order("#{klass.table_name}.uuid")
+        @limit = limit_all - all_objects.count
+        apply_where_limit_order_params
+        items_available = @objects.
+          except(:limit).except(:offset).
+          count(:id, distinct: true)
+        all_available += items_available
+        @offset = [@offset - items_available, 0].max
+
+        all_objects += @objects.to_a
+      end
+    end
+    @objects = all_objects || []
+    @links = Link.where('link_class=? and tail_uuid=?'\
+                        ' and head_uuid in (?)',
+                        'name',
+                        @object.uuid,
+                        @objects.collect(&:uuid))
+    @object_list = {
+      :kind  => "arvados#objectList",
+      :etag => "",
+      :self_link => "",
+      :links => @links.as_api_response(nil),
+      :offset => offset_all,
+      :limit => limit_all,
+      :items_available => all_available,
+      :items => @objects.as_api_response(nil)
+    }
+    render json: @object_list
+  end
+
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list