New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run after_bundle
blocks with app:template
command
#48269
Merged
guilleiguaran
merged 1 commit into
rails:main
from
jonathanhefner:app_template-command-run-after_bundle-blocks
May 21, 2023
Merged
Run after_bundle
blocks with app:template
command
#48269
guilleiguaran
merged 1 commit into
rails:main
from
jonathanhefner:app_template-command-run-after_bundle-blocks
May 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App templates may contain `after_bundle` blocks which should be run after the template is executed, after running `bundle install`. For example: ```ruby gem "devise" after_bundle do generate "devise:install" end ``` Prior to this commit, `bundle install` and `after_bundle` blocks were run only when applying a template via `rails new`. This commit makes `bin/rails app:template` run them as well. Co-authored-by: "Gerard (Gerry) Caulfield" <git@caulfield.me>
jonathanhefner
force-pushed
the
app_template-command-run-after_bundle-blocks
branch
from
May 21, 2023 19:35
6c6fb81
to
83e69c2
Compare
guilleiguaran
approved these changes
May 21, 2023
Thank you @jonathanhefner 😅 |
This makes me so happy! I won't miss re-running |
zzak
added a commit
to zzak/rails
that referenced
this pull request
Oct 31, 2023
When rails#48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run. We want to avoid running these commands in our tests because they are very expensive. It is up to the gem (importmap, etc) to test the behavior of the install command, not railties. Before ``` $ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s. 274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips ``` After ``` Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s. 276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips ```
zzak
added a commit
to zzak/rails
that referenced
this pull request
Dec 1, 2023
When rails#48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run. We want to avoid running these commands in our tests because they are very expensive. It is up to the gem (importmap, etc) to test the behavior of the install command, not railties. Before ``` $ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s. 274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips ``` After ``` Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s. 276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips ```
zzak
added a commit
to zzak/rails
that referenced
this pull request
Dec 31, 2023
When rails#48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run. We want to avoid running these commands in our tests because they are very expensive. It is up to the gem (importmap, etc) to test the behavior of the install command, not railties. Before ``` $ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s. 274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips ``` After ``` Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s. 276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips ```
zzak
added a commit
to zzak/rails
that referenced
this pull request
Jan 10, 2024
When rails#48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run. We want to avoid running these commands in our tests because they are very expensive. It is up to the gem (importmap, etc) to test the behavior of the install command, not railties. Before ``` $ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s. 274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips ``` After ``` Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s. 276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips ```
zzak
added a commit
to zzak/rails
that referenced
this pull request
Apr 19, 2024
When rails#48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run. We want to avoid running these commands in our tests because they are very expensive. It is up to the gem (importmap, etc) to test the behavior of the install command, not railties. Before ``` $ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s. 274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips ``` After ``` Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s. 276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips ```
zzak
added a commit
to zzak/rails
that referenced
this pull request
May 18, 2024
When rails#48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run. We want to avoid running these commands in our tests because they are very expensive. It is up to the gem (importmap, etc) to test the behavior of the install command, not railties. Before ``` $ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s. 274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips ``` After ``` Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s. 276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips ```
zzak
added a commit
to zzak/rails
that referenced
this pull request
May 18, 2024
When rails#48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run. We want to avoid running these commands in our tests because they are very expensive. It is up to the gem (importmap, etc) to test the behavior of the install command, not railties. Before ``` $ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s. 274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips ``` After ``` Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s. 276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips ``` Change railties default log_level to :error The default of :info generates a ton of unnecessary noise in the railties logs. This change greatly reduces the amount of noise in the railties tests. **After** ``` $ bundle exec rake test >> railties_output_patched 2>&1 $ wc -l railties_output_patched 1491 railties_output_patched ``` **Before** ``` $ bundle exec rake test >> railties_output_unpatched 2>&1 $ wc -l railties_output_unpatched 19023 railties_output_unpatched ```
zzak
added a commit
that referenced
this pull request
May 18, 2024
When #48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run. We want to avoid running these commands in our tests because they are very expensive. It is up to the gem (importmap, etc) to test the behavior of the install command, not railties. Before ``` $ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s. 274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips ``` After ``` Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s. 276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips ``` Change railties default log_level to :error The default of :info generates a ton of unnecessary noise in the railties logs. This change greatly reduces the amount of noise in the railties tests. **After** ``` $ bundle exec rake test >> railties_output_patched 2>&1 $ wc -l railties_output_patched 1491 railties_output_patched ``` **Before** ``` $ bundle exec rake test >> railties_output_unpatched 2>&1 $ wc -l railties_output_unpatched 19023 railties_output_unpatched ```
zzak
added a commit
that referenced
this pull request
May 18, 2024
When #48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run. We want to avoid running these commands in our tests because they are very expensive. It is up to the gem (importmap, etc) to test the behavior of the install command, not railties. Before ``` $ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s. 274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips ``` After ``` Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s. 276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips ``` Change railties default log_level to :error The default of :info generates a ton of unnecessary noise in the railties logs. This change greatly reduces the amount of noise in the railties tests. **After** ``` $ bundle exec rake test >> railties_output_patched 2>&1 $ wc -l railties_output_patched 1491 railties_output_patched ``` **Before** ``` $ bundle exec rake test >> railties_output_unpatched 2>&1 $ wc -l railties_output_unpatched 19023 railties_output_unpatched ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
App templates may contain
after_bundle
blocks which should be run after the template is executed, after runningbundle install
. For example:Prior to this commit,
bundle install
andafter_bundle
blocks were run only when applying a template viarails new
. This commit makesbin/rails app:template
run them as well./cc @gerrywastaken I've added you as a co-author for your work on #40197.
/cc @quintrino Since you expressed interest #40197.