Reapply "Update packageurl-dotnet to 2.0.0-rc.2 (#1730)" (#1751)#1753
Merged
Conversation
zhenghao104
approved these changes
Mar 31, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Reapplies the package-url library upgrade across the Component Detection contracts by moving to packageurl-dotnet v2 and updating TypedComponent PURL generation and related tests/docs to match the new API (PackageUrl vs PackageURL) and formatting behavior.
Changes:
- Bump
packageurl-dotnetto a v2 prerelease and migrate usages fromPackageURLtoPackageUrl. - Adjust PURL generation in
GoComponentto split module path into namespace/name per the golang PURL type definition. - Update affected unit tests and documentation snippets to match the new package-url behavior and API.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Updates central package pin for packageurl-dotnet (v2 prerelease). |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/TypedComponent.cs | Switches base PackageUrl property type to v2 PackageUrl. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/GoComponent.cs | Updates golang PURL generation to include namespace/name splitting and prefer hash for version. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/SwiftComponent.cs | Migrates Swift PURL generation to PackageUrl type; comment updated. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/PodComponent.cs | Migrates CocoaPods PURL generation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/CppSdkComponent.cs | Migrates CppSdk PURL generation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/VcpkgComponent.cs | Migrates vcpkg PURL creation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/RubyGemsComponent.cs | Migrates gem PURL generation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/PipComponent.cs | Migrates PyPI PURL generation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/NugetComponent.cs | Migrates NuGet PURL generation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/NpmComponent.cs | Migrates npm PURL generation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/MavenComponent.cs | Migrates Maven PURL generation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/LinuxComponent.cs | Migrates Linux distro PURL generation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/ConanComponent.cs | Migrates Conan PURL generation to PackageUrl type. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/CargoComponent.cs | Migrates Cargo PURL generation to PackageUrl type. |
| test/Microsoft.ComponentDetection.Contracts.Tests/PurlGenerationTests.cs | Updates expected PURL strings (case/encoding behavior changes in v2). |
| test/Microsoft.ComponentDetection.Contracts.Tests/TypedComponentSerializationTests.cs | Updates Go component test data to include a namespace in the module path. |
| test/Microsoft.ComponentDetection.Contracts.Tests/CppSdkComponentTests.cs | Updates expectations for generic PURL name casing behavior. |
| test/Microsoft.ComponentDetection.Detectors.Tests/SwiftComponentTests.cs | Migrates Swift PackageUrl expectations to the v2 PackageUrl type. |
| docs/creating-a-new-detector.md | Updates example code to use PackageUrl v2 type. |
| docs/schema/manifest.schema.json | Formatting-only change. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1753 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This reverts commit a01a1ce.