Skip to content

feature: Make package name and version optional#18

Closed
maurolacy wants to merge 1 commit into
devfrom
feature/gear-opts
Closed

feature: Make package name and version optional#18
maurolacy wants to merge 1 commit into
devfrom
feature/gear-opts

Conversation

@maurolacy

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

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 makes package and version optional for remote gear entries, and introduces logic to derive the effective Cargo package name from the system registry (with a cf-gears-{name} fallback). This improves manifest ergonomics by allowing gears = [{ source = "remote", name = "..." }] while still producing deterministic dependency metadata.

Changes:

  • Make GearRefRemote.version and GearRefRemote.package optional and update dependency resolution accordingly.
  • Add package-name derivation via a new resolve_system_crate_name helper and GearRefRemote::resolved_package().
  • Extend tests to cover “name-only remote gear” behavior and update existing test fixtures.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
crates/cargo-gears/src/testing.rs Updates test helper logic and sample remote gear fixtures for optional package/version and derived package handling.
crates/cargo-gears-core/src/manifest.rs Makes remote gear package/version optional, adds resolved_package(), updates dependency resolution, and adds coverage for name-only remote gears.
crates/cargo-gears-core/src/list/mod.rs Adds resolve_system_crate_name() helper to map gear name → crate name with a fallback.
crates/cargo-gears-core/src/list/gears.rs Updates system-module collection to use the derived/explicit resolved package name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +140 to 146
GearRef::Remote(remote)
if remote.name == module
|| remote.package.as_deref() == Some(module)
|| remote.resolved_package() == module =>
{
Some(remote.resolved_package())
}
}

#[test]
fn remote_gear_with_name_only_derives_package_and_version() {
Signed-off-by: Mauro Lacy <11656534+maurolacy@users.noreply.github.com>
@maurolacy
maurolacy force-pushed the feature/gear-opts branch from aabebb2 to 4a6d921 Compare July 3, 2026 09:19
@Bechma

Bechma commented Jul 3, 2026

Copy link
Copy Markdown
Owner

This is on gears-rust responsibility, we won't maintain this feature

@Bechma Bechma closed this Jul 3, 2026
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