-
Notifications
You must be signed in to change notification settings - Fork 133
IEP-1628: Remove conflicting System env variables for export command #1305
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -471,6 +471,7 @@ protected IStatus runCommand(List<String> arguments, MessageConsoleStream consol | |||||||||||||||
| Logger.log(cmdMsg); | ||||||||||||||||
|
|
||||||||||||||||
| Map<String, String> environment = new HashMap<>(IDFUtil.getSystemEnv()); | ||||||||||||||||
| Logger.log("Environment Variables from System:"); | ||||||||||||||||
| Logger.log(environment.toString()); | ||||||||||||||||
| environment.put("PYTHONUNBUFFERED", "1"); //$NON-NLS-1$ //$NON-NLS-2$ | ||||||||||||||||
|
Comment on lines
+474
to
476
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainStop logging full environment (secrets/PII risk). - Logger.log("Environment Variables from System:");
- Logger.log(environment.toString());
+ // Avoid logging full environment; contains secrets.
@@
-
- Logger.log("Environment Variables after filtering from system:");
- IDFUtil.cleanUpSystemEnvironment(environment);
- Logger.log(environment.toString());
-
+ IDFUtil.cleanUpSystemEnvironment(environment);Also applies to: 492-495 🏁 Script executed: #!/bin/bash
# Find other places that log entire environment maps/values
rg -nP -C1 '(environment\\.toString\\(\\)|Logger\\.log\\(.+Environment Variables)' -g '!**/target/**' .Length of output: 72 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Searching for environment.toString occurrences..."
rg -n -C1 --hidden --no-ignore 'environment\.toString\(' -g '!**/target/**' . || true
echo "Searching for Logger.log(...) containing 'Environment Variables'..."
rg -n -C1 --hidden --no-ignore 'Logger\.log\([^)]*Environment Variables' -g '!**/target/**' . || true
echo "Searching for Logger.log(...) that logs environment.toString..."
rg -n -C1 --hidden --no-ignore 'Logger\.log\([^)]*environment\.toString\(' -g '!**/target/**' . || true
echo "Searching for System.getenv / System.getProperty usages..."
rg -n -C1 --hidden --no-ignore 'System\.getenv\(|System\.getProperty\(' -g '!**/target/**' . || true
echo "Done"Length of output: 245 Stop logging full environment (secrets risk). File: bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ToolsJob.java — lines 474–476 and 492–495 - Logger.log("Environment Variables from System:");
- Logger.log(environment.toString());
+ // Avoid logging full environment; contains secrets.
@@
-
- Logger.log("Environment Variables after filtering from system:");
- IDFUtil.cleanUpSystemEnvironment(environment);
- Logger.log(environment.toString());
-
+ IDFUtil.cleanUpSystemEnvironment(environment);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| environment.put("IDF_GITHUB_ASSETS", //$NON-NLS-1$ | ||||||||||||||||
|
|
@@ -487,6 +488,11 @@ protected IStatus runCommand(List<String> arguments, MessageConsoleStream consol | |||||||||||||||
| { | ||||||||||||||||
| addPathToEnvironmentPath(environment, gitExecutablePath); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| Logger.log("Environment Variables after filtering from system:"); | ||||||||||||||||
| IDFUtil.cleanUpSystemEnvironment(environment); | ||||||||||||||||
| Logger.log(environment.toString()); | ||||||||||||||||
|
|
||||||||||||||||
| Process process = processRunner.run(arguments, org.eclipse.core.runtime.Path.ROOT, environment); | ||||||||||||||||
| IStatus status = processData(process); | ||||||||||||||||
| console.println(); | ||||||||||||||||
|
|
||||||||||||||||
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.
Instead of cleaning up system environment variables, why can't we rely only on the environment variables configured in the IDE and that includes PATH as well?
IDFEnvironmentVariables().getEnvMap()
Otherwise, if we go with the cleanup approach, we'll have to maintain this code all the time whenever there are changes in the IDF environment variables.
Please check?