-
Notifications
You must be signed in to change notification settings - Fork 17
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 version 7.2.1 #3306
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env ruby | ||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
ARGV.unshift("--ensure-latest") | ||
|
||
load Gem.bin_path("brakeman", "brakeman") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added in order to support the config option. |
||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
# explicit rubocop config increases performance slightly while avoiding config confusion. | ||
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) | ||
|
||
load Gem.bin_path("rubocop", "rubocop") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
require "fileutils" | ||
|
||
# path to your application root. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes suggested by rails app:update |
||
APP_ROOT = File.expand_path("..", __dir__) | ||
APP_NAME = "government-frontend" | ||
|
||
def system!(*args) | ||
system(*args, exception: true) | ||
|
@@ -22,4 +22,8 @@ FileUtils.chdir APP_ROOT do | |
|
||
puts "\n== Restarting application server ==" | ||
system! "bin/rails restart" | ||
|
||
# puts "\n== Configuring puma-dev ==" | ||
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}" | ||
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1" | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,15 +21,20 @@ | |
module GovernmentFrontend | ||
class Application < Rails::Application | ||
# Initialize configuration defaults for originally generated Rails version. | ||
config.load_defaults 7.1 | ||
config.load_defaults 7.2 | ||
|
||
# Please, add to the `ignore` list any other `lib` subdirectories that do | ||
# not contain `.rb` files, or that should not be reloaded or eager loaded. | ||
# Common ones are `templates`, `generators`, or `middleware`, for example. | ||
config.autoload_lib(ignore: %w[assets tasks]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change suggested by rails app:update |
||
|
||
# Settings in config/environments/* take precedence over those specified here. | ||
# Application configuration can go into files in config/initializers | ||
# -- all .rb files in that directory are automatically loaded after loading | ||
# the framework and any gems in your application. | ||
|
||
# Custom directories with classes and modules you want to be autoloadable. | ||
config.autoload_paths += %W[#{config.root}/lib] | ||
config.autoload_paths += %W[#{config.root}/lib/helpers] | ||
|
||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. | ||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
# Show full error reports. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes suggested by rails app:update. |
||
config.consider_all_requests_local = true | ||
|
||
# Enable server timing | ||
# Enable server timing. | ||
config.server_timing = true | ||
|
||
# Enable/disable caching. By default caching is disabled. | ||
|
@@ -52,10 +52,13 @@ | |
# config.i18n.raise_on_missing_translations = true | ||
|
||
# Annotate rendered view with file names. | ||
# config.action_view.annotate_rendered_view_with_filenames = true | ||
config.action_view.annotate_rendered_view_with_filenames = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a blocker, but would be nice to call out why we're enabling this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a change suggested by app:update. As it only applies to the development environment, it's safe to apply with no impact on tests or production. It helps in debugging. Here is the description of what it does: https://www.bigbinary.com/blog/rails-6-1-adds-annotate_rendered_view_with_filenames-to-annotate-html-output What is your opinion on that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think 'It helps in debugging.' is enough. Just so people looking back can understand why we decided to uncomment it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also I think this conversation is probably enough documentation too! So I think all good to be merged! 💪🏻 |
||
|
||
config.hosts.clear | ||
|
||
# Uncomment if you wish to allow Action Cable access from any origin. | ||
# config.action_cable.disable_request_forgery_protection = true | ||
# Raise error when a before_action's only/except options reference missing actions. | ||
config.action_controller.raise_on_missing_callback_actions = false | ||
|
||
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`. | ||
config.generators.apply_rubocop_autocorrect_after_generate! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enabled so our rubocop rules apply automatically. |
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,15 +13,14 @@ | |
config.eager_load = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes suggested by rails app:update. |
||
|
||
# Full error reports are disabled and caching is turned on. | ||
config.consider_all_requests_local = false | ||
config.consider_all_requests_local = false | ||
config.action_controller.perform_caching = true | ||
|
||
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] | ||
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files). | ||
# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment | ||
# key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). | ||
# config.require_master_key = true | ||
|
||
# Disable serving static files from the `/public` folder by default since | ||
# Apache or NGINX already handles this. | ||
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. | ||
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? | ||
|
||
# Compress JS using a preprocessor. | ||
|
@@ -47,18 +46,22 @@ | |
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | ||
# config.force_ssl = true | ||
|
||
# Include generic and useful information about system operation, but avoid logging too much | ||
# information to avoid inadvertent exposure of personally identifiable information (PII). | ||
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :info) | ||
# Skip http-to-https redirect for the default health check endpoint. | ||
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } | ||
|
||
# Prepend all log lines with the following tags. | ||
config.log_tags = [:request_id] | ||
|
||
# "info" includes generic and useful information about system operation, but avoids logging too much | ||
# information to avoid inadvertent exposure of personally identifiable information (PII). If you | ||
# want to log everything, set the level to "debug". | ||
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") | ||
|
||
# Use a different cache store in production. | ||
config.cache_store = :mem_cache_store, nil, { namespace: :government_frontend, compress: true } | ||
|
||
# Use a real queuing backend for Active Job (and separate queues per environment). | ||
# config.active_job.queue_adapter = :resque | ||
# config.active_job.queue_adapter = :resque | ||
# config.active_job.queue_name_prefix = "government_frontend_production" | ||
|
||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes suggested by rails app:update. |
||
|
||
# Show full error reports and disable caching. | ||
config.consider_all_requests_local = true | ||
config.consider_all_requests_local = true | ||
config.action_controller.perform_caching = false | ||
config.cache_store = :null_store | ||
|
||
|
@@ -48,4 +48,7 @@ | |
|
||
# Annotate rendered view with file names. | ||
# 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 | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# Be sure to restart your server when you modify this file. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes suggested by rails app:update. |
||
|
||
# Define an application-wide HTTP permissions policy. For further | ||
# information see https://developers.google.com/web/updates/2018/06/feature-policy | ||
# | ||
# Rails.application.config.permissions_policy do |f| | ||
# f.camera :none | ||
# f.gyroscope :none | ||
# f.microphone :none | ||
# f.usb :none | ||
# f.fullscreen :self | ||
# f.payment :self, "https://secure.example.com" | ||
# information see: https://developers.google.com/web/updates/2018/06/feature-policy | ||
|
||
# Rails.application.config.permissions_policy do |policy| | ||
# policy.camera :none | ||
# policy.gyroscope :none | ||
# policy.microphone :none | ||
# policy.usb :none | ||
# policy.fullscreen :self | ||
# policy.payment :self, "https://secure.example.com" | ||
# 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.
Added by Rails app:update