Commit Graph

248 Commits

Author SHA1 Message Date
Rafael Mendonça França 7ee34d9efb
Enable Rails minitest plugin in our rake tasks 2024-05-23 16:16:37 +00:00
Rafael Mendonça França bf59d363fb
Clean CHANGELOG for 8.0 2024-05-13 16:55:52 +00:00
Rafael Mendonça França 37fd0e7fe4
Development of Rails 8.0 starts now
🎉
2024-05-13 16:45:20 +00:00
Jean Boussier 7263da542b Deprecate `ConnectionPool#connection`
Replaced by `#lease_connection` to better reflect what it does.

`ActiveRecord::Base#connection` is deprecated in the same way
but without a removal timeline nor a deprecation warning.

Inside the Active Record test suite, we do remove `Base.connection`
to ensure it's not used internally.

Some callsites have been converted to use `with_connection`,
some other have been more simply migrated to `lease_connection`
and will serve as a list of callsites to convert for
https://github.com/rails/rails/pull/50793
2024-03-01 14:32:55 +01:00
Igor Zubkov 96be09043f
Fix typos 2024-02-20 21:08:37 +01:00
Yasuo Honda 676fe1b8eb Address `Defining enums with keyword arguments` warning in Action Mailbox
This commit addresses `DEPRECATION WARNING: Defining enums with keyword arguments is deprecated and will be removed`
warning in Action Mailbox.

* Steps to reproduce
```ruby
git clone https://github.com/rails/rails
cd rails/actionmailbox
bundle install
bin/test test/unit/router_test.rb
```

* Without this commit
```
$ bin/test test/unit/router_test.rb
... snip ..
DEPRECATION WARNING: Defining enums with keyword arguments is deprecated and will be removed
in Rails 7.3. Positional arguments should be used instead:

enum :status, [:pending, :processing, :delivered, :failed, :bounced]
 (called from <class:InboundEmail> at /home/yahonda/src/github.com/rails/rails/actionmailbox/app/models/action_mailbox/inbound_email.rb:31)
Run options: --seed 65254

...............

Finished in 0.230357s, 65.1163 runs/s, 108.5271 assertions/s.
15 runs, 25 assertions, 0 failures, 0 errors, 0 skips
$
```

Follow up https://github.com/rails/rails/pull/50987
Refer to https://github.com/rails/rails/pull/51037
2024-02-14 12:13:46 +09:00
Petrik 8565f45100 Use relative includes of README's in documentation [ci-skip]
The Rails documentation uses the `:include:` directive to inline the
README of the framework into the main documentation page. As the
README's aren't in the root directory from where SDoc is run we need to
add the framework path to the include:

    # :include: activesupport/README.md

This results in a warning when installing the gems as generating the rdoc for the gem is run from the gem/framework root:

    Couldn't find file to include 'activesupport/README.rdoc' from lib/active_support.rb

The `:include:` RDoc directive supports includes relative to the current
file as well:

    # :include: ../README.md

This makes sure it works for the Rails API docs and the separate gems.

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2024-01-18 10:39:15 +01:00
Earlopain 45f64f5a0a
Remove workaround for `mail` gem dependencies
d9d8dcc6ba
https://github.com/rails/rails/pull/44083

Remove backwards compat workaround for versions earlier than 2.8.0
2024-01-09 13:25:36 +01:00
Hans Schnedlitz 482330d156
Do not generate pidfile in production environments (#50644)
* Remove pidfile in production

* Update changelog

* Update activestorage/test/dummy/config/puma.rb

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>

* Update template and other dummy files

---------

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
2024-01-08 14:47:25 -05:00
Jonathan Hefner 3bbf21c343 Use verb form of "fallback"
"Fallback" is a noun, whereas "fall back" is a verb.
2024-01-07 17:27:23 -06:00
Jonathan Hefner ff9b62417f Prepend `$` to example CLI commands [ci-skip]
This allows the syntax highlighter to recognize the code as CLI commands.
2024-01-07 17:27:23 -06:00
Jean Boussier 6ba2fdb2fe Bump the required Ruby version to 3.1.0
Until now, Rails only droped compatibility with older
rubies on new majors, but I propose to change this policy
because it causes us to either keep compatibility with long
EOLed rubies or to bump the Rails major more often, and to
drop multiple Ruby versions at once when we bump the major.

In my opinion it's a bad alignments of incentives. And we'd
be much better to just drop support in new minors whenever they
go EOL (so 3 years).

Also Ruby being an upstream dependency, it's not even
a semver violation AFAICT.

Since Rails 7.2 isn't planned before a few months, we
can already drop Ruby 3.0 as it will be EOL in March.
2023-12-31 08:54:03 +01:00
Chedli Bourguiba 1b97f97664 Take AR affixes into account for Action Mailbox database models 2023-12-09 11:02:30 +01:00
Hartley McGuire b8433879bc
Fix Action Mailbox tests
ActiveSupport::TestCase isn't defined until later in the file, so the
skip override can be added at the end to ensure it exists (similar to
what the Action Pack tests do)
2023-11-30 11:11:22 -05:00
Max Notarangelo 185c19c5ae fix typo in production initializer generator
And put "info" in quotes.
2023-11-16 15:00:07 -08:00
Adrian Hirt f0a03bd899 Remove `config.public_file_server.enabled` from generators
Remove the option `config.public_file_server.enabled` from the generators for all environments, as the value is the same in all environments.

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2023-11-03 11:34:37 -05:00
Jonathan Hefner dd428f1ef1 Present config.public_file_server.enabled as opt-out
Follow-up to #47137.

Since `config.public_file_server.enabled` is true by default, this
commit changes the `config/environments/production.rb` template to
present the setting as an opt-out.
2023-10-30 11:54:26 -05:00
Nikita Vasilevsky 19f8ab2e7d
[Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
Rafael Mendonça França 1f0262aa2b
Separate the CI environment from the application CI environment
Right now we are using both to test the Rails applications we generate
and to test Rails itself. Let's keep CI for the app and BUILDKITE to
the framework.
2023-10-04 09:36:51 +00:00
Bart de Water 95b6fbd00f Stop building AS::Notifications::Event manually
It's possible since Rails 6 (3ea2857943) to let the framework create Event objects, but the guides and docs weren't updated to lead with this example.

Manually instantiating an Event doesn't record CPU time and allocations, I've seen it more than once that people copy-pasting the example code get confused about these stats returning 0. The tests here show that - just like the apps I've worked on - the old pattern keeps getting copy-pasted.
2023-09-29 12:34:23 -04:00
fatkodima 7ef86b6a49 Enable `Lint/RedundantSafeNavigation` rubocop cop 2023-09-27 14:55:07 +03:00
Rafael Mendonça França fb6c6007d0
Development of Rails 7.2 starts now
🎉
2023-09-27 03:59:11 +00:00
Rafael Mendonça França e5386cb402
Preparing for 7.1.0.rc1 release 2023-09-27 03:08:31 +00:00
Rafael Mendonça França 699dfdb426
Preparing for 7.1.0.beta1 release 2023-09-13 00:36:01 +00:00
Ronan Limon Duparcmeur 3bac56e11f Added `bounce_now_with`
`ActionMailbox::Base#bounce_with` enqueues the bounce email. For
situations where it is preferable to skip the email queues, this
commit introduces `#bounce_now_with`, which sends the bounce email
immediately (like `deliver_now` vs. `deliver_later`).

    # Delivers the email immediately
    MyMailbox.bounce_now_with MyMailer.my_method(args)
2023-06-28 16:17:40 +02:00
zzak dd89f600f7
🔗 Remove RDoc auto-link from Rails module everywhere 2023-06-23 10:49:30 +09:00
zzak 073269c9b9
Merge pull request #48288 from zzak/rdoc-fixed-width-namespaces
Use short-form fixed-width RDoc form for namespaces
2023-05-25 07:14:47 +09:00
zzak e3c73fd183
Replace all occurrences of '<tt>(\w+::\w+)</tt>' with '+$1+'
E.g.:

* <tt>ActiveRecord::Base</tt> -> +ActiveRecord::Base+

Co-authored-by: Hartley McGuire <skipkayhil@gmail.com>
Co-authored-by: Petrik de Heus <petrik@deheus.net>
2023-05-25 06:52:32 +09:00
Jonathan Hefner 23243eb283
Merge pull request #46476 from justinperkins/fix/i18n-reserved-words-comments
Update comments in all three en.yml files relating to booleans
2023-05-24 13:58:38 -05:00
Justin Perkins ad1d2bed4a Clarify YAML boolean caveat in en.yml template
This clarifies that the boolean interpretation (1) is due to YAML rather
than I18n, (2) is case insensitive, and (3) affects both keys and
values.

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2023-05-24 13:35:53 -05:00
Rafael Mendonça França 61accb7dea
Merge pull request #45867 from jdufresne/show-rescuable-exceptions
Make the test environment show rescuable exceptions in responses
2023-05-24 13:45:45 -04:00
Hartley McGuire d028c14b03
Link rescue_from from modules including Rescuable
Also add some additional words to make it clear that the modules also
implement handling the exceptions configured with rescue_from, because
it was not immediately clear that happened without reading the code.
2023-05-18 12:54:16 -04:00
Jon Dufresne e28f147329 Make the test environment show rescuable exceptions in responses
Background
----------

During integration tests, it is desirable for the application to respond
as closely as possible to the way it would in production. This improves
confidence that the application behavior acts as it should.

In Rails tests, one major mismatch between the test and production
environments is that exceptions raised during an HTTP request (e.g.
`ActiveRecord::RecordNotFound`) are re-raised within the test rather
than rescued and then converted to a 404 response.

Setting `config.action_dispatch.show_exceptions` to `true` will make the
test environment act like production, however, when an unexpected
internal server error occurs, the test will be left with a opaque 500
response rather than presenting a useful stack trace. This makes
debugging more difficult.

This leaves the developer with choosing between higher quality
integration tests or an improved debugging experience on a failure.

I propose that we can achieve both.

Solution
--------

Change the configuration option `config.action_dispatch.show_exceptions`
from a boolean to one of 3 values: `:all`, `:rescuable`, `:none`. The
values `:all` and `:none` behaves the same as the previous `true` and
`false` respectively. What was previously `true` (now `:all`) continues
to be the default for non-test environments.

The new `:rescuable` value is the new default for the test environment.
It will show exceptions in the response only for rescuable exceptions as
defined by `ActionDispatch::ExceptionWrapper.rescue_responses`. In the
event of an unexpected internal server error, the exception that caused
the error will still be raised within the test so as to provide a useful
stack trace and a good debugging experience.
2023-05-17 06:30:28 -07:00
zzak f397f47212
Use double quotes for escaping yaml (re #47983) 2023-05-16 20:34:40 +09:00
Nishiki Liu 1df5ece43b feat: use config pk type in Action Mailbox migration 2023-05-04 08:19:36 -07:00
Josh Brito 43ec5737c7 Update comment to reference values with single quotes as opposed to double 2023-04-18 21:32:37 -07:00
zzak 87c73a3400
Hide the rest of Rails::Conductor from API docs 2023-04-06 17:00:18 +09:00
Petrik c09f5fa956 Add missing headers to Action Mailbox/Mailer/Text/View docs [ci-skip]
Having a h1 heading will improve SEO and makes things look more consistent.
2023-04-02 17:47:17 +02:00
Petrik 7c94708d24 Include READMEs in main framework pages of the API documentation
Currently when opening the main framework pages there is no introduction
to the framework. Instead we only see a whole lot of modules and the
`gem_version` and `version` methods.

By including the READMEs using the `:include:` directive each frameworks
has a nice introduction.
For markdown READMEs we need to add the :markup: directive.

[ci-skip]

Co-authored-by: zzak <zzakscott@gmail.com>
2023-03-21 21:16:28 +01:00
Andrew Novoselac 6902cbce1b Introducs `TestFixtures#fixture_paths`.
Multiple fixture paths can now be specified using the `#fixture_paths` accessor.
2023-03-14 19:02:56 -04:00
Deepak Mahakale e54fa13cdd
Add nodoc 2023-03-06 17:04:00 +05:30
Rafael Mendonça França e78ed07e00
Merge pull request #47259 from skipkayhil/hm-regenerate-dummies
Full refresh of framework dummy applications
2023-03-01 18:08:58 -05:00
Hartley McGuire ba028a48f6
Fix Action Mailbox, Action Text strict warnings
These appear to have been missed when the change was made in
d917896f45
2023-02-23 17:34:55 -05:00
zzak d2af670dba
Remove Copyright years (#47467)
* Remove Copyright years

* Basecamp is now 37signals... again

Co-authored-by: David Heinemeier Hansson <dhh@hey.com>

---------

Co-authored-by: David Heinemeier Hansson <dhh@hey.com>
2023-02-23 11:38:16 +01:00
Hartley McGuire 915159f524
Remove Webpacker files in Action Mailbox dummy app
Similar to 89a24d6216, but importmaps are
not added because no javascript is used in the app
2023-02-18 17:51:26 -05:00
Hartley McGuire 0e3a5331a1
Regenerate Action Mailbox dummy app
Generated using the following script and manually reviewed after:
skipkayhil/rails-bin@6898611730

The :messages route was removed because there isn't actually a
MessagesController.

config/boot.rb also has its Gemfile path fixed to point at the root
Gemfile because Action Mailbox does not have a Gemfile.
2023-02-18 17:51:22 -05:00
Yasuo Honda f838a74212
Merge pull request #46866 from ghousemohamed/change-year-2022-to-2023 2023-02-13 13:15:43 +09:00
Guillermo Iguaran 261f32d98d
Merge pull request #47245 from rikkipitt/master
Update ActionMailbox conductor index view
2023-02-07 12:17:05 -08:00
Jesse Johnson f4829b784a
ActionMailbox::IncinerationJobTest create test email without routing
Fixes #47020
2023-02-07 11:45:07 -08:00
binarygit 8381bc6eef
fix typo in action_mailbox/base.rb 2023-02-06 13:10:24 +05:45