feat(cli): add temporary flag to disable workspace policies#20523
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 implements a temporary mechanism to disable workspace-level policy resolution within the CLI. This change aims to streamline the auto-acceptance phase of policy management by providing a way to bypass workspace policies, even in trusted folders, thereby reducing friction and improving workflow efficiency for specific scenarios. Highlights
Changelog
Activity
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a temporary disableWorkspacePolicies flag to bypass workspace policy resolution, which is a useful feature for testing and reducing friction. The implementation is straightforward and includes a corresponding unit test. The existing feedback suggesting refactoring the new test case to use beforeEach/afterEach for state management is valid and aligns with repository testing conventions, so it has been kept.
|
Size Change: +64 B (0%) Total Size: 25.7 MB ℹ️ View Unchanged
|
52b1f89 to
206f192
Compare
Introduces 'disableWorkspacePolicies' flag to bypass workspace policy resolution even in trusted folders. This is a temporary measure to reduce friction while auto-accepting policies. The flag is enabled (true) by default. Tests have been updated to explicitly manage the flag state where necessary. Closes #20522
206f192 to
b662ab6
Compare
Summary
Introduces a temporary
disableWorkspacePoliciesflag to the policy resolution logic. This allows bypassing workspace-level policy resolution even when a folder is trusted, helping to reduce friction during the auto-acceptance phase.Details
disableWorkspacePolicies(defaultfalse) and its settersetDisableWorkspacePoliciestopackages/cli/src/config/policy.ts.resolveWorkspacePolicyStateto respect this flag.packages/cli/src/config/policy.test.tsto verify the new behavior.Related Issues
Closes #20522
How to Validate
Run the unit tests specifically for policy configuration:
npm test -w @google/gemini-cli -- src/config/policy.test.tsVerify that the new test case "should return empty state if disableWorkspacePolicies is true even if folder is trusted" passes.
Pre-Merge Checklist