Skip to content

Conversation

elrrrrrrr
Copy link
Contributor

  • 🐞 Fixed installation failure when using tags
  • ♻️ Optimize versions.json loading performance

Copy link
Contributor

Summary of Changes

Hello @elrrrrrrr, 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 resolves a critical issue preventing package installations when distribution tags are used, while simultaneously boosting the performance of package version resolution. It achieves this by introducing a structured approach to handling version information, optimizing caching mechanisms, and ensuring the new logic is thoroughly tested.

Highlights

  • Dist-tag Resolution: Implemented robust resolution of package versions by prioritizing distribution tags (e.g., "latest", "beta") before falling back to semantic versioning (semver) matching. This change directly addresses and fixes installation failures that occurred when using tags.
  • VersionsInfo Structure Refactoring: The VersionsInfo struct has been refactored to explicitly store version_list and dist_tags as structured data, moving away from a generic serde_json::Value. This improves type safety, clarity, and maintainability of package version data.
  • Caching Optimization: Optimized the loading performance of versions.json by introducing a new memory cache layer for full manifests. This enhancement reduces redundant disk I/O operations when resolving individual version manifests, leading to faster package resolution.
  • Enhanced Test Coverage: Comprehensive unit tests have been added for the new dist-tag resolution logic, covering various scenarios including direct tag matches, semver fallbacks, edge cases with empty tags, and error conditions, ensuring the reliability of the new implementation.
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
Contributor

@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 pull request introduces a fix for package installation with dist-tags and optimizes versions.json loading. The changes to use strongly-typed VersionsInfo and Versions structs are a great improvement for type safety and clarity. The new caching logic in resolve_version_manifest and the dist-tags handling in resolve_package are well-implemented.

However, I've found a critical issue in the caching logic of resolve_package_versions that needs to be addressed. Additionally, there are a couple of test removals that reduce test coverage for important edge cases, and a use of unwrap() that should be replaced for better robustness.

Copy link
Contributor

@fireairforce fireairforce left a comment

Choose a reason for hiding this comment

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

clippy 和 fmt 好像 failed 了,本地 ok 吗?

@elrrrrrrr elrrrrrrr merged commit 39902de into next Oct 10, 2025
16 checks passed
@elrrrrrrr elrrrrrrr deleted the dist-tag branch October 10, 2025 13:39
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.

3 participants