-
Notifications
You must be signed in to change notification settings - Fork 1
Update Rails to v8.1 #884
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
base: main
Are you sure you want to change the base?
Update Rails to v8.1 #884
Conversation
| #!/usr/bin/env ruby | ||
| require_relative "../config/boot" | ||
| require "active_support/continuous_integration" | ||
|
|
||
| CI = ActiveSupport::ContinuousIntegration | ||
| require_relative "../config/ci.rb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New feature in Rails 8, this file is the default added by rails app:update
|
|
||
| def system!(*args) | ||
| system(*args) || abort("\n== Command #{args} failed ==") | ||
| system(*args, exception: true) || abort("\n== Command #{args} failed ==") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted suggestions by rails app:update and combined with existing.
| # Ensuring that ActiveStorage routes are loaded before Comfy's globbing | ||
| # route. Without this file serving routes are inaccessible. | ||
| config.railties_order = [ActiveStorage::Engine, :main_app, :all] | ||
| config.exceptions_app = routes | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to make future runs of rails app:update easier.
| # Run using bin/ci | ||
|
|
||
| # frozen_string_literal: true | ||
|
|
||
| CI.run do | ||
| step "Setup", "bin/setup --skip-server" | ||
|
|
||
| step "Style: Ruby", "bin/rubocop" | ||
|
|
||
| step "Security: Importmap vulnerability audit", "bin/importmap audit" | ||
|
|
||
| step "Tests: Rails", "bin/rails test" | ||
| step "Tests: System", "bin/rails test:system" | ||
| step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant" | ||
|
|
||
| # Optional: set a green GitHub commit status to unblock PR merge. | ||
| # Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`. | ||
| # if success? | ||
| # step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff" | ||
| # else | ||
| # failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again." | ||
| # end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted suggestions by rails app:update. This is the default generated file for the new Rails CI feature.
| # | ||
| environment ENV.fetch("RAILS_ENV") { "development" } | ||
|
|
||
| # This configuration file will be evaluated by Puma. The top-level methods that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted suggestions by rails app:update.
| # Use this to limit dissemination of sensitive information. | ||
| # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. | ||
| Rails.application.config.filter_parameters += [ | ||
| :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted suggestions by rails app:update
| # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } | ||
| # config.content_security_policy_nonce_directives = %w(script-src style-src) | ||
| # | ||
| # # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted suggestions by rails app:update
| # Add additional assets to the asset load path. | ||
| # Rails.application.config.assets.paths << Emoji.images_path | ||
| Rails.application.config.assets.paths << Rails.root.join("node_modules/bootstrap-icons/font") | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted suggestions by rails app:update
| # config.action_dispatch.show_exceptions = :rescuable | ||
| # Raise exceptions instead of rendering exception templates. | ||
| config.action_dispatch.show_exceptions = false | ||
| config.action_dispatch.show_exceptions = :rescuable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted suggestions by rails app:update
| config.action_view.annotate_rendered_view_with_filenames = true | ||
|
|
||
| # Uncomment if you wish to allow Action Cable access from any origin. | ||
| # config.action_cable.disable_request_forgery_protection = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted suggestions by rails app:update and weaved in previous customizations.
| # | ||
| # Skip DNS rebinding protection for the default health check endpoint. | ||
| # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted suggestions by rails app:update and weaved in previous customizations.
052e3a1 to
b10f72e
Compare
| # | ||
| # Skip DNS rebinding protection for the default health check endpoint. | ||
| # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
based off config/environments/production.rb with differences:
- RAILS_LOG_LEVEL
- report_deprecations
- attributes_for_inspect
| t.integer "page_id", null: false | ||
| t.datetime "updated_at", precision: nil, null: false | ||
| t.index ["is_published"], name: "index_comfy_cms_translations_on_is_published" | ||
| t.index ["locale"], name: "index_comfy_cms_translations_on_locale" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails 8.1 db:schema:dump: columns are now sorted alphabetically by name.
No description provided.