Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies to use Rails 7.1 as the current Rails version #311

Merged
merged 12 commits into from
Oct 11, 2023

Conversation

etagwerker
Copy link
Member

Jira Ticket

ROAD-556

Motivation / Context

We want to use the latest Rails version

QA / Testing Instructions

Application should just work as expected with Rails 7.1


I will abide by the code of conduct.

@etagwerker etagwerker requested a review from arielj October 9, 2023 17:22
spec/controllers/reports_controller_spec.rb Show resolved Hide resolved
Gemfile.lock Show resolved Hide resolved
Gemfile Show resolved Hide resolved
Without this change, rspec was failing with this:

```
  4) ReportsController#show using HTML response format shows the attributes for the right project
     Failure/Error: raise TypeError, "#{path.inspect} is not a valid path: must be a String, Pathname, or Resolver"

     TypeError:
       #<RSpec::Rails::ViewRendering::EmptyTemplateResolver::ResolverDecorator:0x0000000113c167e0 @resolver=#<ActionView::FileSystemResolver:0x0000000109e1bb80 @unbound_templates=#<Concurrent::Map:0x0000000109e1bb58 entries=41 default_proc=nil>, @path_parser=#<ActionView::Resolver::PathParser:0x0000000110133308 @regex=/
                 \A
                 (?:(?<prefix>.*)\/)?
                 (?<partial>_)?
                 (?<action>.*?)
                 (?:\.(?<locale>(?-mix:ar|bg|ca\-CAT|ca|da\-DK|de\-AT|de\-CH|de|ee|en|en\-AU|en\-BORK|en\-CA|en\-GB|en\-IND|en\-MS|en\-NEP|en\-NG|en\-NZ|en\-PAK|en\-SG|en\-TH|en\-UG|en\-US|en\-ZA|en\-au\-ocker|es\-AR|es\-MX|es|fa|fi\-FI|fr|fr\-CA|fr\-CH|he|hy|id|it|ja|ko|lt|lv|mi\-NZ|nb\-NO|nl|no\-NO|pl|pt\-BR|pt|ru|sk|sv|th|tr|uk|vi|zh\-CN|zh\-TW|(?-mix:[a-z]{2}(?:[-_][A-Z]{2})?))))??
                 (?:\.(?<format>(?-mix:html|text|js|css|ics|csv|vcf|vtt|png|jpeg|gif|bmp|tiff|svg|webp|mpeg|mp3|ogg|m4a|webm|mp4|otf|ttf|woff|woff2|xml|rss|atom|yaml|multipart_form|url_encoded_form|json|pdf|zip|gzip)))??
                 (?:\+(?<variant>[^.]*))??
                 (?:\.(?<handler>(?-mix:raw|erb|html|builder|ruby|jbuilder)))?
                 \z
               /x>, @path="/Users/etagwerker/Projects/fastruby/points/app/views">> is not a valid path: must be a String, Pathname, or Resolver
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/actionview-7.1.0/lib/action_view/path_set.rb:79:in `block in typecast'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/actionview-7.1.0/lib/action_view/path_set.rb:68:in `map'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/actionview-7.1.0/lib/action_view/path_set.rb:68:in `typecast'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/actionview-7.1.0/lib/action_view/path_set.rb:19:in `initialize'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/actionview-7.1.0/lib/action_view/view_paths.rb:35:in `new'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/actionview-7.1.0/lib/action_view/view_paths.rb:35:in `_build_view_paths'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/actionview-7.1.0/lib/action_view/view_paths.rb:69:in `view_paths='
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-rails-4.0.2/lib/rspec/rails/view_rendering.rb:153:in `block (2 levels) in <module:ViewRendering>'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:365:in `run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:529:in `block in run_owned_hooks_for'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:528:in `each'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:528:in `run_owned_hooks_for'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:615:in `block in run_example_hooks_for'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:614:in `reverse_each'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:614:in `run_example_hooks_for'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:484:in `run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:505:in `run_before_example'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:261:in `block in run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:511:in `block in with_around_and_singleton_context_hooks'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:468:in `block in with_around_example_hooks'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:486:in `block in run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:626:in `block in run_around_example_hooks_for'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-rails-4.0.2/lib/rspec/rails/example/controller_example_group.rb:191:in `block (2 levels) in <module:ControllerExampleGroup>'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-rails-4.0.2/lib/rspec/rails/adapters.rb:75:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:629:in `run_around_example_hooks_for'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:486:in `run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:468:in `with_around_example_hooks'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:511:in `with_around_and_singleton_context_hooks'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:259:in `run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:646:in `block in run_examples'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:642:in `map'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:642:in `run_examples'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:607:in `run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `block in run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `map'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `block in run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `map'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `run'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:121:in `map'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
     # /Users/etagwerker/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/configuration.rb:2070:in `with_suite_hooks'
Add `render_views` to reports_controller
```
@etagwerker etagwerker force-pushed the ROAD-556-upgrade-rails-7-1 branch from ca4d7dd to 7ffad28 Compare October 9, 2023 23:39
`bundle lock --add-platform x86_64-linux`
@etagwerker etagwerker requested a review from arielj October 9, 2023 23:49
Copy link
Contributor

@arielj arielj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 !

@aisayo aisayo temporarily deployed to points-road-556-upgrade-8fffka October 10, 2023 14:44 Inactive
@JuanVqz
Copy link
Member

JuanVqz commented Oct 10, 2023

@etagwerker QA'ed locally it works as expected but the review app failed here is the trace

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       DEPRECATION WARNING: DeprecatedConstantAccessor.deprecate_constant without a deprecator is deprecated (called from <top (required)> at /tmp/build_43fc1843/config/application.rb:7)
       I, [2023-10-10T14:45:57.074063 #1535]  INFO -- : Writing /tmp/build_43fc1843/public/assets/actiontext-b58286a0f85d70711aa34c6ad74887988a0e853efd1c920e705af6f7c9cc0790.js
       I, [2023-10-10T14:45:57.075023 #1535]  INFO -- : Writing /tmp/build_43fc1843/public/assets/actiontext-b58286a0f85d70711aa34c6ad74887988a0e853efd1c920e705af6f7c9cc0790.js.gz
       rake aborted!
       Uglifier::Error: 
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/uglifier-4.2.0/lib/uglifier.rb:291:in `parse_result'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/uglifier-4.2.0/lib/uglifier.rb:221:in `run_uglifyjs'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/uglifier-4.2.0/lib/uglifier.rb:166:in `compile'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/compressing.rb:65:in `block in js_compressor='
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb:31:in `call'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:134:in `block in find'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `each'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `find'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
       /tmp/build_43fc1843/vendor/bundle/ruby/3.2.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
       Tasks: TOP => assets:precompile
       (See full trace by running task with --trace)

 !
 !     Precompiling assets failed.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

@etagwerker
Copy link
Member Author

@JuanVqz @arielj Do we need to use the uglifier? I tried by removing it and it seems to work fine over here. What's the down side of not using uglifier?

@arielj
Copy link
Contributor

arielj commented Oct 10, 2023

@etagwerker without uglifier we don't have assets minification (well I guess we do have JS minification because of webpacker maybe? but we won't have for the CSS)

uglifier is rather old though, maybe what we need to do is to replace that with yui-compressor https://guides.rubyonrails.org/asset_pipeline.html#customizing-the-pipeline

@etagwerker etagwerker temporarily deployed to points-road-556-upgrade-aoaqzw October 10, 2023 21:07 Inactive
@etagwerker
Copy link
Member Author

@JuanVqz @arielj I updated it to use yui-compressor 👍🏼

@aisayo aisayo temporarily deployed to points-road-556-upgrade-cjix5x October 11, 2023 15:17 Inactive
@JuanVqz
Copy link
Member

JuanVqz commented Oct 11, 2023

@etagwerker @arielj, yui-compressor is also failing with this message YUI::Compressor::RuntimeError: compression failed: No such file or directory - java

It seems like it requires Java
Let me add the Java build pack in Heroku and see if that works.

@etagwerker etagwerker had a problem deploying to points-road-556-upgrade-oszh82 October 11, 2023 15:46 Failure
@etagwerker etagwerker temporarily deployed to points-road-556-upgrade-oszh82 October 11, 2023 15:49 Inactive
@etagwerker etagwerker temporarily deployed to points-road-556-upgrade-53y1xu October 11, 2023 15:54 Inactive
@etagwerker etagwerker temporarily deployed to points-road-556-upgrade-qcj1wx October 11, 2023 16:50 Inactive
@arielj arielj temporarily deployed to points-road-556-upgrade-qcj1wx October 11, 2023 16:51 Inactive
@aisayo aisayo temporarily deployed to points-road-556-upgrade-zwud1d October 11, 2023 17:19 Inactive
@etagwerker etagwerker merged commit c881448 into main Oct 11, 2023
6 checks passed
@etagwerker etagwerker deleted the ROAD-556-upgrade-rails-7-1 branch October 11, 2023 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants