-
Notifications
You must be signed in to change notification settings - Fork 4
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 rails from 7.2.2 to 8.0.0 #999
base: main
Are you sure you want to change the base?
Changes from 1 commit
5a89b6f
837029d
e544d0e
80fce2e
9229aa2
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,2 @@ | ||
#!/usr/bin/env ruby | ||
exec "./bin/rails", "server", *ARGV |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env ruby | ||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
load Gem.bin_path("thruster", "thrust") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,7 @@ | |
Rails.application.configure do | ||
# Settings specified here will take precedence over those in config/application.rb. | ||
|
||
# In the development environment your application's code is reloaded any time | ||
# it changes. This slows down response time but is perfect for development | ||
# since you don't have to restart the web server when you make code changes. | ||
# Make code changes take effect immediately without server restart. | ||
config.enable_reloading = true | ||
|
||
# Do not eager load code on boot. | ||
|
@@ -17,48 +15,40 @@ | |
# Enable server timing. | ||
config.server_timing = true | ||
|
||
# Enable/disable caching. By default caching is disabled. | ||
# Run rails dev:cache to toggle caching. | ||
# Enable/disable Action Controller caching. By default Action Controller caching is disabled. | ||
# Run rails dev:cache to toggle Action Controller caching. | ||
if Rails.root.join("tmp/caching-dev.txt").exist? | ||
config.action_controller.perform_caching = true | ||
config.action_controller.enable_fragment_cache_logging = true | ||
|
||
config.cache_store = :memory_store | ||
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. So are these conditional 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. Yep: rails/rails@9c8716a |
||
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" } | ||
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } | ||
else | ||
config.action_controller.perform_caching = false | ||
|
||
config.cache_store = :null_store | ||
end | ||
|
||
# Change to :null_store to avoid any caching. | ||
config.cache_store = :memory_store | ||
|
||
# Print deprecation notices to the Rails logger. | ||
config.active_support.deprecation = :log | ||
|
||
# Raise exceptions for disallowed deprecations. | ||
config.active_support.disallowed_deprecation = :raise | ||
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. Is this setting now the default in development or something? 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 don't think the underlying default changed. It looks like the setting was just removed because DHH thought it wouldn't be useful for new apps: rails/rails@506d728 |
||
|
||
# Tell Active Support which deprecation messages to disallow. | ||
config.active_support.disallowed_deprecation_warnings = [] | ||
|
||
# Raise an error on page load if there are pending migrations. | ||
config.active_record.migration_error = :page_load | ||
|
||
# Highlight code that triggered database queries in logs. | ||
config.active_record.verbose_query_logs = true | ||
|
||
# Append comments with runtime information tags to SQL queries in logs. | ||
config.active_record.query_log_tags_enabled = true | ||
|
||
# Raises error for missing translations. | ||
# 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 | ||
|
||
# Raise error when a before_action's only/except options reference missing actions. | ||
config.action_controller.raise_on_missing_callback_actions = true | ||
|
||
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`. | ||
# config.generators.apply_rubocop_autocorrect_after_generate! | ||
|
||
config.hosts += [ | ||
"authenticating-proxy.dev.gov.uk", | ||
] | ||
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. What difference does this change make? |
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,73 +6,62 @@ | |
# Code is not reloaded between requests. | ||
config.enable_reloading = false | ||
|
||
# Eager load code on boot. This eager loads most of Rails and | ||
# your application in memory, allowing both threaded web servers | ||
# and those relying on copy on write to perform better. | ||
# Rake tasks automatically ignore this option for performance. | ||
# Eager load code on boot for better performance and memory savings (ignored by Rake tasks). | ||
config.eager_load = true | ||
|
||
# Full error reports are disabled and caching is turned on. | ||
config.consider_all_requests_local = false | ||
config.action_controller.perform_caching = true | ||
# Full error reports are disabled. | ||
config.consider_all_requests_local = false | ||
|
||
# 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 | ||
# Turn on fragment caching in view templates. | ||
config.action_controller.perform_caching = true | ||
|
||
# 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? | ||
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. What's the thinking behind removing 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. This is also a changed default that we skipped updating in 7.1/7.2: |
||
# Cache assets for far-future expiry since they are all digest stamped. | ||
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } | ||
|
||
# Enable serving of images, stylesheets, and JavaScripts from an asset server. | ||
# config.asset_host = "http://assets.example.com" | ||
|
||
# Specifies the header that your server uses for sending files. | ||
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache | ||
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX | ||
|
||
# Assume all access to the app is happening through a SSL-terminating reverse proxy. | ||
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. | ||
# config.assume_ssl = true | ||
config.assume_ssl = true | ||
|
||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | ||
# config.force_ssl = true | ||
config.force_ssl = 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. Is this correct? I thought our infrastructure resulted in our Rails apps only ever working with HTTP requests (because SSL is terminated at the edge of our network)? 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'm less familiar with |
||
|
||
# Skip http-to-https redirect for the default health check endpoint. | ||
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } | ||
|
||
# Log to STDOUT by default | ||
if ENV["RAILS_LOG_TO_STDOUT"].present? | ||
config.logger = ActiveSupport::Logger.new($stdout) | ||
.tap { |logger| logger.formatter = ::Logger::Formatter.new } | ||
.then { |logger| ActiveSupport::TaggedLogging.new(logger) } | ||
end | ||
|
||
# Prepend all log lines with the following tags. | ||
# Log to STDOUT with the current request id as a default log tag. | ||
config.log_tags = [:request_id] | ||
config.logger = ActiveSupport::TaggedLogging.logger($stdout) | ||
|
||
# "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". | ||
# Change to "debug" to log everything (including potentially personally-identifiable information!) | ||
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") | ||
|
||
# Use a different cache store in production. | ||
# Prevent health checks from clogging up the logs. | ||
config.silence_healthcheck_path = "/up" | ||
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. We don't use /up..? |
||
|
||
# Don't log any deprecations. | ||
config.active_support.report_deprecations = false | ||
|
||
# Replace the default in-process memory cache store with a durable alternative. | ||
# config.cache_store = :mem_cache_store | ||
|
||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to | ||
# the I18n.default_locale when a translation cannot be found). | ||
config.i18n.fallbacks = true | ||
|
||
# Don't log any deprecations. | ||
config.active_support.report_deprecations = false | ||
|
||
# Do not dump schema after migrations. | ||
config.active_record.dump_schema_after_migration = false | ||
|
||
# Only use :id for inspections in production. | ||
config.active_record.attributes_for_inspect = [:id] | ||
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. Is this a change to the existing production behaviour? If so, is it useful? |
||
|
||
# Enable DNS rebinding protection and other `Host` header attacks. | ||
# config.hosts = [ | ||
# "example.com", # Allow requests from example.com | ||
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` | ||
# ] | ||
# | ||
# Skip DNS rebinding protection for the default health check endpoint. | ||
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } } | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Be sure to restart your server when you modify this file. | ||
# | ||
# This file eases your Rails 8.0 framework defaults upgrade. | ||
# | ||
# Uncomment each configuration one by one to switch to the new default. | ||
# Once your application is ready to run with all new defaults, you can remove | ||
# this file and set the `config.load_defaults` to `8.0`. | ||
# | ||
# Read the Guide for Upgrading Ruby on Rails for more info on each option. | ||
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html | ||
|
||
### | ||
# Specifies whether `to_time` methods preserve the UTC offset of their receivers or preserves the timezone. | ||
# If set to `:zone`, `to_time` methods will use the timezone of their receivers. | ||
# If set to `:offset`, `to_time` methods will use the UTC offset. | ||
# If `false`, `to_time` methods will convert to the local system UTC offset instead. | ||
#++ | ||
Rails.application.config.active_support.to_time_preserves_timezone = :zone | ||
|
||
### | ||
# When both `If-Modified-Since` and `If-None-Match` are provided by the client | ||
# only consider `If-None-Match` as specified by RFC 7232 Section 6. | ||
# If set to `false` both conditions need to be satisfied. | ||
#++ | ||
# Rails.application.config.action_dispatch.strict_freshness = true | ||
|
||
### | ||
# Set `Regexp.timeout` to `1`s by default to improve security over Regexp Denial-of-Service attacks. | ||
#++ | ||
# Regexp.timeout = 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,41 @@ | ||
require "govuk_app_config/govuk_puma" | ||
GovukPuma.configure_rails(self) | ||
# This configuration file will be evaluated by Puma. The top-level methods that | ||
# are invoked here are part of Puma's configuration DSL. For more information | ||
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. | ||
# | ||
# Puma starts a configurable number of processes (workers) and each process | ||
# serves each request in a thread from an internal thread pool. | ||
# | ||
# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You | ||
# should only set this value when you want to run 2 or more workers. The | ||
# default is already 1. | ||
# | ||
# The ideal number of threads per worker depends both on how much time the | ||
# application spends waiting for IO operations and on how much you wish to | ||
# prioritize throughput over latency. | ||
# | ||
# As a rule of thumb, increasing the number of threads will increase how much | ||
# traffic a given process can handle (throughput), but due to CRuby's | ||
# Global VM Lock (GVL) it has diminishing returns and will degrade the | ||
# response time (latency) of the application. | ||
# | ||
# The default is set to 3 threads as it's deemed a decent compromise between | ||
# throughput and latency for the average Rails application. | ||
# | ||
# Any libraries that use a connection pool or another resource pool should | ||
# be configured to provide at least as many connections as the number of | ||
# threads. This includes Active Record's `pool` parameter in `database.yml`. | ||
threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) | ||
threads threads_count, threads_count | ||
|
||
# Specifies the `port` that Puma will listen on to receive requests; default is 3000. | ||
port ENV.fetch("PORT", 3000) | ||
|
||
# Allow puma to be restarted by `bin/rails restart` command. | ||
plugin :tmp_restart | ||
|
||
# Run the Solid Queue supervisor inside of Puma for single-server deployments | ||
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] | ||
|
||
# Specify the PID file. Defaults to tmp/pids/server.pid in development. | ||
# In other environments, only set the PID file if requested. | ||
pidfile ENV["PIDFILE"] if ENV["PIDFILE"] |
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.
Did this change really result from running
rails app:update
?