Commit Graph

8517 Commits

Author SHA1 Message Date
Rafael Mendonça França
157f1df8fb
Require action_view/helpers instead of rails-html-sanitizer
This will avoid a warning about circular dependencies.

/circular require considered harmful.*rails-html-sanitizer/

This happens because `rails-html-sanitizer` requires `action_view/helpers`
that requires `action_view/helpers/sanitize_helper` that requires
`rails-html-sanitizer`.

I'll properly fix this in rails-html-sanitizer later removing the code
that needs to be added to ActionView::Helpers in that gem.
2024-05-31 20:25:06 +00:00
Rafael Mendonça França
5fea59c076
Rename template folder to avoid . prefix
The gemspec doesn't include files with the `.` prefix, so the released
gem didn't include the devcontainer templates. This commit renames the
folder to avoid the `.` prefix, following the same pattern as all
the other `.` templates.
2024-05-31 18:25:26 +00:00
Rafael Mendonça França
4e1750603e
Merge pull request #51959 from Earlopain/prism-test-parser-relax
Relax the prism test parser conditions
2024-05-30 17:57:55 -04:00
Earlopain
c7c974335d
Relax the prism test parser conditions
Checking explicitly against `test` break extensions that provide their
own methods to generate tests, like `minitest-spec-rails` or `minitest-rails`.

Fixes #51956
2024-05-30 22:28:38 +02:00
Chris Oliver
e360d1ee8c
Update public directory during app:update command 2024-05-30 18:52:22 +00:00
Jon Evans
b7f7b0cb2f
Switch example editor to code instead of mate
It's been almost 10 years since the last TextMate update. 😢

I've seen developers be confused here - "huh, what's mate?" - and while I do not want to be seen as advocating for a particular editor, I would bet that more developers are on VS Code than are still holding on to TextMate.
2024-05-29 19:56:25 -06:00
Jean Boussier
f719787c58 Restore automatic detection of processor count in default puma config
It has to be reverted because the previous implementation wasn't
cgroup aware so it would often start way too many processes on various
shared hosting platforms.

Thanks to https://github.com/ruby-concurrency/concurrent-ruby/pull/1038
concurrent-ruby 1.3 now offer a cgroups aware method to detect how
many processors we can actually use.
2024-05-29 16:46:51 +02:00
Rafael Mendonça França
bcba3f327a
Use docker.io as the default registry for Ruby images
The `registry.docker.com` registry isn't documented and have a delay
when pulling images. The `docker.io` registry is the default registry
for Docker images and is the one used by the Docker CLI.
2024-05-28 18:21:48 +00:00
wonda-tea-coffee
e71ba8f914 Fix typo 2024-05-27 18:58:28 +09:00
David Heinemeier Hansson
1b3fc3c82e
Change asset pipeline default to Propshaft in Rails 8 (#51799)
* Change asset pipeline default to Propshaft

* Use :all for stylesheets when propshaft is active

* Switch to using propshaft as the default (still need to find a way to tests against sprockets too)

* Fix tests that rely on sprockets being used

* Fix Propshaft tests (#51913)

* Update railties/test/generators/shared_generator_tests.rb

Co-authored-by: Lázaro Nixon <lazaronixon@hotmail.com>

---------

Co-authored-by: Lázaro Nixon <lazaronixon@hotmail.com>
2024-05-25 20:48:35 -07:00
Carlos Antonio da Silva
942be52465 Use the railties deprecator instead of creating a new one
Add tests to verify the app and helpers files deprecation / backwards
compatibility, and remove the `.rb` extension from the message, since we
generally require without them.
2024-05-24 15:19:13 -03:00
Carlos Antonio da Silva
46cd9f7406
Merge pull request #51839 from Shopify/keep-deprecated-files
Add app.rb and helpers.rb back for backward compatibility
2024-05-24 15:04:24 -03:00
eileencodes
d189cbcb56
Revert "Merge pull request #51614 from gmcgibbon/defer_route_drawing"
This reverts commit e97db3b3957781c781a61fb01265feb2b57688bb, reversing
changes made to a27a1751cfd499f69499e943f12e3400b55a323e.

This is breaking application routes when running without eager load enabled.
2024-05-24 09:59:41 -04:00
Stan Lo
0b18caccf2
Add app.rb and helpers.rb back
Those files were removed in #51760, but gems like `console1984` depend
on these files for legacy Rails console command extensions.
So keeping files around is required for backward-compatibility.
2024-05-24 06:24:50 +09:00
Rafael Mendonça França
b284f8b867
Merge pull request #51896 from rails/rm-make-invert-opt-in
Don't enable automatically_invert_plural_associations by default
2024-05-23 15:49:51 -04:00
Rafael Mendonça França
15381dd3b1
Merge pull request #51894 from rails/rm-enable-yjit
Move plumbing to enable yjit to inside the framework
2024-05-23 15:19:39 -04:00
Rafael Mendonça França
a8a848d76e
Don't enable automatically_invert_plural_associations by default
This can cause a lot of issues that are hard to detect.

It is better to make this opt-in for people that want to use it.

In Rails 8 we can revisit if we want to enable this config by default.
2024-05-23 19:15:01 +00:00
Rafael Mendonça França
30e6a197df
Move plumbing to enable yjit to inside the framework
There is no reason to expose all those details to users and this
has the benefit that now are can ensure that the YJIT is enabled
after all initialization is done.
2024-05-23 19:01:29 +00:00
Andrew Novoselac
df203b2e90
Create a devcontainer command
This command boots the application, and generates a Dev Container setup based on the current configuration of the application.
2024-05-23 18:50:51 +00:00
Andrew Novoselac
4d62ea3ed4
Update database.yml from DevcontainerGenerator
Postgresql's database.yml has devcontainer specific logic that should only appear when the app has a devcontainer. We need the DevcontainerGenerator to update database.yml, so when it is called by the devcontainer command the database.yml will have the right configuration.

This commit also fixes db:system:change to make sure it updates the database.yml with the correct devcontainer configuration.
2024-05-23 18:43:22 +00:00
Andrew Novoselac
1275e93594
Update application_system_test_case.rb from DevcontainerGenerator
Instead of relying on the template to be dev container aware and generate the correct configuration, let's just update the configuration in place when running the DevcontainerGenerator. This will allow the devcontainer command to update this file with the configuration needed for devcontainers without overwriting the entire file.
2024-05-23 18:43:21 +00:00
Andrew Novoselac
f31b6f02ea
Extract Dev Container implementation into its own generator
This refactoring prepares the way to implement a devcontainer command to add an devcontainer to an existing app.
2024-05-23 18:43:20 +00:00
Andrew Novoselac
a61bfe49a5
Make devcontainer opt-in when creating a new application
For Rails 7.2 we will make devcontainer and opt-in feature for new applications. When creating a new app, you can generate a devcontainer by passing the --devcontainer flag.
2024-05-23 18:43:19 +00:00
Rafael Mendonça França
c906f75282
Merge pull request #51822 from excid3/plugin-github-actions
Add rubocop and GitHub Actions to plugin generator
2024-05-23 14:08:58 -04:00
Rafael Mendonça França
97cc321280
Point to the right executable when warning about --profile 2024-05-23 16:19:53 +00:00
Rafael Mendonça França
7ee34d9efb
Enable Rails minitest plugin in our rake tasks 2024-05-23 16:16:37 +00:00
Yasuo Honda
5c92d45e8a
Merge pull request #51838 from jeromedalbert/no-kamal-storage-volume-if-not-needed
Don’t configure Kamal storage volume if not needed
2024-05-21 08:46:26 +09:00
Yasuo Honda
ba6e556f39
Merge pull request #51837 from jeromedalbert/no-storage-if-not-needed-1
Don’t create storage folder if not needed
2024-05-21 08:45:57 +09:00
Jerome Dalbert
3156e50838
Don’t configure Kamal storage volume if not needed
Configuring a persistent storage volume in Kamal
is needed only for sqlite or Active Storage. If
using a different database or the
--skip-active-storage option, this configuration
can be skipped.
2024-05-19 18:30:36 -07:00
Stan Lo
53a0b8c662
Improve Rails console helper methods' descriptions 2024-05-19 23:03:26 +09:00
Chris Oliver
7594a73942
Add rubocop and GitHub Actions to plugin generator
When creating new Rails plugins, rubocop and GitHub Actions are now
included to make linting and testing easier.
2024-05-18 09:19:12 -05:00
Jerome Dalbert
918c71fa5a Don’t create storage/ directory if not needed
The storage/ directory is used for sqlite or
Active Storage. If using a different database
and the --skip-active-storage option, this
directory is not needed.
2024-05-17 10:52:15 -07:00
David Heinemeier Hansson
427fe4a6c5
By definition, new apps wont have any deprecations to worry about. So dont expose those controls for new apps by default (#51831) 2024-05-15 12:02:07 -07:00
Joé Dupuis
478874ae1b
Add active_record.postgresql_adapter_decode_dates
to toggle automatic decoding of dates column with the
PostgresqlAdapter.

PR #51483 is a breaking change and should have been gated behind a
config.
2024-05-15 18:38:08 +00:00
David Heinemeier Hansson
f0572dc6c3 Missing CR for style 2024-05-14 16:57:31 -07:00
David Heinemeier Hansson
33592402f9 Remove default .env from Kamal and just rely on .env.erb (Closes #51829) 2024-05-14 15:36:43 -07:00
Carlos Antonio da Silva
5e3611ea5a
Merge pull request #51732 from Shopify/fix-rails-console-prompt
Avoid setting fixed app name in console prompt
2024-05-14 18:56:21 -03:00
Rafael Mendonça França
d60890c653
Merge pull request #51828 from Shopify/refacotor-change-generator
Refactor change generator database implementation
2024-05-14 16:51:23 -04:00
Andrew Novoselac
764489b095 Refactor change generator database implementation
The database object does not need to know about the other packages in the Dockerfile. This info is only needed for the change generator so lets move it there.
2024-05-14 15:59:01 -04:00
Andrew Novoselac
08d82adf80 Remove Oracle, SQLServer and Jbdc templates
These are no longer used as of rails/rails@5b91084 so the templates can be removed.
2024-05-14 14:56:49 -04:00
David Heinemeier Hansson
bee3fa41ca
Add Kamal by default to Rails 8 (#51798)
* Add Kamal by default
2024-05-13 17:32:42 -07:00
Rafael Mendonça França
66eda9c1d9
Merge pull request #51789 from Shopify/reference-devcontainer-guides-in-dockerfile
Reference the dev container guides in a comment in the production doc…
2024-05-13 14:29:20 -04:00
Rafael Mendonça França
a70d89c519
Merge pull request #51766 from Shopify/revert-actionable-errors-retry
Revert "Merge pull request #50941 from andrewn617/actionable-cli"
2024-05-13 18:28:42 +00:00
Rafael Mendonça França
cb1c789ca2
Merge pull request #51765 from Shopify/refactor-devcontainer-implementation
Clean up database generators implementation
2024-05-13 14:19:44 -04:00
Andrew Novoselac
eeec15c02c Point user to devcontainer for containerized dev environment 2024-05-13 14:12:14 -04:00
Rafael Mendonça França
5c933a3d82
Merge pull request #51791 from duduribeiro/add-name-to-devcontainer-compose
Add name to DevContainer compose file
2024-05-13 14:10:47 -04:00
Andrew Novoselac
c1bc7ee82e Refactoring Database generators
Extract all the DB information (gems, dockerfile packages, devcontainer etc.) into an object. This let's us remove the growing number of case statements in this code.
2024-05-13 14:07:47 -04:00
Andrew Novoselac
5b91084f20 Remove support for oracle, sqlserver and JRuby specific database adapters from the new and db:system:change commands. The supported options are sqlite3, mysql, postgresql and trilogy. 2024-05-13 14:07:47 -04:00
Cadu Ribeiro
f63d344ce9 Add name to DevContainer compose file
Currently when you generate a project the compose.yaml generated
file does not include the top-level name property. Not having this
top-level name property makes all containers / volumes started by
devcontainer to be prepended with the folder name, which is
`devcontainer` in the case of the .devcontainer/compose.yml` file.

This is ok if you run only one project with devcontainer but starts
to get problem if you run multiple projects. If you have one project
that runs on postgresql 15 and a new one that runs on postgresql 16 it
will fail to boot the postgresql container because both devcontainers is
using the same volume: `devcontainer_postgres-data`.

This commit fixes this by setting the top-lavel name property with
the project name, which will make the containers and volumes to be
prepended with the project name and not with `devcontainer`.
2024-05-13 14:26:46 -03:00
Rafael Mendonça França
dc96d29d2b
Reapply "Rails 8 will target Ruby 3.3+ only for new apps"
This reverts commit 64ab211892ba53a5709bcb543121337df45e0c81.
2024-05-13 16:46:39 +00:00