feat: feature configuration service for scope-based toggles#284
feat: feature configuration service for scope-based toggles#284allenhutchison wants to merge 2 commits intomainfrom
Conversation
Implements a three-layer configuration system (defaults → settings → env overrides) that lets users and contributors control which services and OAuth scopes the extension requests. Each service is split into read/write feature groups. Disabled features have their tools unregistered and their scopes removed from OAuth requests. Closes #255
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 introduces a comprehensive feature configuration service, providing granular control over services and OAuth scopes. It enhances the extension's adaptability and security by dynamically computing scopes and gating tool registration based on user-defined settings and environment variables. The changes include a feature registry, a feature resolver, and updated documentation to guide users and contributors. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive feature configuration service, enabling dynamic control over which services and OAuth scopes the extension requests. The implementation includes a well-structured feature registry (feature-config.ts), a robust resolver (feature-resolver.ts) with a three-layer precedence model (defaults, settings, environment variables), and dynamic OAuth scope computation. The changes also correctly gate tool registration based on the enabled features, with a sensible exception for authentication tools. Extensive unit tests have been added for both the feature configuration and resolver logic, ensuring correctness and reliability. Documentation has been updated to reflect these new configuration capabilities, providing clear guidance for users and contributors. Overall, this is a well-designed and thoroughly implemented feature that significantly enhances the flexibility and maintainability of the extension.
Summary
Implements the Feature Configuration Service from #255, giving users and contributors control over which services and OAuth scopes the extension requests.
features/feature-config.ts) — 18 read/write feature groups across all services, each declaring its scopes, tools, and default statefeatures/feature-resolver.ts) — Three-layer resolution: baked-in defaults → settings (future) →WORKSPACE_FEATURE_OVERRIDESenv varConfiguration
Supports group-level (
gmail.write:off) and tool-level (calendar.deleteEvent:off) overrides. Tool-level overrides are subtractive only.Default-OFF features
slides.write,sheets.write,tasks.read,tasks.write— scopes not in the published GCP project. Contributors can enable them with their own GCP projects.Test plan
WORKSPACE_FEATURE_OVERRIDES="gmail.write:off"hides Gmail write tools from MCP tool listingCloses #255