2024/01/04分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
actiontext/CHANGELOG.md
- Raise
ArgumentError
when readingconfig.x.something
with arguments - Support
BACKTRACE
ENV variable to turn off backtrace cleaning.
Merge pull request #50543 from santib/run-ci-on-every-pr
railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt
の修正です。
rails new
で生成されるCIの設定で、main
ブランチに対するPRでのみテストが実行されるようになっていたのを、全てのブランチの場合でテストが実行されるよう修正しています。
Eager load the Rails default controllers used in production (#50558)
railties/lib/rails.rb
、
railties/lib/rails/application/finisher.rb
の修正です。
productionで使われるRails内部のcontrollerをeager loadの対象にするよう修正しています。
Merge pull request #50541 from bparanj/document-edge-cases-for-find
activerecord/lib/active_record/relation/finder_methods.rb
のdocの修正です。
find
メソッドのdocにfind
に空のArrayやnilを指定した場合の挙動の説明を追加しています。
Enable Minitest/NonExecutableTestMethod
cop
.rubocop.yml
の修正です。
Minitest/NonExecutableTestMethod
copを有効にするよう修正しています。
Merge pull request #50545 from santib/use-all-ci-cores
railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt
の修正です。
rails new
で生成されるCIの設定で、Parallelize testsが使用されるよう明示的にPARALLEL_WORKERS
envの設定を追加しています。
Merge pull request #50547 from faqndo97/run_importmap_audit_on_ci
railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt
の修正です。
rails new
で生成されるCIの設定で、Javascript Dependenciesのsecurity vulnerabilitiesのscan(bin/importmap audit
)の設定を追加しています。
Merge pull request #49857 from mguan2020/ujsfix
rails guideのUpgrading Ruby on Rails
の修正です。
Upgrading from Rails 7.0 to Rails 7.1
に、@rails/ujs
のimport syntaxの変更についての説明を追加しています。
Merge pull request #50473 from seanpdoyle/action-text-content-pattern-matching
actiontext/lib/action_text/content.rb
、
actiontext/lib/action_text/fragment.rb
の修正です。
ActionText::Content#deconstruct
をNokogiri::XML::DocumentFragment#elements
にdelegateするよう修正しています。ActionText::Content
の内容に対してpattern matchを使用出来るようにする為。
content = ActionText::Content.new <<~HTML <h1>Hello, world</h1> <div>The body</div> HTML content => [h1, div] assert_pattern { h1 => { content: "Hello, world" } } assert_pattern { div => { content: "The body" } }
Add link to API documentation for ActionView helper method
rails guideのAction View Helpers
の修正です。
Action Viewのhelper methodについて説明している箇所に、API docへのリンクを追加しています。
Add markdown codehighlight for bash script
README.md
の修正です。
languageの指定がないcode blockにlanguageの指定を行うよう修正しています。
Remove all code to work with Ruby < 3.1
Ruby 3.1未満向けのコードをまとめて削除しています。
.rubocop.yml
の修正です。
TargetRubyVersionを3.1
に変更、Lint/MissingCopEnableDirective
等のDirectiveに関するcopを追加、及び各ファイルをcopの変更に合わせて更新しています。
Fix self is undefined for actioncable within ssr build systems by replacing it globalThis
actioncable/app/javascript/action_cable/adapters.js
の修正です。
globalThisを使用している箇所があったのを、使用しないよう修正しています。SSRの為のbuildを行う時にエラーにならないようにする為。
Merge pull request #46238 from austenmadden/resolve-validates-associated-ignores-contexts
Active Recordの修正です。
validates_associated
メソッドがon
オプションに指定されたcontextを無視してしまうバグがあったのを修正しています。
Raise ArgumentError
when reading from config.x
with arguments
railties/lib/rails/application/configuration.rb
の修正です。
config.x.something
のread処理に誤った引数が指定された場合にArgumentError
をraiseするよう修正しています。
config.x.this_works.this_raises true # raises ArgumentError
値の設定をしようとして誤った使い方をしている場合にそれに気付けるようにする為。
Remove apply_rubocop_autocorrect_after_generate!
from development.rb
in build_app
railties/test/isolation/abstract_unit.rb
の修正です。
テスト用のアプリケーションからconfig.generators.apply_rubocop_autocorrect_after_generate!
を除外するよう修正しています。
RubocopがサポートしていないRubyでテストを実行する際にRubocopの実行でエラーになるのを避ける為。
Don't run rubocop after generation on Ruby 3.4+
railties/test/application/generators_test.rb
の修正です。
apply_rubocop_autocorrect_after_generate!
のテストをRuby 3.4で実行しないよう修正しています。RubocopがサポートしていないRubyでテストを実行してにRubocopの実行でエラーになるのを避ける為。
Add BACKTRACE env variable to turn off backtrace for normal running, not just tests
railties/lib/minitest/rails_plugin.rb
、
railties/lib/rails/application/bootstrap.rb
の修正です。
test以外のコマンドでも、BACKTRACE
ENVでbacktrace cleaningの無効化を出来るよう修正しています。フレームワークのコードのデバッグをしやすくするため。
BACKTRACE=1 ./bin/rails server
Use logical core count for test parallelization
activesupport/lib/active_support/test_case.rb
、
railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt
の修正です。
parallelizing testsのデフォルトworker数を設定するのにphysical core数(Concurrent.physical_processor_count
)を使用していたのを、logical core数(Concurrent.processor_count
)を使用するよう修正しています。logical core数に依存した方が使用されるworker数が増え、テストが高速に実行される可能性があるため。
Merge pull request #50439 from fatkodima/migrations_paths-for-replicas
rails guideのMultiple Databases with Active Record
の修正です。
Horizontal Sharding
のセクションにあるdatabase.ymlのexample内のshardingの設定から不要なmigrations_paths
の指定を削除しています。
Merge pull request #50438 from fatkodima/schema_dump-docs
rails guideのMultiple Databases with Active Record
の修正です。
Setting up Your Application
セクションにschema_dump
の設定に関する説明を追加しています。
Handle all false args in config.x error check
railties/lib/rails/application/configuration.rb
の修正です。
config.x
に引数が指定された場合のチェック処理で、引数がnil/falseだった場合に正しくチェック出来てなかったのを修正しています。
Fix JavaScript code fence and syntax [ci-skip]
rails guideのUpgrading Ruby on Rails
の修正です。
code blocksのlang指定がなかった箇所があったのを修正しています。
Fix class name for backtrace_cleaner_test.rb
railties/test/application/backtrace_cleaner_test.rb
の修正です。
backtrace_cleaner
のテストのテスト名が誤っていたのを修正しています。
#render_template_to_object
and #render_partial_to_object
are private
actionview/lib/action_view/renderer/renderer.rb
の修正です。
内部でだけ使うrender_template_to_object
とrender_partial_to_object
メソッドの可視性をprivateに変更しています。
Get rid of EnvHelpers at Minitest::RailsPluginTest
railties/test/minitest/rails_plugin_test.rb
の修正です。
使用していないEnvHelpers
のincludeを削除しています。
Make sure isolation tests are properlly parallelized
activesupport/lib/active_support/testing/isolation.rb
の修正です。
RailsのParallelize testsが使用されている場合に、minitest本体のparallelize処理を呼び出さないよう修正しています。
activesupport/test/json/encoding_test_cases.rb
の修正です。
json encodingのテストで、moduleのチェックにActiveSupport::MessageEncryptor
を使用していたのをActiveSupport::Testing
を使用するよう修正しています。json
に依存しないmoduleでテストをするようにするため。
Merge pull request #49943 from cjilbert504/handle-nil-form-model-object
actionview/lib/action_view/helpers/form_helper.rb
の修正です。
form_with
メソッドのmodel:
引数にnil
が指定された場合にArgumentError
をraiseするよう修正しています。
activesupport/test/core_ext/object/json_gem_encoding_test.rb
、
tools/test_common.rb
の修正です。
テストを強制的にskipするためのforce_skip
メソッドを使用出来るよう修正しています。特定のライブラリがロードされていない場合に実行したいテストで、何らかの理由で既にそのライブラリがロードされてしまっている場合にテストをskip出来るようにするため、とのことです。
activesupport/test/core_ext/object/json_gem_encoding_test.rb
、
tools/test_common.rb
の修正です。
先のforce_skip
を定義する箇所に誤りがあったのを修正しています。
Force skip in test/core_ext/object/json_cherry_pick_test.rb
activesupport/test/core_ext/object/json_cherry_pick_test.rb
の修正です。
require_or_skipメソッド内で
force_skip`メソッドを使用するよう修正しています。
Ensure that LogSubscriber.flush_all! is called after LogSubscribers run
railties/lib/rails/rack/logger.rb
の修正です。
Rack用のlogger処理で、request終了後(bodyがclose後)にLogSubscribersのflush処理(ActiveSupport::LogSubscriber.flush_all!
)が実行されるよう修正しています。元々はheadersが書き込まれ後に実行されていたのですが、それだとログが正しく書き込まれない可能性があるため修正しています。
railties/lib/rails/engine.rb
の修正です。
.
ではじまるディレクトリからfixtureをloadしないよう修正しています。.bundle
ディレクトリがありその配下にgemが含まれている場合に、gem内部のfixtureがロードされてしまうのを避けるため。
Ensure installed migrations comply with rubocop-rails-omakase
actiontext/db/migrate/20180528164100_create_action_text_tables.rb
、
activestorage/db/migrate/20170806125915_create_active_storage_tables.rb
の修正です。
Railsが生成するアプリケーション用のmigrationファイルがrubocop-rails-omakase
のチェックでエラーにならないよう修正しています。
Ensure RuboCop and Brakeman are always avaiable in CI
railties/lib/rails/generators/rails/app/templates/Gemfile.tt
の修正です。
rubocop-rails-omakase
とbrakeman
がtest
groupに含まれてなかったのを、含むよう修正しています。CI環境でBUNDLE_WITHOUT
を指定している場合にもgemがインストールされるようにする為。