-
Notifications
You must be signed in to change notification settings - Fork 10
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
Upgrade Rails to v7.1 & update gems (mostly only minor versions) #609
Conversation
Merge pull request #595 from MaMpf-HD/dev
Merge pull request #601 from MaMpf-HD/dev
Merge pull request #604 from MaMpf-HD/dev
Merge pull request #605 from MaMpf-HD/dev Annotation Tool 🙌
Merge pull request #608 from MaMpf-HD/dev
See the upgrade guide here: https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html
See https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#config-autoload-lib-and-config-autoload-lib-once Eager loading is on by default for production.
The file `config/app_environment_variables.rb` does not exist in our codebase anymore.
This was done because `bin/rails app:update` failed with: ** Execute app:update:active_storage rails active_storage:update bin/rails aborted! Gem::LoadError: can't activate listen (~> 3.5), already activated listen-3.0.8. Make sure all dependencies are added to Gemfile.
I think we can delete them since we do not use ActiveStorage (but the shrine gem instead for uploads). They would not do anything anyway since they all contain the line
and this table does not exist in our setting.
At least as of now, this does not affect us since we do not use ActiveRecord Encryption (which was introduced in Rails 7.0).
Me as well. This seems to refer to this:
I would expect we do not use the deprecated comparisons but to be sure one would have to go through all the controllers. |
Thanks, I just deleted these migrations.
Ah, great, one less thing to worry about. |
@fosterfarrell9, Where do you have that info from, i.e. the code block with the explanation for the parameter? |
In the Rails source code: https://github.com/rails/rails/blob/v7.1.3.2/actionpack/lib/action_controller/metal/strong_parameters.rb So I think we just have to look if for |
I've checked that for our controllers by searching for "==". I could only find comparison to string or integers but not to any hashes. Maybe you can take a look as well? In the In the future, before upgrading to Rails 7.2, we should check our production log and see if the warning you mentioned pops up there. If it does, we know where to fix this in the code. |
You can do so locally via `bundle update --bundler`
Performed automatically via `bundle install`.
This is a followup to rails/rails#47463
`bundle install` also removed globalize automatically for us.
In f486935, I made the changes regarding For reviewers
|
`cypress_folder` is deprecated as config option
@fosterfarrell9 Could you resolve the one missing conversation? |
Along side this, the schema was automatically updated and got rid of old translation tables originally created by the globalize gem. They were still in here as remnant of #609.
#652) * Setup X11 Cypress GUI forwarding Also see my StackOverflow question: https://stackoverflow.com/q/78639075 * Delete unnecessary Cypress sample files * Simplify Cypress config setup * Use internal docker host port * Delete old cypress helper * Remove e2e configuration * Fix wrong network assignment in Docker * Add cypress ESLint plugin back * Copy up-to-date on-rails commands from GitHub See this file: https://github.com/shakacode/cypress-on-rails/blob/master/lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js * Init dummy submission cypress test * Clean up comments in cypress-interactive Dockerfile * Outsource cypress docker setup in separate file * Remove `run_tests.sh` file * Add `createUserAndLogin` cypress command Also updated the cypress user emails and passwords. * Name cypress users more creatively * Add own Cypress FactoryBot implementation * Move cypress controller to subfolder * Remove cypress-on-rails dependency Note that at this point, some cypress commands don't work yet. * Outsource js error parsing logic to its own file * Add database cleaner and user creator for cypress * Fix RuboCop errors and improve documentation * Remove unnecessary `Cypress::` specifier * Remove unnecessary `index.js` file * Improve documentation for FactoryBot * Start Cypress UI automatically with open browser * Add Cypress tests to GitHub Actions CI/CD * Pass ./cypress.yml file to docker & split lines * Disable existing cypress tests for now will bring them back in a subsequent PR * Rename submissions spec * Rename cypress route subjects * Don't clear entrypoint for cypress tests * Execute "cypress run" in entrypoint * Rename archived tests and exclude them from ESLint * Temporarily disable docker compose cache * Disable old migrations stemming from globalize gem Along side this, the schema was automatically updated and got rid of old translation tables originally created by the globalize gem. They were still in here as remnant of #609. * Add back docker compose cache to cypress workflow * Revert "Disable old migrations stemming from globalize gem" This reverts commit 88f369e. * Use `db:schema:load` instead of `db:migrate` See https://github.com/rails/rails/blob/d43ee2088118425e493766aeb20575e9ce7159d1/actionmailbox/test/dummy/db/schema.rb#L5-L9 We also abort the script if it is called from the production environment. It's only intended for usage in the dev/test environment. For production, we have the respective master and worker entrypoints. * Wait for MaMpf before opening cypress UI
This fixes #554. See the upgrade guide and all config keys.
Commands used to perform the update:
Notable changes
Only changes I found noteworthy in particular.
Memcache is using connection pooling by default
. Let's see if that will cause any troubles in production.raise_on_missing_translation
is great, I guess. So i've activated it.info
instead ofwarn
. This will log a bit more information that may be helpful in production.info
is also the default by Rails.config.require_master_key = true
. With this config option activated, If the Rails master key is not available in production, the app won't boot, which is good.allow_deprecated_parameters_hash_equality
--> Not affected as we don't use Active Record Encryption.
--> Deleted them as we don't use ActiveStorage, but
shrine
instead.globalize_attribute_names
, see this commentFor the future
Content-Security-Policy
might be useful to set up but we have to watch out if this is working in conjunction with nginx.TODO
new_framework_defaults_7_1.rb
accordinglyThe Rails updater introduced some migrations and I'm not sure yet what their purpose is. Will have to review them. (see above)