2024/08/08分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Allow bots to ignore
allow_browser
. - Speed up
ActionDispatch::Routing::Mapper::Scope#[]
by merging frame hashes.
actionpack/lib/action_controller/metal/allow_browser.rb
の修正です。
allow_browser
APIで、botからのアクセスの場合、指定されたブラウザのバージョンよりバージョンが古くてもアクセス出来るよう修正しています。search engineによるクローリングをブロックしないようにするため。
Make auto detection of CPUs in default puma config optional, not default
railties/lib/rails/generators/rails/app/templates/config/deploy.yml.tt
、
railties/lib/rails/generators/rails/app/templates/config/puma.rb.tt
の修正です。
Pumaのworker数のデフォルト値にConcurrent.available_processor_count
を使用していたのを、WEB_CONCURRENCY
envにauto
という文字列が使われた場合のみConcurrent.available_processor_count
を使用し、そうでない場合はWEB_CONCURRENCY
envの値(指定が無い場合は1)を使用するよう修正しています。幾つかのホスティング環境ではConcurrent.available_processor_count
でも正しい使用可能なコア数が取得出来ないことがあり、そのような環境で予期せぬエラーになってしまうのを避けるため。
が、WEB_CONCURRENCY
envにauto
を指定することは出来なかったため、後ほど削除されています。
Comment out Kamal WEB_CONCURRENCY config, since it already defaults to 1
railties/lib/rails/generators/rails/app/templates/config/deploy.yml.tt
の修正です。
Kamalのconfig内のWEB_CONCURRENCY
の指定をコメントアウトするよう修正しています。1が指定されていたのですが、これはデフォルトの値と一致し、明示的に指定する必要が無いため。変わりにデフォルトと違う値(2)を指定するよう修正しています。
Merge pull request #52379 from dixpac/dix/normalize_auth_email
railties/lib/rails/generators/rails/authentication/templates/models/user.rb
の修正です。
session generatorが生成するmodel用のテンプレートファイルで、email addressを保存前にすべて小文字に変換するよう修正しています。大文字小文字が混在してしまうのを避けるため。
Puma defines thread(min, max = min) so no reason to pass min twice
railties/lib/rails/generators/rails/app/templates/config/puma.rb.tt
の修正です。
Pumaのスレッド数を指定する際に、maxとminが同じ値の場合に不要な2つめの引数を削除するよう修正しています。
が、リリースされているPumaではまだ削除出来なかったため、後ほどRevertされています。
railties/lib/rails/generators/rails/app/templates/config/puma.rb.tt
の修正です。
コメントのフォーマットを修正しています。
Now that we are only setting it once we can set it directly
railties/lib/rails/generators/rails/app/templates/config/puma.rb.tt
の修正です。
Pumaのスレッド数を指定する際に、RAILS_MAX_THREADS
envの値を一度変数に代入してから指定していたのを、直接メソッドに指定するよう修正しています。
Puma defines thread(min, max = min) so no reason to pass min twice の対応に関連して行われた修正だったのですが、そもそもの対応がまだリリース済みのPumaでは問題があったため、こちらの修正も後ほどRevertされています。
Document the fact that Puma 5.0+ now pulls from WEB_CONCURRENCY directly
railties/lib/rails/generators/rails/app/templates/config/puma.rb.tt
の修正です。
Pumaのworker数をenv(WEB_CONCURRENCY
)で指定する方法についての説明コメントを追加しています。
Puma 5+ now pulls WEB_CONCURRENCY directly from ENV, so we cannot/should not override
Pumaのworker数をenv(WEB_CONCURRENCY
)から取得した値で明示的に指定していたのを削除しています。Puma本体でWEB_CONCURRENCY
envからworker数を設定する対応が行われており、アプリ側で行う必要が無い為。なお、auto
という文字列を指定しての挙動の制御は無いため、そちらは単純に削除されています。
Revert "Now that we are only setting it once we can set it directly"
Pumaのスレッド数を指定する際にRAILS_MAX_THREADS
envの値を一度変数に代入してから指定していたのを直接メソッドに指定するよう修正した、Now that we are only setting it once we can set it directly をRevertしています。
This feature has not yet been released, it's only on puma/main
railties/lib/rails/generators/rails/app/templates/config/puma.rb.tt
の修正です。
Pumaのスレッド数を指定する際に、maxとminが同じ値の場合に不要な2つめの引数を削除したのを、再度maxとminそれぞれに値を指定するよう修正しています。maxとminが同じ値の挙動はリリースされているgemでは使用出来ないため。
This feature needs to exist in puma
railties/lib/rails/generators/rails/app/templates/config/deploy.yml.tt
の修正です。
Puma 5+ now pulls WEB_CONCURRENCY directly from ENV, so we cannot/should not overrideで削除された、WEB_CONCURRENCY
envにauto
という文字列を指定した場合の挙動を削除しています。
Remove redundant Puma configuration settings from fresh config/puma.rb files
railties/lib/rails/generators/rails/app/templates/config/puma.rb.tt
の修正です。
environment
の設定やpreload_app!
の呼び出しなど、Puma側で自動で行ってくれる挙動を設定ファイルから削除しています。
Fix comments for ease of comment/uncomment like builder block
railties/lib/rails/generators/rails/app/templates/config/deploy.yml.tt
の修正です。
コメントアウトの追加/削除をしやすくするようにするため、#
を行の先頭で指定するよう修正しています。
Make route mapping scope lookups faster
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
route mappingのscope取得処理について、処理高速化のためのリファクタリングを行っています。
actionpack/lib/action_dispatch/routing/mapper.rb
のdocの修正です。
match
メソッドのdoc内のexampleコードにまったく同じ内容をコードが2行あったのを、片方削除しています。
Document THOR_MERGE and THOR_DIFF vars during upgrade
rails guideのUpgrading Ruby on Rails
の修正です。
The Update Task
セクションに、THOR_DIFF
及びTHOR_MERGE
envに、app:update
実行中に使用出来るdiff及びmergeツールを指定出来る旨説明を追加しています。
Remove WEB_CONCURRENCY "auto" from tuning_performance_for_deployment (#52545)
rails guideのTuning Performance for Deployment
の修正です。
Puma 5+ now pulls WEB_CONCURRENCY directly from ENV, so we cannot/should not overrideで削除された、WEB_CONCURRENCY
envにauto
という文字列を指定した場合の挙動の説明を削除しています。