Commit Graph

92162 Commits

Author SHA1 Message Date
Rafael Mendonça França
999df686de
Merge pull request #52197 from heka1024/cache-controler-immutable
Support `immutable` directive in Cache-Control
2024-06-26 16:23:19 -04:00
Rafael Mendonça França
5103ba86e4
Merge pull request #52222 from Earlopain/skip-sprockets-newline
Fix an extra newline in `development.rb` when sprocket gets skipped
2024-06-26 16:18:22 -04:00
Rafael Mendonça França
862f402651
Merge pull request #52209 from bensheldon/strict-local-assigns-defaults
Document undefined `local_assigns` when using Strict Locals with defaults
2024-06-26 16:17:33 -04:00
Rafael Mendonça França
716e4a7d32
Merge pull request #52091 from jasonkim/to-time-use-timezone
Add a config for preserving timezone information when calling `to_time` on TimeWithZone object
2024-06-26 16:16:05 -04:00
Rafael Mendonça França
f46d06b3b5
Merge pull request #52031 from matthewd/quieter-to_time
Don't emit to_time deprecations in known-safe contexts
2024-06-26 16:09:59 -04:00
Rafael Mendonça França
acc8f3dfdf
Merge pull request #52214 from louim/bugfix/guide-menu-overflow
Fix guide menu overflow [ci skip]
2024-06-26 16:03:06 -04:00
Rafael Mendonça França
9d671f17c7
Merge pull request #52225 from Earlopain/rdoc-hanging
Don't make rdoc generation take an unreasonable amount of time
2024-06-26 15:59:42 -04:00
Rafael Mendonça França
9f31032b74
Merge pull request #52199 from rubys/rubocop-mailer-generator
Fix mailer templates to be rubocop compliant
2024-06-26 15:54:39 -04:00
Earlopain
979e308312
Don't make rdoc generation take an unreasonable amount of time
On CI, this takes about 8 hours. On my PC I canceled after 3.

I suspect this comment in rdoc to be relevant (since this method is where it is stuck): 4b84660690/lib/rdoc/mixin.rb (L68-L71)
Removing a few includes eventually makes it complete. It doesn't seem to matter which ones you remove.

https://github.com/rails/rails/pull/52185 was the trigger for this.
2024-06-26 17:53:43 +02:00
Earlopain
540103c6eb
Fix rake rdoc when the timestamp file is empty
This happens when rdoc fails during generation as the timestamp
is only written on successful attemps. The file is created anyways though
2024-06-26 17:07:25 +02:00
Eugene Kenny
659150f000
Merge pull request #52221 from heka1024/remove-unused-constant
Remove unused constant in `MySQLDatabaseTasks`
2024-06-26 13:42:06 +01:00
Earlopain
d8534d40e4
Fix an extra newline in development.rb when sprocket gets skipped 2024-06-26 12:43:17 +02:00
heka1024
45c4802459 Remove unused constant in MySQLDatabaseTasks 2024-06-26 16:43:00 +09:00
Juan Camilo Bages
bcca960d12
Update getting_started.md
- change single quotes to double quotes
- pass article as a local variable instead of instance varialbe in `comments/_form.html.erb`
2024-06-26 02:58:17 -04:00
Louis-Michel Couture
1e4be48f95
Fix guide menu overflow [ci skip]
This is a follow-up to 92b65a0f7e8c07942547d93df4a60a64088ff53f.
It's also a temporary fix until we can find a better solution.
2024-06-25 09:47:26 -04:00
Petrik
a787333b04 Document action_mailer.perform_caching in environment files.
This setting is set to false in all enviroments, but it's a bit unclear
why this needs to be set.
2024-06-25 15:46:10 +02:00
Ben Sheldon [he/him]
fe03a19175
Document undefined local_assigns when using Strict Locals with defaults 2024-06-24 08:25:15 -07:00
Juan Vasquez
df64ba0a06 Use Thor for built-in stats task
Currently, we use both Thor and Rake for `bin/rails` commands.
We eventually want to get all the built-ins task promoted to Thor Commands.
This migrates the `stats` task to Thor.
2024-06-24 09:12:21 -06:00
Xavier Noria
de4d874474 Add a comment for dirname vs __dir__ usage 2024-06-24 10:35:43 +02:00
Xavier Noria
5f5aee9aca
Merge pull request #52184 from sajan45/ac_lib_path
Fix Action Cable loader path prefix
2024-06-24 10:24:20 +02:00
Jean Boussier
1690a3e083
Merge pull request #52205 from Shopify/local-assigns-strict-locals
Also pass `local_assigns` to strict locals templates
2024-06-24 10:09:02 +02:00
Jean Boussier
9ea92d4cda Also pass local_assigns to strict locals templates
If one of the locals conflict with a keyword, typically `class`.

The potentially confusing part however is that if you define a default
value, `local_assigns` won't respect it.
2024-06-24 09:16:03 +02:00
fatkodima
770b353896
Merge pull request #52195 from jaynetics/fix-ar-dirty-doc
Fix ActiveRecord dirty docs
2024-06-23 22:20:08 +03:00
Sam Ruby
0350187882 Fix mailer templates to be rubocop compliant
- spaces around array elements
- only emit blank lines between new blocks of code
2024-06-23 07:28:25 -04:00
heka1024
d98cfde86a Support immutable directive in Cache-Control 2024-06-23 08:49:34 +09:00
Janosch Müller
03a1af9b9b
Fix ActiveRecord dirty docs 2024-06-22 21:30:51 +02:00
Rafael Mendonça França
5bec50bc70
Merge pull request #50405 from skipkayhil/hm-filter-dbconfig-inspect
Add condensed #inspect for Pool, Adapter, Config
2024-06-21 17:45:53 -04:00
Rafael Mendonça França
5cfa13687d
Merge pull request #52185 from Shopify/vs/turn_action_controller_inclusions_explicit
Turn ActionController::Base inclusions explicit
2024-06-21 17:45:32 -04:00
Rafael Mendonça França
3a2ec9bb3a
Merge pull request #51740 from heka1024/parallel-upload-in-mirror-service
Improve performance in `ActiveStorage::Service::MirrorService`
2024-06-21 17:28:47 -04:00
Hartley McGuire
5c8172554f
Add condensed #inspect for Pool, Adapter, Config
Previously, it was very easy to accidentally leak a database password in
production logs if an error ends up calling inspect on a ConnectionPool
or an individual connection (Adapter). This is due to the default
`#inspect` output for Pools and Adapters being unnecessarily large, and
both currently including passwords (through the DatabaseConfig of a
Pool, and the internal configuration of an Adapter).

This commit addresses these issues by defining a custom `#inspect` for
ConnectionPool, AbstractAdapter, and DatabaseConfig. The condensed
`#inspect` only includes a few valuable fields instead of all of the
internals, which prevents both the large output and passwords from being
included.
2024-06-21 21:23:04 +00:00
Rafael Mendonça França
fc60a394c0
Merge pull request #52175 from y-yagi/correctly_generate_devcontainer_for_mysql2
Correctly generate Devcontainer setting for applications that using mysql2 gem
2024-06-21 17:09:17 -04:00
Vinicius Stock
0966b1983b
Turn ActionController::Base inclusions explicit
Currently, we are using dynamic inclusions to
guarantee that the list of MODULES is always up to
date with what gets included into Base. However,
that prevents static analysis tools from
understanding the ancestors of controllers, which
prevents completion and other editor features from
working correctly. We can instead use a unit test
to verify that both lists are synchronized, which
retains the original behavior while allowing for
more accurate static analysis.
2024-06-21 21:07:12 +00:00
Rafael Mendonça França
bc67961679
Merge pull request #52179 from Uaitt/Dockerfile-FromAsCasing-offenses
Fix `FromAsCasing` offense while building a Dockerfile
2024-06-21 16:59:59 -04:00
Jeremy Daer
eea3d5adcf Revert lazy routesets (#52012) due to polymorphic routing regression
References https://github.com/rails/rails/pull/52012#issuecomment-2183415161

Revert "Merge pull request #52033 from Shopify/amend_lazy_routes_changelog"

This reverts commit 743128b2307b6e1bd59acb9dc8358592d264c573, reversing
changes made to 6622075802bdcca22ab3e32ef6e3f6d2b9a881f8.

Revert "Merge pull request #52012 from Shopify/defer_route_drawing"

This reverts commit 6622075802bdcca22ab3e32ef6e3f6d2b9a881f8, reversing
changes made to 5dabff4b7bf4cc5e2e552efb78c6a3f3e44bed37.
2024-06-21 13:59:43 -07:00
Sajan
f0aaa3cfe8 Fix Action Cable loader path prefix
Since `__dir__` uses real path, when we load the gems from a symlinked path, Zeitwek loader
tries to load the ignored files and throws warnings or errors.
2024-06-21 15:07:54 +00:00
Lorenzo Zabot
9b43e91108 Fix FromAsCasing offenses while building a Dockerfile 2024-06-21 14:07:02 +02:00
Yuji Yaginuma
fd0d2de9ad Correctly generate Devcontainer setting for applications that using mysql2 gem
Currently, `devcontainer` command sets an adapter name, but
`DevcontainerGenerator` requires a database name.
16d8b82d5e/railties/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb (L11)
16d8b82d5e/railties/lib/rails/generators/database.rb (L6)

So the `devcontainer` command doesn't generate the setting for
MySQL. This fixes to generate the correct setting.
2024-06-21 17:16:40 +09:00
Jean Boussier
16d8b82d5e
Merge pull request #52161 from rubys/rubocop-empty-scaffolding
make "g scaffold" with no field produce rubocop compliant code
2024-06-21 08:20:17 +02:00
Sam Ruby
8eafbc1b19 make "g scaffold" with no field produce rubocop compliant code
When there are no fields:
  * Omit blank line in migration prior to "t.timestamps"
  * Omit leading and trailing spaced in empty hashes in
    create and update controller and api functional tests

Co-authored-by: zzak <zzakscott@gmail.com>
2024-06-20 22:11:09 -04:00
Yasuo Honda
7606f99649
Merge pull request #52172 from yahonda/selenium-webdriver-4220
Support selenium-webdriver 4.22.0 that enables CDP in Firefox by default
2024-06-21 10:20:48 +09:00
Yasuo Honda
1b905edd2e Support selenium-webdriver 4.22.0 that enables CDP in Firefox by default
This pull request supports selenium-webdriver 4.22.0 that enables CDP in Firefox by default.
because Firefox 129 deprecates Chrome DevTools Protocol (CDP).
selenium-webdriver 4.22.0 enables CDP explicitly by adding "remote.active-protocols"=>3 .

- Steps to reproduce and this commit addresses these failures.
```ruby
$ bundle update selenium-webdriver --conservative
$ git diff main ../Gemfile.lock
diff --git a/Gemfile.lock b/Gemfile.lock
index 4e1c049ac0..e05f4b3b3c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -512,8 +512,9 @@ GEM
       google-protobuf (~> 3.25)
     sass-embedded (1.69.6-x86_64-linux-gnu)
       google-protobuf (~> 3.25)
-    selenium-webdriver (4.20.1)
+    selenium-webdriver (4.22.0)
       base64 (~> 0.2)
+      logger (~> 1.4)
       rexml (~> 3.2, >= 3.2.5)
       rubyzip (>= 1.2.2, < 3.0)
       websocket (~> 1.0)
$ cd actionpack
$ bin/test test/dispatch/system_testing/driver_test.rb test/dispatch/system_testing/driver_test.rb
Running 18 tests in a single process (parallelization threshold is 50)
Run options: --seed 58668

.....F

Failure:
DriverTest#test_define_extra_capabilities_using_firefox [test/dispatch/system_testing/driver_test.rb:127]:
--- expected
+++ actual
@@ -1 +1 @@
-{"moz:firefoxOptions"=>{"args"=>["--host=127.0.0.1"], "prefs"=>{"browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"}
+{"moz:firefoxOptions"=>{"args"=>["--host=127.0.0.1"], "prefs"=>{"remote.active-protocols"=>3, "browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"}

bin/test test/dispatch/system_testing/driver_test.rb:113

.F

Failure:
DriverTest#test_define_extra_capabilities_using_headless_firefox [test/dispatch/system_testing/driver_test.rb:144]:
--- expected
+++ actual
@@ -1 +1 @@
-{"moz:firefoxOptions"=>{"args"=>["-headless", "--host=127.0.0.1"], "prefs"=>{"browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"}
+{"moz:firefoxOptions"=>{"args"=>["-headless", "--host=127.0.0.1"], "prefs"=>{"remote.active-protocols"=>3, "browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"}

bin/test test/dispatch/system_testing/driver_test.rb:130

..........

Finished in 0.007717s, 2332.3654 runs/s, 4794.3066 assertions/s.
18 runs, 37 assertions, 2 failures, 0 errors, 0 skips
```

- Planned Deprecation of CDP in Firefox
https://groups.google.com/a/mozilla.org/g/dev-platform/c/Z6Qu3ZT1MJ0?pli=1

- Add preference to enable CDP in Firefox by default
https://github.com/SeleniumHQ/selenium/pull/14091

- [rb] Add logger gem as a runtime dependency #14082
https://github.com/SeleniumHQ/selenium/pull/14082
2024-06-21 09:57:50 +09:00
Xavier Noria
242216803e
Merge pull request #52165 from rails/fxn/changelog
Register 8b173d9 in the guides CHANGELOG
2024-06-20 10:47:01 +02:00
Xavier Noria
b448202768 Register 8b173d9 in the guides CHANGELOG 2024-06-20 09:45:25 +02:00
Xavier Noria
13f4d0f624 Fixes typo 2024-06-20 08:30:40 +02:00
Hartley McGuire
03a399bb08
Merge pull request #52164 from sampatbadhe/patch-17
Correct table name in schema for add_reference migration in Active Record Migration Documentation [ci skip]
2024-06-20 00:31:33 -04:00
Sampat Badhe
dcadd27cdd
correct table name in schema for add_reference migration in Active Record Migration Documentation [ci skip] 2024-06-20 09:52:52 +05:30
Jean Boussier
3accb8d354
Merge pull request #52157 from byroot/lazy-ast
Lazily generate assertion failure messages
2024-06-19 20:53:29 +02:00
Jean Boussier
cac62630a3 Lazily generate assertion failure messages
Some of them can be a bit costly to generate, particularly
when inspecting very large objects or when accessing the AST
of procs.

Minitest supports passing the message as a callable, which allow
us to defer all these computations.
2024-06-19 20:06:42 +02:00
Petrik de Heus
ab7d62e127
Merge pull request #52156 from p8/guides/remove-zeitwerk-guide
Remove "Migrating from Classic to Zeitwerk" guide [ci-skip]
2024-06-19 17:44:35 +02:00
fatkodima
d11a5207be
Merge pull request #51993 from wonda-tea-coffee/fix-test-title-mismatch
Fix test title mismatch
2024-06-19 18:10:46 +03:00