[ARVADOS] created: 1.1.4-242-gd6e3399
Git user
git at public.curoverse.com
Mon May 14 10:19:57 EDT 2018
at d6e33993b181510069bf285c159acb8094e9edf8 (commit)
commit d6e33993b181510069bf285c159acb8094e9edf8
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Mon May 14 11:17:35 2018 -0300
12737: Upgrade workbench from rails 4.1 to 4.2 (WIP)
Serialization isn't working properly, Hash & Array columns happily receive
these types but return their text versions when accessed.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/apps/workbench/.gitignore b/apps/workbench/.gitignore
index 5fb3718..156fc86 100644
--- a/apps/workbench/.gitignore
+++ b/apps/workbench/.gitignore
@@ -5,6 +5,7 @@
/log/*.log
/log/*.log.gz
/tmp
+.byebug_history
/config/.secret_token
/config/initializers/secret_token.rb
diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index 1e9a5cc..b62df6c 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -4,9 +4,7 @@
source 'https://rubygems.org'
-# Having a dependency '~> 4.1' make rails 4.2.10 to be installed when it's
-# supposed to avoid that.
-gem 'rails', '< 4.2'
+gem 'rails', '~> 4.2.0'
gem 'arvados', '>= 0.1.20150511150219'
gem 'activerecord-nulldb-adapter'
@@ -14,6 +12,7 @@ gem 'multi_json'
gem 'oj'
gem 'sass'
gem 'mime-types'
+gem 'responders', '~> 2.0'
# Note: keeping this out of the "group :assets" section "may" allow us
# to use Coffescript for UJS responses. It also prevents a
@@ -37,6 +36,7 @@ group :development do
gem 'ruby-debug-passenger'
gem 'rack-mini-profiler', require: false
gem 'flamegraph', require: false
+ #gem 'web-console', '~> 2.0'
end
group :test, :diagnostics, :performance do
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 93a92ce..8868a2b 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -9,39 +9,47 @@ GEM
remote: https://rubygems.org/
specs:
RedCloth (4.3.2)
- actionmailer (4.1.16)
- actionpack (= 4.1.16)
- actionview (= 4.1.16)
+ actionmailer (4.2.10)
+ actionpack (= 4.2.10)
+ actionview (= 4.2.10)
+ activejob (= 4.2.10)
mail (~> 2.5, >= 2.5.4)
- actionpack (4.1.16)
- actionview (= 4.1.16)
- activesupport (= 4.1.16)
- rack (~> 1.5.2)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ actionpack (4.2.10)
+ actionview (= 4.2.10)
+ activesupport (= 4.2.10)
+ rack (~> 1.6)
rack-test (~> 0.6.2)
- actionview (4.1.16)
- activesupport (= 4.1.16)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
+ actionview (4.2.10)
+ activesupport (= 4.2.10)
builder (~> 3.1)
erubis (~> 2.7.0)
- activemodel (4.1.16)
- activesupport (= 4.1.16)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
+ activejob (4.2.10)
+ activesupport (= 4.2.10)
+ globalid (>= 0.3.0)
+ activemodel (4.2.10)
+ activesupport (= 4.2.10)
builder (~> 3.1)
- activerecord (4.1.16)
- activemodel (= 4.1.16)
- activesupport (= 4.1.16)
- arel (~> 5.0.0)
+ activerecord (4.2.10)
+ activemodel (= 4.2.10)
+ activesupport (= 4.2.10)
+ arel (~> 6.0)
activerecord-nulldb-adapter (0.3.8)
activerecord (>= 2.0.0)
- activesupport (4.1.16)
- i18n (~> 0.6, >= 0.6.9)
- json (~> 1.7, >= 1.7.7)
+ activesupport (4.2.10)
+ i18n (~> 0.7)
minitest (~> 5.1)
- thread_safe (~> 0.1)
+ thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
andand (1.3.3)
angularjs-rails (1.3.15)
- arel (5.0.1.20140414130214)
+ arel (6.0.4)
arvados (0.1.20180302192246)
activesupport (>= 3)
andand (~> 1.3, >= 1.3.3)
@@ -85,6 +93,7 @@ GEM
coffee-script-source (1.12.2)
commonjs (0.2.7)
concurrent-ruby (1.0.5)
+ crass (1.0.4)
deep_merge (1.2.1)
docile (1.1.5)
erubis (2.7.0)
@@ -94,6 +103,8 @@ GEM
multipart-post (>= 1.2, < 3)
ffi (1.9.23)
flamegraph (0.9.5)
+ globalid (0.4.1)
+ activesupport (>= 4.2.0)
google-api-client (0.8.7)
activesupport (>= 3.2, < 5.0)
addressable (~> 2.3)
@@ -122,7 +133,7 @@ GEM
jquery-rails (3.1.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
- json (1.8.6)
+ json (2.1.0)
jwt (1.5.6)
launchy (2.4.3)
addressable (~> 2.3)
@@ -145,6 +156,9 @@ GEM
railties (>= 4)
request_store (~> 1.0)
logstash-event (1.2.02)
+ loofah (2.2.2)
+ crass (~> 1.0.2)
+ nokogiri (>= 1.5.9)
mail (2.7.0)
mini_mime (>= 0.1.1)
memoist (0.16.0)
@@ -187,28 +201,37 @@ GEM
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
public_suffix (3.0.2)
- rack (1.5.5)
+ rack (1.6.10)
rack-mini-profiler (0.10.7)
rack (>= 1.2.0)
rack-test (0.6.3)
rack (>= 1.0)
- rails (4.1.16)
- actionmailer (= 4.1.16)
- actionpack (= 4.1.16)
- actionview (= 4.1.16)
- activemodel (= 4.1.16)
- activerecord (= 4.1.16)
- activesupport (= 4.1.16)
+ rails (4.2.10)
+ actionmailer (= 4.2.10)
+ actionpack (= 4.2.10)
+ actionview (= 4.2.10)
+ activejob (= 4.2.10)
+ activemodel (= 4.2.10)
+ activerecord (= 4.2.10)
+ activesupport (= 4.2.10)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.1.16)
- sprockets-rails (~> 2.0)
+ railties (= 4.2.10)
+ sprockets-rails
+ rails-deprecated_sanitizer (1.0.3)
+ activesupport (>= 4.2.0.alpha)
+ rails-dom-testing (1.0.9)
+ activesupport (>= 4.2.0, < 5.0)
+ nokogiri (~> 1.6)
+ rails-deprecated_sanitizer (>= 1.0.1)
+ rails-html-sanitizer (1.0.4)
+ loofah (~> 2.2, >= 2.2.2)
rails-perftest (0.0.7)
- railties (4.1.16)
- actionpack (= 4.1.16)
- activesupport (= 4.1.16)
+ railties (4.2.10)
+ actionpack (= 4.2.10)
+ activesupport (= 4.2.10)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
- rake (12.3.0)
+ rake (12.3.1)
raphael-rails (2.1.2)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
@@ -216,6 +239,9 @@ GEM
ref (2.0.0)
request_store (1.4.0)
rack (>= 1.4)
+ responders (2.4.0)
+ actionpack (>= 4.2.0, < 5.3)
+ railties (>= 4.2.0, < 5.3)
retriable (1.4.1)
ruby-debug-passenger (0.2.0)
ruby-prof (0.17.0)
@@ -253,10 +279,10 @@ GEM
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
- sprockets-rails (2.3.3)
- actionpack (>= 3.0)
- activesupport (>= 3.0)
- sprockets (>= 2.8, < 4.0)
+ sprockets-rails (3.2.1)
+ actionpack (>= 4.0)
+ activesupport (>= 4.0)
+ sprockets (>= 3.0.0)
sshkey (1.9.0)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
@@ -312,9 +338,10 @@ DEPENDENCIES
piwik_analytics
poltergeist (~> 1.5.1)
rack-mini-profiler
- rails (< 4.2)
+ rails (~> 4.2.0)
rails-perftest
raphael-rails
+ responders (~> 2.0)
ruby-debug-passenger
ruby-prof
rvm-capistrano
diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index 8e1cfae..52bb889 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -62,10 +62,10 @@ class ArvadosBase < ActiveRecord::Base
def self.columns
return @columns if @columns.andand.any?
- @columns = []
+ columns = []
@attribute_info ||= {}
schema = arvados_api_client.discovery[:schemas][self.to_s.to_sym]
- return @columns if schema.nil?
+ return columns if schema.nil?
schema[:properties].each do |k, coldef|
case k
when :etag, :kind
@@ -73,10 +73,10 @@ class ArvadosBase < ActiveRecord::Base
else
if coldef[:type] == coldef[:type].downcase
# boolean, integer, etc.
- @columns << column(k, coldef[:type].to_sym)
+ columns << column(k, coldef[:type].to_sym)
else
# Hash, Array
- @columns << column(k, :text)
+ columns << column(k, :text, default)
serialize k, coldef[:type].constantize
end
define_method k do
@@ -90,11 +90,16 @@ class ArvadosBase < ActiveRecord::Base
@attribute_info[k] = coldef
end
end
- @columns
+ @columns = columns
end
def self.column(name, sql_type = nil, default = nil, null = true)
- ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
+ if sql_type == :datetime
+ cast_type = "ActiveRecord::Type::DateTime".constantize.new
+ else
+ cast_type = "ActiveRecord::Type::#{sql_type.to_s.camelize}".constantize.new
+ end
+ ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, cast_type, sql_type.to_s, null)
end
def self.attribute_info
diff --git a/apps/workbench/config/environments/production.rb.example b/apps/workbench/config/environments/production.rb.example
index cc88886..8b656c5 100644
--- a/apps/workbench/config/environments/production.rb.example
+++ b/apps/workbench/config/environments/production.rb.example
@@ -13,7 +13,7 @@ ArvadosWorkbench::Application.configure do
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
- config.serve_static_assets = false
+ config.serve_static_files = false
# Compress JavaScripts and CSS
config.assets.js_compressor = :uglifier
diff --git a/apps/workbench/config/environments/test.rb.example b/apps/workbench/config/environments/test.rb.example
index 1c79020..0ea8af6 100644
--- a/apps/workbench/config/environments/test.rb.example
+++ b/apps/workbench/config/environments/test.rb.example
@@ -12,7 +12,7 @@ ArvadosWorkbench::Application.configure do
config.cache_classes = true
# Configure static asset server for tests with Cache-Control for performance
- config.serve_static_assets = true
+ config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list