-
Notifications
You must be signed in to change notification settings - Fork 316
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
feat(ijwb): add environment variables to the run configuration #4138
Conversation
Hey @JamyDev, thank you for this PR! I have two general questions related to the code:
|
return ImmutableList.of(command, envVarsState, blazeFlags, exeFlags, blazeBinary); | ||
} | ||
|
||
/** @return The list of blaze flags that the user specified manually. */ |
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.
Please update the comment to match the function return value.
|
||
private static final String ELEMENT_TAG = "env_state"; | ||
|
||
private EnvironmentVariablesData data = | ||
EnvironmentVariablesData.create(ImmutableMap.of(), /* passParentEnvs= */ true); | ||
|
||
private final BlazeCommandState command; |
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 think it will be simpler to store a boolean of whether the command is supported and check it when needed.
@@ -38,10 +38,6 @@ protected ImmutableList<RunConfigurationState> initializeStates() { | |||
return ImmutableList.of(command, blazeFlags, exeFlags, envVars, debugPortState, blazeBinary); | |||
} | |||
|
|||
EnvironmentVariablesState getEnvVarsState() { |
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'm not sure why this method is removed here and in BlazePyRunConfigState.java
Thanks @JamyDev! I also was not able to see the environment variables for |
Thanks for the comments, I'll address them sometime soon. |
Thank you for contributing to the IntelliJ repository! This pull request has been marked as stale since it has not had any activity in the last 6 months. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-review". Please reach out to the triage team ( |
This pull request has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team ( |
Checklist
Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.
Discussion thread for this change
Issue number: #2042
Description of this change
This adds the option to set environment variables to your run configuration for any target type. For
Test
configurations--test_env
should be used and thus this field is only shown when set toRun
.Reused the
EnvironmentVariablesData
that was used in the Python module and applied it everywhere by passing it as an argument toScopedBlazeProcessHandler
, which then passes it onto the ProcessGroup using.withEnvironment
.Since
Go
handles the Run Configuration differently, we make sure to add the environment variables there as well, in this case as the last one so the user can override variables set elsewhere.Screenshots:
(this was a go_binary target but I had to modify it for reasons, so it changed it to generic handler)