fix(cli): respect global environment variable allowlist#24767
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a configuration loading issue where the global allowlist for environment variable redaction was being ignored. By correctly mapping the setting from the configuration file to the internal application state, the system now properly respects user-defined exceptions for environment variable redaction. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Size Change: +87 B (0%) Total Size: 34 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request updates the CLI configuration loading logic in packages/cli/src/config/config.ts to include an allowedEnvironmentVariables property, which is mapped from the security settings for environment variable redaction. I have no feedback to provide as there are no review comments.

Summary
This PR fixes a bug where the global allowlist for environment variable redaction was completely ignored during configuration loading.
Details
The
settings.security.environmentVariableRedaction.allowedarray is defined in thesettingsSchema.tsfile, and the coreConfigobject accepts anallowedEnvironmentVariablesparameter. However,loadCliConfiginpackages/cli/src/config/config.tswas not mapping the setting fromsettings.jsoninto theConfigconstructor. This one-line fix maps the parsed setting so the global allowlist is respected.Related Issues
Fixes #18302
How to Validate
MY_SECRET_TOKEN) to thesecurity.environmentVariableRedaction.allowedarray in yoursettings.json.settings.json.MY_SECRET_TOKENenvironment variable on your system.Pre-Merge Checklist