Skip to content

fix(pm): optional deps - #2443

Merged
xusd320 merged 5 commits into
nextfrom
fix-optional
Dec 25, 2025
Merged

fix(pm): optional deps#2443
xusd320 merged 5 commits into
nextfrom
fix-optional

Conversation

@elrrrrrrr

Copy link
Copy Markdown
Contributor
  • ⚠️ Due to compatibility issues with devOptional, we maintain separate dev and optional configurations
  • 🔧 Keep backward compatibility while implementing the fix

@gemini-code-assist

Copy link
Copy Markdown
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 introduces a fix to how optional and development dependencies are managed within the system. It specifically addresses compatibility concerns by ensuring that dev and optional dependency types are handled as separate configurations during dependency resolution and package lock generation. The changes aim to provide more accurate and compatible dependency metadata without altering existing core functionality.

Highlights

  • Separate dev and optional flags: The add_optional_flags function in package_lock.rs has been updated to set dev and optional flags independently in the generated package lock JSON, rather than using a combined devOptional flag. This addresses compatibility issues and ensures distinct representation of these dependency types.
  • Refined Dependency Type Propagation: The update_node_type_from_edge function in builder.rs now includes revised logic for propagating dev and optional statuses through the dependency graph. This ensures that dependency types are accurately assigned based on the source node's flags and the edge type, maintaining backward compatibility while improving precision.
  • Comprehensive Test Coverage: New unit tests have been added for both add_optional_flags and update_node_type_from_edge to thoroughly validate the updated logic. These tests cover various scenarios, including cases where a dependency is both development and optional, ensuring the correct behavior of the changes.

🧠 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 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.

@elrrrrrrr elrrrrrrr added the A-Pkg Manager Area: Package Manager label Dec 24, 2025
xusd320
xusd320 previously approved these changes Dec 24, 2025

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

Copy link
Copy Markdown
Contributor

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 correctly updates the dependency flag logic to handle optional dependencies of dev dependencies by using separate dev and optional flags instead of devOptional. The changes in package_lock.rs and the accompanying tests are well-implemented. However, I've found a potential issue in the propagation logic in builder.rs where the optional status of a dependency might not be correctly propagated if its source is also a dev dependency. I've left a specific comment with a suggested fix.

Comment thread crates/ruborist/src/resolver/builder.rs Outdated
fireairforce
fireairforce previously approved these changes Dec 24, 2025
@elrrrrrrr
elrrrrrrr dismissed stale reviews from fireairforce and xusd320 via 5213b97 December 24, 2025 06:26
@xusd320
xusd320 merged commit 90cf4ef into next Dec 25, 2025
20 of 21 checks passed
@xusd320
xusd320 deleted the fix-optional branch December 25, 2025 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Pkg Manager Area: Package Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants