-
Notifications
You must be signed in to change notification settings - Fork 112
Unify Rust detection logic with SBOM mode, ownership mapping, and skip optimizations #1474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
grvillic
reviewed
Oct 21, 2025
src/Microsoft.ComponentDetection.Detectors/rust/RustSbomDetector.cs
Outdated
Show resolved
Hide resolved
grvillic
approved these changes
Oct 21, 2025
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
grvillic
approved these changes
Oct 21, 2025
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.
Unified Rust Detector – SBOM, Fallback, and Ownership Enhancements
Summary
This PR introduces a unified Rust component detection model that consolidates SBOM, CLI, and Lock-based detection strategies into a single consistent implementation.
It also refactors supporting classes and introduces key performance and accuracy improvements.
Key Changes
1. Unified Detection Model
*.cargo-sbom.jsonfiles are found, detection runs purely in SBOM mode (most accurate).cargo metadataonCargo.toml.Cargo.lockprocessing.2. Parser Refactoring
3.
RustContextMetadataBuilderEnhancementsCargo.tomlintroduced each dependency.cargo metadatato map packages to their corresponding TOMLs.4. Skip Optimizations
cargo metadatais executed on a workspace root TOML, it inherently includes all member packages.5. Unit Test Coverage
RustContextMetadataBuilderValidation
Manual validation confirms the unified detector produces identical results to the legacy detectors in both modes: