mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 02:11:08 -06:00
bf3e121323
Why this change? When running system tests on our CI, we have been occasionally seeing server errors like: ``` Error encountered while proccessing /stylesheets/desktop_e58cf7f686aab173f9b778797f241913c2833c39.css NoMethodError: undefined method `+' for nil:NilClass /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/path/pattern.rb:139:in `[]' /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:127:in `block (2 levels) in find_routes' /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:126:in `each' /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:126:in `each_with_index' /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:126:in `block in find_routes' /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:123:in `map!' /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:123:in `find_routes' /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:32:in `serve' /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/routing/route_set.rb:852:in `call' ``` While looking through various Rails issues related to the error above, I came across https://github.com/rails/rails/pull/27647 which is a fix to fully initialize routes before the first request is handled. However, the routes are only fully initialize only if `config.eager_load` is set to `true`. There is no reason why `config.eager_load` shouldn't be `true` in the CI environment and this is what a new Rails 7.1 app is generated with. What does this change do? Enable `config.eager_load` when `env["CI"]` is present |
||
---|---|---|
.. | ||
versioning | ||
bookmarkable_helper.rb | ||
common_basic_reviewable_serializer.rb | ||
concurrency.rb | ||
diagnostics_helper.rb | ||
discourse_event_helper.rb | ||
dom_matcher.rb | ||
dummy_custom_summarization.rb | ||
fake_bookmark_hashtag_data_source.rb | ||
fake_logger.rb | ||
fake_s3.rb | ||
fast_image_helpers.rb | ||
final_destination_helper.rb | ||
helpers.rb | ||
imap_helper.rb | ||
integration_helpers.rb | ||
match_html_matcher.rb | ||
mock_git_importer.rb | ||
negated_matcher.rb | ||
onebox_helpers.rb | ||
rate_limit_matcher.rb | ||
sample_plugin_site_settings.yml | ||
shared_examples_for_custom_fields.rb | ||
shared_examples_for_stats_cacheable.rb | ||
sidekiq_helpers.rb | ||
site_settings_helpers.rb | ||
system_helpers.rb | ||
test_second_factor_action.rb | ||
time_matcher.rb | ||
topic_guardian_can_see_consistency_check.rb | ||
ts_vector_matcher.rb | ||
uploads_helpers.rb | ||
user_sidebar_serializer_attributes.rb | ||
webauthn_integration_helpers.rb |