-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Packages / Env: Allow cast file or default to string #22164
base: main
Are you sure you want to change the base?
Packages / Env: Allow cast file or default to string #22164
Conversation
|
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.
recognize file as string by default
@joselcvarela Not sure about this point, since it would introduce different behavior for _FILE
variables vs. "plain" variables, and in particular that type mapping would no longer apply to files.
allow file to be casted to another type like array or json
I understand the need for this, though 👍 Would it be sufficient to just implement this point? Then it would also not be a breaking change.
Is it an option here to just make sure files are always read as |
IMO |
@paescuj So what exactly are you suggesting? Either they currently already do behave the same right (even tho there is no real defined behavior for something like |
Yeah, applying the following change from this PR
while dropping this one
|
Ah so you want to keep the type guessing when not explicitly casting the type then? As my first comment said my preference would definitely go out to relying less on the The long term goal for environment variables is reduce the reliance on casting and eventually have them all be treated as |
Exactly, I don't see why we should treat
Yeah, I agree and also think that's still the goal. But I'd rather address that separately. It should be sufficient for now to allow |
Scope
It is possible to pass a file to env by using
<CONFIG>_FILE
and the value should be the location of the file.Currently this file is sometimes being recognized as
array
,json
or any other type as the value is always casted and the type is guessed when there are no more information.In this PR we:
array
orjson
What's changed:
Potential Risks / Drawbacks
Review Notes / Questions