Skip to content

171 implement plugin registry#172

Open
sirkitree wants to merge 2 commits intomainfrom
171-implement-plugin-registry
Open

171 implement plugin registry#172
sirkitree wants to merge 2 commits intomainfrom
171-implement-plugin-registry

Conversation

@sirkitree
Copy link
Copy Markdown
Contributor

Addresses #171

This pull request introduces a configurable plugin registry system, allowing selective enabling or disabling of bot plugins via the new ENABLED_PLUGINS environment variable. This makes it easier to tailor deployments for different environments, organizations, or testing scenarios. The implementation includes documentation updates, code changes to support the registry, and comprehensive tests for edge cases.

Plugin Registry Implementation:

  • Added src/services/plugin-registry.ts, which provides the PluginRegistry class and a singleton instance to manage enabled plugins based on the ENABLED_PLUGINS environment variable. If the variable is unset or empty, all plugins are enabled by default.
  • Updated src/bot.ts to use the plugin registry when loading plugins, skipping any that are disabled according to the registry. [1] [2]

Documentation Updates:

  • Added detailed explanations and usage examples for the ENABLED_PLUGINS variable in README.md and CLAUDE.md, including lists of available plugins and configuration scenarios. [1] [2] [3] [4]
  • Updated .env.defaults to include the ENABLED_PLUGINS variable for reference.

Testing:

  • Added src/services/__tests__/plugin-registry.test.ts with comprehensive tests covering all major scenarios, including unset, empty, and malformed ENABLED_PLUGINS values, extension handling, and real-world deployment cases.

Tooling/CI Improvements:

  • Updated .husky/pre-commit to skip secret scanning for documentation files such as README.md and CLAUDE.md, preventing false positives from example patterns.

- Added `ENABLED_PLUGINS` environment variable to control which plugins are loaded.
- Introduced `PluginRegistry` service to manage enabled plugins.
- Updated documentation in `CLAUDE.md` and `README.md` to reflect new configuration options.
- Modified `bot.ts` to skip loading disabled plugins based on the registry.
- Modified the pre-commit script to include README.md in the list of files to be skipped during secret scanning, alongside SECURITY files and CLAUDE.md.
Copilot AI review requested due to automatic review settings October 9, 2025 03:21
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @sirkitree, 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 plugin registry system, enabling dynamic control over which bot plugins are loaded via an environment variable. It includes the core logic, extensive testing, and updated documentation to support this new configurability.

Highlights

  • Intent: This PR introduces a configurable plugin registry system, allowing selective enabling or disabling of bot plugins via the ENABLED_PLUGINS environment variable. This enhances flexibility for different deployment environments, organizations, or testing scenarios. If the variable is unset or empty, all plugins are enabled by default.
  • Key Changes: A new service src/services/plugin-registry.ts was added to manage enabled plugins based on the ENABLED_PLUGINS environment variable. The main bot logic in src/bot.ts was updated to consult this registry before loading plugins, skipping any that are disabled. Comprehensive unit tests for the PluginRegistry were added in src/services/__tests__/plugin-registry.test.ts, covering various scenarios including unset, empty, and malformed ENABLED_PLUGINS values, and file extension handling. Documentation (README.md, CLAUDE.md) was updated to explain the new configuration option and provide usage examples. The .env.defaults file was also updated to include ENABLED_PLUGINS. Additionally, the .husky/pre-commit hook was modified to skip secret scanning for README.md and CLAUDE.md to prevent false positives.
  • Reviewer Activity: No specific reviewer activity has been recorded yet for this pull request.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a plugin registry system that allows selective enabling/disabling of bot plugins via the ENABLED_PLUGINS environment variable, making deployments more configurable for different environments and use cases.

  • Added a PluginRegistry service to manage enabled plugins based on environment configuration
  • Integrated the plugin registry into the bot's plugin loading mechanism
  • Enhanced documentation with detailed plugin configuration examples and usage scenarios

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/services/plugin-registry.ts Core plugin registry implementation with environment variable parsing
src/services/tests/plugin-registry.test.ts Comprehensive test suite covering all registry scenarios
src/bot.ts Integration of plugin registry to filter loaded plugins
README.md Added plugin configuration documentation and examples
CLAUDE.md Updated technical documentation with registry details
.husky/pre-commit Expanded documentation file exclusions for secret scanning
.env.defaults Added ENABLED_PLUGINS example configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is a great addition that significantly improves the bot's configurability. The implementation is clean, and the inclusion of comprehensive tests and documentation is excellent. I have a few suggestions to enhance the robustness of the new plugin registry and to align with best practices for logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants