Repository navigation
fix(security): reset modified build files upon confirmation and deduplicate filenames (#29687) - #29719
fix(security): reset modified build files upon confirmation and deduplicate filenames (#29687)#29719Sandeep332005 wants to merge 1 commit into
Conversation
…licate filenames (#29687)
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 usability and security UX issues related to the build configuration modification tracking mechanism. By ensuring that tracked files are cleared after a user explicitly approves a build command, the system avoids repetitive caution prompts. Additionally, the CLI interface has been updated to present a cleaner list of modified files by deduplicating basenames, which prevents clutter when multiple files in different directories share the same name. 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 the 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 counterproductive. 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
|
|
📊 PR Size: size/M
|
🛑 Action Required: Evaluation ApprovalSteering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged. Maintainers:
Once approved, the evaluation results will be posted here automatically. |
There was a problem hiding this comment.
Code Review
This pull request deduplicates identical build file basenames in the CLI's caution warning message and ensures that tracked modified build files are reset once a user confirms the execution of a build command. Corresponding unit tests have been added to verify both behaviors. There are no review comments, so I have no feedback to provide.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
|
This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Summary
Fixes two issues with the
sessionModifiedBuildFilessecurity mechanism:1. Clears tracked modified build files once the user approves execution of the build command so the caution
warning does not prompt repeatedly on every subsequent build command.
2. Deduplicates identical build file basenames in the CLI warning message (e.g. converting
(package.json, package.json)to(package.json)).Details
indefinitely. Even after approving with "Allow once", every subsequent build command triggered the caution warning
again and blocked "Allow for this session". We now invoke
resetModifiedBuildFiles(this.context.config)insideonConfirmwhen the user approves execution (ProceedOnce,ProceedAlways, orProceedAlwaysAndSave).- UI Deduplication (
packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx):Mapped basenames are now deduplicated with
Array.from(new Set(...))so repeated edits to the same file orsubpackage files sharing basenames do not produce repetitive lists.
- Tests Added:
-
packages/core/src/tools/shell.test.ts: Added test verifyingmodifiedBuildFilesis cleared after userconfirmation.
-
packages/cli/src/ui/components/messages/ToolConfirmationMessage.test.tsx: Added test verifying duplicatebuild file basenames are deduplicated in the warning banner.
Related Issues
How to Validate
Run CLI unit tests:
npm --prefix packages/cli test -- ToolConfirmationMessage.test.tsx
Typecheck validation:
npm --prefix packages/core run typecheck
npm --prefix packages/cli run typecheck
Pre-Merge Checklist
[✓] Added/updated tests (if needed)
[✓] Validated on required platforms/methods:
[✓] MacOS
[✓] npm run