Swift relies on Version, not hash - #1885
Merged
Ryan Brandenburg (ryanbrandenburg) merged 2 commits intoOct 1, 2026
Merged
Conversation
Ryan Brandenburg (ryanbrandenburg)
requested a review
from a team
as a code owner
September 30, 2026 23:09
Ryan Brandenburg (ryanbrandenburg)
requested review from
Brett V. Forsgren (brettfo)
and
a balanced review from Copilot
September 30, 2026 23:09
Copilot started reviewing on behalf of
Ryan Brandenburg (ryanbrandenburg)
September 30, 2026 23:10
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The detector version was not incremented, and removing a public constructor breaks existing Contracts consumers.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Updates Swift component identity to rely on repository URL and package version rather than commit hash.
Changes:
- Uses version in Swift component IDs.
- Skips packages without versions while allowing missing revisions.
- Replaces constructor usage with object initializers and updates tests.
| File | Description |
|---|---|
src/Microsoft.ComponentDetection.Contracts/TypedComponent/SwiftComponent.cs |
Changes identity and removes constructors. |
src/Microsoft.ComponentDetection.Detectors/swiftpm/SwiftResolvedComponentDetector.cs |
Requires versions during detection. |
test/Microsoft.ComponentDetection.Contracts.Tests/TypedComponentSerializationTests.cs |
Updates Swift serialization setup. |
test/Microsoft.ComponentDetection.Detectors.Tests/SwiftComponentTests.cs |
Updates identity and initialization tests. |
test/Microsoft.ComponentDetection.Detectors.Tests/SwiftResolvedDetectorTests.cs |
Updates detector expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
Copilot started reviewing on behalf of
Ryan Brandenburg (ryanbrandenburg)
September 30, 2026 23:17
View session
Contributor
Author
|
The change in detections count is expected, the "revision+branch" sample is no longer valid. |
Aayush Maini (AMaini503)
approved these changes
Oct 1, 2026
Ryan Brandenburg (ryanbrandenburg)
merged commit Oct 1, 2026
2f00ab9
into
main
13 of 16 checks passed
Ryan Brandenburg (ryanbrandenburg)
deleted the
users/rybrande/SwiftComputeBase
branch
October 1, 2026 16:46
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.



After chatting with some team-members we decided that Version was the more useful identifier after all. This PR makes version the ComponentBaseId identifier and removes the constructors which weren't really achieving anything anyway.
Most of the test changes relate to either the expected ID changing or the lack of constructor enforcement for some parameters.