Warn when perron:build is not run in production mode#149
Merged
eelcoj merged 2 commits intoRails-Designer:mainfrom Feb 26, 2026
Merged
Warn when perron:build is not run in production mode#149eelcoj merged 2 commits intoRails-Designer:mainfrom
eelcoj merged 2 commits intoRails-Designer:mainfrom
Conversation
The previous set_production_env task set ENV["RAILS_ENV"] but couldn't actually change the memoized Rails.env, so the build still ran in development mode. Instead of fighting the Rails boot sequence, warn the user when not running in production and let them decide.
cd76ce6 to
9149270
Compare
Contributor
|
I like this! Bonus points for the emojis! 😄 💯 Thanks! ❤️ |
This file contains hidden or 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
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.
Summary
set_production_envrake task from Default RAILS_ENV to production for perron:build #121 setENV["RAILS_ENV"]but couldn't change the memoizedRails.env(which is set before any rake tasks execute), so the build still ran in development modeRAILS_ENV=production bin/rails perron:buildFixes the issue reported in #121 (comment)
Example output
Test plan
bin/rails perron:buildwithout RAILS_ENV — should print a warning with the correct commandRAILS_ENV=production bin/rails perron:build— should produce no warning