Commit Graph

235 Commits

Author SHA1 Message Date
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
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 (3ea2857943dc294d7809930b4cc5b318b9c39577) 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
d917896f45ad680f43036d8ff6d48d7e5e198d23
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 89a24d6216eb771c1d9bdb7cef883ca50001ca93, 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
zzak
f8544410a2 Use stable guides link for package READMEs
E.g.: These show up here:
https://api.rubyonrails.org/files/actioncable/README_md.html
2023-02-04 09:01:00 +09:00
Rikki Pitt
fef4d0fe28
Update ActionMailbox conductor index view
Move links to create new inbound emails to the top of the page.
2023-02-03 13:22:31 +00:00
Petrik
6e89ae2d2e Use infinitive form verb for all task descriptions
All the common rails commands and some extended commands use the
infinitive form for the verb in the description. This changes the
remaining tasks to use the infinitive form verb as well, for
consistency.

__Before__

```console
$ bin/rails --help
...
action_mailbox:install             Installs Action Mailbox and its dependencies
...
app:template                       Applies the template supplied by LOCATION=(/path/to/template) or URL
...
credentials:diff                   Enrolls/disenrolls in decrypted diffs of credentials using git
credentials:edit                   Opens the decrypted credentials in `$EDITOR` for editing
credentials:show                   Shows the decrypted credentials
db:create                          Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use...
db:drop                            Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use d...
...
db:fixtures:load                   Loads fixtures into the current environment's database
db:migrate                         Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
db:migrate:down                    Runs the "down" for a given migration VERSION
db:migrate:redo                    Rolls back the database one migration and re-migrates up (options: STEP=x, VERSION=x)
db:migrate:up                      Runs the "up" for a given migration VERSION
db:prepare                         Runs setup if database does not exist, or runs migrations if it does
db:reset                           Drops and recreates all databases from their schema for the current environment and loads th...
db:rollback                        Rolls the schema back to the previous version (specify steps w/ STEP=n)
db:schema:cache:clear              Clears a db/schema_cache.yml file
db:schema:cache:dump               Creates a db/schema_cache.yml file
db:schema:dump                     Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['...
db:schema:load                     Loads a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SC...
db:seed                            Loads the seed data from db/seeds.rb
db:seed:replant                    Truncates tables of each database for current environment and loads the seeds
db:setup                           Creates all databases, loads all schemas, and initializes with the seed data (use db:reset t...
db:system:change                   Changes `config/database.yml` and your database gem to the target database
db:version                         Retrieves the current schema version number
destroy                            Removes code generated by `bin/rails generate`
dev:cache                          Toggles development mode caching on/off
encrypted:edit                     Opens the decrypted file in `$EDITOR` for editing
encrypted:show                     Shows the decrypted contents of the file
...
log:clear                          Truncates all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test...
middleware                         Prints out your Rack middleware stack
notes                              Shows comments in your code annotated with FIXME, OPTIMIZE, and TODO
...
routes                             Lists all the defined routes
runner                             Runs Ruby code in the context of your application
...
secrets:edit                       Opens the secrets in `$EDITOR` for editing
secrets:show                       Shows the decrypted secrets
...
tmp:create                         Creates tmp directories for cache, sockets, and pids
version                            Shows the Rails version
...
zeitwerk:check                     Checks project structure for Zeitwerk compatibility
```

__After__

```console
$ bin/rails --help
...
action_mailbox:install             Install Action Mailbox and its dependencies
...
app:template                       Apply the template supplied by LOCATION=(/path/to/template) or URL
...
credentials:diff                   Enrolls/disenrolls in decrypted diffs of credentials using git
credentials:edit                   Opens the decrypted credentials in `$EDITOR` for editing
credentials:show                   Shows the decrypted credentials
db:create                          Create the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use ...
db:drop                            Drop the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db...
...
db:fixtures:load                   Load fixtures into the current environment's database
db:migrate                         Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
db:migrate:down                    Run the "down" for a given migration VERSION
db:migrate:redo                    Roll back the database one migration and re-migrate up (options: STEP=x, VERSION=x)
db:migrate:status                  Display status of migrations
db:migrate:up                      Run the "up" for a given migration VERSION
db:prepare                         Run setup if database does not exist, or run migrations if it does
db:reset                           Drop and recreate all databases from their schema for the current environment and load the s...
db:rollback                        Roll the schema back to the previous version (specify steps w/ STEP=n)
db:schema:cache:clear              Clear a db/schema_cache.yml file
db:schema:cache:dump               Create a db/schema_cache.yml file
db:schema:dump                     Create a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['S...
db:schema:load                     Load a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SCH...
db:seed                            Load the seed data from db/seeds.rb
db:seed:replant                    Truncate tables of each database for current environment and load the seeds
db:setup                           Create all databases, load all schemas, and initialize with the seed data (use db:reset to a...
db:system:change                   Change `config/database.yml` and your database gem to the target database
db:version                         Retrieve the current schema version number
destroy                            Remove code generated by `bin/rails generate`
dev:cache                          Toggle development mode caching on/off
encrypted:edit                     Open the decrypted file in `$EDITOR` for editing
encrypted:show                     Show the decrypted contents of the file
...
log:clear                          Truncate all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test...
middleware                         Print out your Rack middleware stack
notes                              Show comments in your code annotated with FIXME, OPTIMIZE, and TODO
...
routes                             List all the defined routes
runner                             Run Ruby code in the context of your application
...
secrets:edit                       Open the secrets in `$EDITOR` for editing
secrets:show                       Show the decrypted secrets
...
tmp:create                         Create tmp directories for cache, sockets, and pids
version                            Show the Rails version
...
zeitwerk:check                     Check project structure for Zeitwerk compatibility
```

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2023-02-01 22:43:04 +01:00
George Claghorn
4914529180
Revert "Add nodoc to Mail module [ci-skip]" 2023-01-28 16:57:04 -05:00
David Heinemeier Hansson
2b1fa89e44
Log to stdout in production by default (#47138)
* Logging to a file doesn't make sense in production

You're going to run out of space, and it doesn't play well with containers. Either you log to STDOUT, and let your container setup aggregate the logs, or you'll be switching to syslogger or whatever. You won't be logging to a file in production any more.

* Remove from Dockerfile too

* Did not mean to change this default

But we should make it easy to see how to change it.

* Restore what we had
2023-01-25 21:10:22 +01:00
David Heinemeier Hansson
e8f481b924
Turn on static file server by default (#47137)
Modern deployments don't need NGINX/Apache when using CDNs or caching LBs in front. This means file serving works out of the box too.
2023-01-25 18:19:05 +01:00
Alex Ghiculescu
e18c23fc2b Make raise_on_missing_translations raise on any missing translation
Fixes https://github.com/rails/rails/issues/47057
Superseeds https://github.com/rails/rails/pull/45361
2023-01-23 10:17:11 -07:00
Petrik de Heus
c20998c00d
Revert "Remove changelog entry for bugfix [#46300]" 2023-01-22 14:49:24 +01:00
zzak
b8bc9ec9c2 Remove changelog entry for bugfix [#46300]
We usually only put features / major changes in the changelog

ref: https://github.com/rails/rails/pull/46879#issuecomment-1375676523
2023-01-21 10:24:09 +09:00
Rafael Mendonça França
39baf27007
Merge pull request #46300 from honzasterba/honzasterba/mailbox_ingress_encoding_fix
Fix ingress controllers' ability to accept non UTF-8 encoded emails
2023-01-20 17:31:21 -05:00
Rafael Mendonça França
5c835bd669
Make explicit this config only affects controllers are views 2023-01-19 20:21:29 +00:00
Jean Boussier
47f21c5aea
Merge pull request #46993 from skipkayhil/fix-actionmailbox-requires
Fix missing requires in Action Mailbox
2023-01-19 17:00:51 +01:00
Yasuo Honda
07d32aada7 Add rake test:isolated for Action Mailbox
This commit adds isolated test for Action Mailbox
```
$ cd actionmailbox
$ bundle exec rake test:isolated
```
2023-01-16 14:38:17 +09:00