feature: Make package name and version optional#18
Closed
maurolacy wants to merge 1 commit into
Closed
Conversation
There was a problem hiding this comment.
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.versionandGearRefRemote.packageoptional and update dependency resolution accordingly. - Add package-name derivation via a new
resolve_system_crate_namehelper andGearRefRemote::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
force-pushed
the
feature/gear-opts
branch
from
July 3, 2026 09:19
aabebb2 to
4a6d921
Compare
Owner
|
This is on gears-rust responsibility, we won't maintain this feature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.