Rails upgrade 7.0.8 to 7.1.0#5478
Conversation
…ons to false is deprecated. Set to :none instead
…ed_id for a new record issue
| <% if current_organization.court_report_template.attached? %> | ||
| <%= link_to 'Download Current Template', rails_blob_path(current_organization.court_report_template, only_path: true), class: "btn btn-info" %> | ||
| <% ActiveStorage::Current.url_options = { host: request.base_url } %> | ||
| <%= link_to 'Download Current Template', current_organization.court_report_template.url(only_path: true), class: "btn btn-info" %> |
There was a problem hiding this comment.
Had to remove rails_blob_path and update with url code to handle ActionView::Template::Error: Cannot get a signed_id for a new record error.
Referred this open issue - https://stackoverflow.com/questions/77201333/cannot-get-a-signed-id-for-a-new-record-with-url-for-after-attaching-pictur
There was a problem hiding this comment.
Have kept this file for just review. Later I will delete and update application.rb to load 7.1 defaults
| it "shows casa orgs" do | ||
| page = request.parsed_body | ||
| # Code changes to fix response as earlier HTML String instead of Nokogiri::HTML5::Document object as received in Rails 7.1.0 to pass expectation | ||
| page = request.parsed_body.to_html |
There was a problem hiding this comment.
Had to update code as request.parsed_body in Rails 7.1 was returning Nokogiri::HTML5::Document object which was failing spec
|
Getting same below error for all failing 337 specs can't modify frozen Array: ["/home/runner/work/casa/casa/lib", #Pathname:/home/runner/work/casa/casa/lib/mailers/previews, "/home/runner/work/casa/casa/test/mailers/previews"] But I am not able to replicate same error locally by running bin/rails spec and all tests are passing locally. Trying to figure out issue, but can anyone try locally by pulling branch and check if encountering same issue. |
| # config.action_view.annotate_rendered_view_with_filenames = true | ||
|
|
||
| # Raise error when a before_action's only/except options reference missing actions | ||
| config.action_controller.raise_on_missing_callback_actions = false |
There was a problem hiding this comment.
By default this was set to true but I have changed it to false as it was failing specs for verify_authorized action
|
Hi @FireLemons Can you please review code and also help with issue I am facing with rspec failure as I am not able to replicate same issue locally and able to pass all specs. |
| # config.eager_load_paths << Rails.root.join("extras") | ||
|
|
||
| config.action_mailer.preview_path ||= defined?(Rails.root) ? Rails.root.join("lib", "mailers", "previews") : nil | ||
| config.action_mailer.preview_paths << (defined?(Rails.root) ? Rails.root.join("lib", "mailers", "previews") : nil) |
There was a problem hiding this comment.
I'm wondering if the difference between ||= and << is what's causing the failing rspec test in github @sarvaiyanidhi
There was a problem hiding this comment.
In Rails 7.1.0 there is now support for multiple preview paths so I am appending as per new configuration.
In one of the earlier commit, I still reverted to earlier code base to check if specs pass with it but encountered same issue so not sure if this is the problem 1d639db
I can confirm they pass locally. |
Thank you for the confirmation @schoork |
|
This is sooooo close to being mergeable... how can we get it over the line? |
|
What if we merge and then fix-forward? I don't have time to own it right now but it might be a possibility this weekend... |
Yes, let me try to fix spec issue again. I am trying to replicate issue locally so that I can figure out solution. |
|
Hi @compwron @schoork Finally spec issue is fixed. It was small fix but took some time to evaluate the exact cause. Also, this file config/initializers/new_framework_defaults_7_1.rb is just kept for you to review changes applicable in upgrade and can be removed before merging code in main branch once changes are confirmed. Please review PR and let me know if I need to do any more changes in code. Thanks |
|
Very cool!! Will review |
| # by default. You can change it below and use your own secret key. | ||
| # config.secret_key = 'a42b150b56c158d6e064aa257c8434390c921811007f42c5aa16c7455b78e3777087c5a4bcf18bfb0886fdd9296dec34eaa02fc0b47bed58417347eba971ee2d' | ||
|
|
||
| # Fixes rspec triggering Rails.application.secrets deprecation warning for Rails 7.1.0 upgrade |
|
Programmer of the month award! 🎉🏆🥇 |
What github issue is this PR for, if any?
Resolves #5462
What changed, and why?
Upgrade Rails to newer version
How will this affect user permissions?
How is this tested? (please write tests!) 💖💪
Have made changes in existing test to pass as per new configuration
Screenshots please :)
NA