Add support for updating extension sources and names#21715
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 introduces a robust mechanism for managing extension migrations and renames within the Gemini CLI. It allows extension authors to specify a new repository URL and optionally a new name, enabling a smooth transition for existing users. The CLI will automatically detect these changes, download updates from the new source, migrate installation details, and update enablement statuses, all while providing clear consent prompts to the user. This significantly improves the flexibility and maintainability of extensions by supporting changes in their underlying distribution. 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
|
|
Size Change: +3.68 kB (+0.01%) Total Size: 26.1 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces a well-implemented feature for extension migration and renaming. The changes are comprehensive, covering configuration, update logic, installation, user consent, and testing. The code is generally robust and handles edge cases like name conflicts and preserving enablement state.
Note: Security Review is unavailable for this PR.
There was a problem hiding this comment.
do we need to submit this file?
alisa-alisa
left a comment
There was a problem hiding this comment.
please ensure if you want pr-description.md file to be submitted.
Summary
This PR implements a seamless migration path for extensions to move to a new repository and optionally change their name without stranding existing users.
When an extension author sets the
migratedTofield in theirgemini-extension.jsonand publishes an update to their old repository, the CLI will detect this during the next update check. The CLI will then automatically download the extension from the new repository, explicitly warn the user about the migration (and any renaming) during the consent step, and seamlessly migrate the installation and enablement status while cleaning up the old installation.Details
migratedToproperty toExtensionConfigandGeminiCLIExtensionto track the new repository URL.checkForExtensionUpdateandupdateExtensionto inspect themigratedTofield. If present, the CLI queries the new repository URL for an update and swaps the installation source so the update resolves from the new location.ExtensionManager):installOrUpdateExtensionnow fully supports renaming. It transfers global and workspace enablement states from the old extension name to the new one and deletes the old extension directory.getEnablementManager()toExtensionManagerfor better typing during testing.maybeRequestConsentOrFailto compute anisMigratingflag (by detecting a change in the installation source). TheextensionConsentStringoutput now explicitly informs users with messages like: "Migrating extension 'old-name' to a new repository, renaming to 'new-name', and installing updates."migratedTofield indocs/extensions/reference.mdand added a comprehensive guide indocs/extensions/releasing.mdexplaining how extension maintainers can transition users using this feature.extension-manager.test.ts,consent.test.ts,github.test.ts, andupdate.test.tsto cover the new migration and renaming logic.Related issues
Fixes #21700
How to validate
gemini-extension.jsonto include amigratedTofield pointing to a different test repository.gemini extensions checkto confirm it detects the update from the new source.gemini extensions update <extension>.Pre-Merge Checklist