-
Notifications
You must be signed in to change notification settings - Fork 31
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
Impersonation in E2E #704
Impersonation in E2E #704
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.
Looks good to me, but maybe we can revisit that overlap between env and argument booleans.
options.debug ??= Boolean( | ||
process.env.DEBUG && process.env.DEBUG !== "false", | ||
); | ||
options.debug ||= envBool("DEBUG"); |
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.
I guess I’m missing something, but this seems like a weird behaviour to me:
- If env var
DEBUG
is not set, then argument--debug
will be used -> fine - If env var
DEBUG
is set to “false” or “no”, then argument--debug
will be used -> ?? - If env var
DEBUG
is set to “true” or “yes”, then env var will be used -> ??
It seem inconsistent to me.
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.
I see your point, but it's not so easy. The previous behavior was completely broken, because ??=
only has an effect on nullish values, but the way we've configured minimist, it returns false
when a bool argument such as --debug
is missing. Thus, it was impossible to enable debugging via the environment. In that sense, this is already an improvement.
The problem is this:
Note: options can also be set via corresponding environment variables,
e.g. --chain-id can be set via CHAIN_ID instead. Parameters take precedence over variables.
"Parameters take precedence" over variables, but a parameter declared boolean
in minimist options is set to false
by being omitted. So currently, there's no way to tell the difference between no --debug
option being passed or explicitly passing e.g. --debug=false
.
I guess we could remove the list of boolean options from the minimist config altogether, and do our own parsing...
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.
No description provided.