From d06c1fa665c1b9d2788ae187a6b314633a90a575 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 14 Jan 2021 23:44:09 +0000 Subject: [PATCH 1/5] Update Gemfile_next.lock --- Gemfile_next.lock | 61 ++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/Gemfile_next.lock b/Gemfile_next.lock index 71c94db901..290d607b46 100644 --- a/Gemfile_next.lock +++ b/Gemfile_next.lock @@ -4,14 +4,6 @@ GIT specs: custom_error_message (1.1.1) -GIT - remote: https://github.com/openfoodfoundation/better_spree_paypal_express.git - revision: 1a477e9f7763297944cc99b6f4dd3d962aa963e9 - branch: 2-1-0-stable - specs: - spree_paypal_express (2.0.3) - paypal-sdk-merchant (= 1.106.1) - GIT remote: https://github.com/openfoodfoundation/ofn-qz.git revision: 467f6ea1c44529c7c91cac4c8211bbd863588c0b @@ -130,7 +122,7 @@ GEM concurrent-ruby (~> 1.0) builder (3.2.4) byebug (11.0.1) - cancan (1.6.10) + cancancan (1.7.1) capybara (3.15.0) addressable mini_mime (>= 0.1.3) @@ -205,11 +197,11 @@ GEM erubis (2.7.0) eventmachine (1.2.7) execjs (2.7.0) - factory_bot (4.10.0) - activesupport (>= 3.0.0) - factory_bot_rails (4.10.0) - factory_bot (~> 4.10.0) - railties (>= 3.0.0) + factory_bot (5.2.0) + activesupport (>= 4.2.0) + factory_bot_rails (5.2.0) + factory_bot (~> 5.2.0) + railties (>= 4.2.0) faraday (1.0.1) multipart-post (>= 1.2, < 3) ffaker (2.11.0) @@ -222,7 +214,7 @@ GEM foundation-rails (5.5.2.1) railties (>= 3.1.0) sass (>= 3.3.0, < 3.5) - fuubar (2.5.0) + fuubar (2.5.1) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) geocoder (1.6.4) @@ -291,7 +283,10 @@ GEM mini_racer (0.2.15) libv8 (> 7.3) minitest (5.14.2) - money (3.1.5) + monetize (1.9.4) + money (~> 6.12) + money (6.13.8) + i18n (>= 0.6.4, <= 2) msgpack (1.3.3) multi_json (1.15.0) multi_xml (0.6.0) @@ -307,10 +302,9 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - oj (3.10.8) orm_adapter (0.5.0) - paper_trail (7.1.3) - activerecord (>= 4.0, < 5.2) + paper_trail (10.3.1) + activerecord (>= 4.2) request_store (~> 1.1) paperclip (3.4.2) activemodel (>= 3.0.0) @@ -335,6 +329,9 @@ GEM pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) + pry-byebug (3.9.0) + byebug (~> 11.0) + pry (~> 0.13.0) public_suffix (4.0.6) rack (2.2.3) rack-mini-profiler (2.0.2) @@ -566,9 +563,9 @@ DEPENDENCIES awesome_print aws-sdk (= 1.67.0) bugsnag - byebug (~> 11.0.0) - cancan (~> 1.6.10) - capybara (= 3.15) + byebug + cancancan (~> 1.7.0) + capybara catalog! coffee-rails (~> 4.2.2) combine_pdf @@ -586,12 +583,12 @@ DEPENDENCIES devise-token_authenticatable dfc_provider! eventmachine (>= 1.2.3) - factory_bot_rails (= 4.10.0) + factory_bot_rails (= 5.2.0) ffaker figaro foundation-icons-sass-rails foundation-rails (= 5.5.2.1) - fuubar (~> 2.5.0) + fuubar (~> 2.5.1) geocoder gmaps4rails haml @@ -605,20 +602,21 @@ DEPENDENCIES json json_spec (~> 1.1.4) jwt (~> 2.2) - kaminari (= 1.2.1) + kaminari (~> 1.2.1) knapsack letter_opener (>= 1.4.1) mini_racer (= 0.2.15) - money (< 6.1.0) + monetize (~> 1.1) oauth2 (~> 1.4.4) ofn-qz! - oj order_management! - paper_trail (~> 7.1.3) + paper_trail (~> 10.3.1) paperclip (~> 3.4.1) - paranoia (~> 2.0) + paranoia (~> 2.4) + paypal-sdk-merchant (= 1.106.1) pg (~> 0.21.0) - pry (>= 0.12.0) + pry + pry-byebug rack-mini-profiler (< 3.0.0) rack-rewrite rack-ssl @@ -641,7 +639,6 @@ DEPENDENCIES selenium-webdriver shoulda-matchers simplecov - spree_paypal_express! spring spring-commands-rspec state_machines-activerecord @@ -662,7 +659,7 @@ DEPENDENCIES wkhtmltopdf-binary RUBY VERSION - ruby 2.3.7p456 + ruby 2.4.4p296 BUNDLED WITH 1.17.3 From 02a1116fffb1a7513e39e56ad5ad5adae40e4d5a Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 14 Jan 2021 23:45:05 +0000 Subject: [PATCH 2/5] Remove cache intrumentation It doesnt work in rails 5 and apparently it was introduced to debug already deleted products cache in staging See this commit that introduced it https://github.com/openfoodfoundation/openfoodnetwork/commit/10a79d5a65f8d00808a5465d805b2c51900411a5 --- config/initializers/cache_store.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/initializers/cache_store.rb b/config/initializers/cache_store.rb index 009ebbaab6..a67a4dd6f2 100644 --- a/config/initializers/cache_store.rb +++ b/config/initializers/cache_store.rb @@ -1,7 +1,4 @@ unless Rails.env.production? - # Enable cache instrumentation, which is disabled by default - ActiveSupport::Cache::Store.instrument = true - # Log message in the same default logger ActiveSupport::Cache::Store.logger = Rails.logger end From 874da929d35713e20a01c999518a391bbd3ae729 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 15 Jan 2021 00:21:28 +0000 Subject: [PATCH 3/5] Disable db2fog in rails 5, it doesnt work, we need to find an alternative for rails 5 --- config/initializers/db2fog.rb | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/config/initializers/db2fog.rb b/config/initializers/db2fog.rb index ba5b9c7e1d..5da84a30e4 100644 --- a/config/initializers/db2fog.rb +++ b/config/initializers/db2fog.rb @@ -1,15 +1,17 @@ -require_relative 'spree' +unless ENV['DEPENDENCIES_NEXT'] + require_relative 'spree' -# See: https://github.com/itbeaver/db2fog -DB2Fog.config = { - :aws_access_key_id => Spree::Config[:s3_access_key], - :aws_secret_access_key => Spree::Config[:s3_secret], - :directory => ENV['S3_BACKUPS_BUCKET'], - :provider => 'AWS' -} + # See: https://github.com/itbeaver/db2fog + DB2Fog.config = { + :aws_access_key_id => Spree::Config[:s3_access_key], + :aws_secret_access_key => Spree::Config[:s3_secret], + :directory => ENV['S3_BACKUPS_BUCKET'], + :provider => 'AWS' + } -region = ENV['S3_BACKUPS_REGION'] || ENV['S3_REGION'] + region = ENV['S3_BACKUPS_REGION'] || ENV['S3_REGION'] -# If no region is defined we leave this config key undefined (instead of nil), -# so that db2fog correctly applies it's default -DB2Fog.config[:region] = region if region + # If no region is defined we leave this config key undefined (instead of nil), + # so that db2fog correctly applies it's default + DB2Fog.config[:region] = region if region +end From bc2d966e5fd7b696ba5f2cf2a1242adfd9d12042 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 15 Jan 2021 00:22:20 +0000 Subject: [PATCH 4/5] Remove commented code --- config/initializers/js_template_helpers.rb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/config/initializers/js_template_helpers.rb b/config/initializers/js_template_helpers.rb index 27fffc9655..0a00436004 100644 --- a/config/initializers/js_template_helpers.rb +++ b/config/initializers/js_template_helpers.rb @@ -2,12 +2,5 @@ # https://github.com/pitr/angular-rails-templates/issues/45#issuecomment-43229086 Rails.application.assets.context_class.class_eval do - # include ApplicationHelper - # include ActionView::Helpers - # include Rails.application.routes.url_helpers - - # Including all of the helpers (above) has caused some intermittent CSS include issues - # (not finding mixins from an @include in sass). Therefore, we're only including the - # bare minimum here. include ActionView::Helpers::TranslationHelper end From 209e2f20c5bbc5ec71d8ca297da3e3249cd45331 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 15 Jan 2021 00:23:37 +0000 Subject: [PATCH 5/5] Add rails 5 version for js template helpers --- config/initializers/js_template_helpers.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/initializers/js_template_helpers.rb b/config/initializers/js_template_helpers.rb index 0a00436004..7ff1e9a0b0 100644 --- a/config/initializers/js_template_helpers.rb +++ b/config/initializers/js_template_helpers.rb @@ -1,6 +1,14 @@ # Make helpers (#t in particular) available to javascript templates # https://github.com/pitr/angular-rails-templates/issues/45#issuecomment-43229086 -Rails.application.assets.context_class.class_eval do - include ActionView::Helpers::TranslationHelper +if ENV['DEPENDENCIES_NEXT'] + Rails.application.config.assets.configure do |env| + env.context_class.class_eval do + include ActionView::Helpers::TranslationHelper + end + end +else + Rails.application.assets.context_class.class_eval do + include ActionView::Helpers::TranslationHelper + end end