-
Notifications
You must be signed in to change notification settings - Fork 341
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
Assign envs before preload #267
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR, some comments:
Thanks! |
Thanks @jonleighton for the extensive feedback! |
I took a look at this the other day and realised that it needs some more fundamental changes to make it work properly. I'll come back to it at some point when I can, but it might take me a while I'm afraid. |
If I can help in the process; let me know! 🍰 |
5f43198
to
5f51d14
Compare
5f51d14
to
c6471b4
Compare
@jonleighton can we give this PR another try? I rebased and updated the code to make it pass. The original issue is solved now: This is not perfect as we still don't fully 'watch' WDYT? |
@eval Sorry for the slow reply. I'll take another look. |
# ...and ENV-keys whose values have not changed since the start of spring | ||
allowed_keys += original_env.select {|k, v| ENV[k] == v }.keys | ||
# never allowed: | ||
allowed_keys -= %w(RUBYOPT RUBY_ROOT BUNDLE_GEMFILE GEM_ROOT GEM_HOME GEM_PATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this protect against? I'm just concerned about whether this will lead to potential confusion. If someone is fiddling with these vars maybe it's better to just assume they know what they're doing. But maybe you envisaged a scenario where not excluding these vars will cause particular problems?
@eval This looks good to me. Could rebase it please? Could you also document how we treat the |
Currently ENV's of the client are not up to date during initialization of the app.
When having the following in
config/application.rb
The following occurs:
FORCE_SSL=1 RAILS_ENV=test bin/rails runner 'p Rails.application.config.force_ssl' # => true
RAILS_ENV=development bin/rails runner 'p Rails.application.config.force_ssl' # => true
If you reverse these steps, the result for both steps would be
false
.Obviously we want 1 to yield true, and 2 to yield false.