Enhancement: apply Cargo `[patch]` tables the same way Go `replace` is applied
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust, typescript
Hướng nghiên cứu
Start with src/core-open/scanners/rust-scanner.ts, especially cargoDependencyHeader and parseCargoToml, then compare the existing handling in test/go-replace.test.ts and workspace inheritance tests. Add tests beside test/cargo-workspace-inheritance.test.ts for registry, git, path, named registry, and later-patch behavior. Done means the acceptance cases pass, including keeping path crates out of lockfile and SBOM components.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- Difficulty: medium
- Area: Cargo / Rust scanner
Problem
cargoDependencyHeader / parseCargoToml in src/core-open/scanners/rust-scanner.ts (around lines 150–180 and 445–500) only read [dependencies], [dev-dependencies], [build-dependencies], and the target. / sub-table variants. [patch.crates-io] and [patch."<url>"] are ignored.
A workspace that patches serde to a git rev or a path crate is still looked up on crates.io at the version declared under [dependencies]. That is the same class of miss that go.mod replace already handles (test/go-replace.test.ts).
The deliberate Cargo SBOM rule still stands and is not part of this issue: the project’s own crate and local path crates stay out of the SBOM / lockfile component list.
Expected behaviour
After reading the manifest (and workspace inheritance), apply [patch] entries for the same crate name. A patch with a registry version overwrites the requirement used for crates.io / lockfile lookup, the way a module replace does. A git or path patch keeps the row visible but must not invent a crates.io version or query the registry for that crate (mirror local Go replace). Path patches must not reintroduce the excluded root / path crate into vg sbom export. [patch.crates-io] and named extra registries should both work. A later patch for the same name wins, or document a different pinned rule. Cargo.lock still supplies resolvedVersion when the locked package is a registry crate.
Acceptance
- New tests next to
test/cargo-workspace-inheritance.test.ts/test/go-replace.test.ts. [patch.crates-io] serde = { version = "1.0.200" }is the version used for aserde = "1.0"dependency.- A git patch does not query crates.io and does not invent a registry version.
- A path patch is not emitted as a lockfile / SBOM component.
- Manifests without
[patch]are unchanged.
- Ngôn ngữ chính
- TypeScript
- Star
- 4
- Fork
- 3
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 76
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vibgrate/cli
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
area: documentation status: in progress type: documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
Oddmash/oddmash-ui#222 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
appium/appium-wincore-driver#169 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
india-ultimate/hub#715 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation Entwickler
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 89/100
Maintainer thường phản hồi trong vòng 1 ngày