fix(cli): prevent automatic updates from switching to less stable channels#26132
fix(cli): prevent automatic updates from switching to less stable channels#26132
Conversation
|
Size Change: +1.19 kB (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
f6f4fc2 to
91b2a84
Compare
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 an issue where the CLI's automatic update mechanism could inadvertently upgrade users on stable release channels to less stable nightly or preview builds. The changes introduce a robust stability-aware update process, ensuring that users only receive updates that are as stable as, or more stable than, their current installed version, thereby preventing unintended channel switching and maintaining expected release stability. 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 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 implements a stability-aware update system for the Gemini CLI, preventing users on stable channels from receiving nightly or preview updates. It introduces channel stability rankings and helper functions to determine the release channel from version strings. A critical implementation error was identified where the current version is not included in the update metadata, which would cause the stability check to default to the lowest level and potentially allow stable users to update to nightly versions.
91b2a84 to
7ae7242
Compare
Summary
This PR fixes issue #24810, where users on the stable release channel were being automatically updated to nightly builds. This occurred because the
latesttag on npm occasionally pointed to a semver-greater nightly version, and the CLI lacked a stability-aware filter for updates.Details
getChannelFromVersionfunction inpackages/core/src/utils/channel.ts.STABLE > PREVIEW > NIGHTLY) to allow programmatic comparison of update safety.checkForUpdates: The CLI now verifies that the target update version is at least as stable as the current version before offering it.handleAutoUpdate.tsbefore spawning the global install command to prevent accidental cross-channel updates at the execution phase.Related Issues
Fixes #24810
How to Validate
version: "0.35.0"inpackage.json)."0.36.0-nightly.1") as thelatestversion.Pre-Merge Checklist