Skip to content

Handle Swift registry identities - #29

Merged
andrew merged 1 commit into
mainfrom
fix/swift-registry-identities
Aug 16, 2026
Merged

Handle Swift registry identities#29
andrew merged 1 commit into
mainfrom
fix/swift-registry-identities

Conversation

@andrew

@andrew andrew commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Swift Package Registry identities do not include source repository coordinates, so treating apple/swift-argument-parser as a namespace creates a misleading PURL.

Return unsupported results for Swift registry identities and build source PURLs only from coordinates such as github.com/apple/swift-argument-parser. This also keeps the struct and string construction paths aligned.

Closes #28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Swift PURL handling to avoid fabricating source-based Swift PURLs from Swift Package Registry identities, returning “unsupported” outputs instead, and keeps the struct-based and string-based construction paths aligned.

Changes:

  • Refactors namespace/name extraction into splitNamespace and adds an ok return to represent unsupported identifiers.
  • Adds Swift-specific parsing to accept only source-coordinate-style identifiers (host/owner/package) and reject registry identities/paths.
  • Adds/updates tests to cover Swift source coordinates and registry identities across MakePURL* and BuildPURLString.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
makepurl.go Adds ok-returning splitNamespace, uses it in BuildPURLString, and introduces Swift-specific identifier validation.
makepurl_test.go Adds BuildPURLString tests for Swift source coordinates vs registry identities/paths and aligns parity test coverage.
ecosystem.go Routes MakePURL / MakePURLString through splitNamespace, returning nil/empty string for unsupported Swift registry identities.
ecosystem_test.go Adds Swift source coordinate tests and explicit rejection tests for Swift registry identities for both struct and string APIs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread makepurl.go
@andrew
andrew merged commit 73c23ea into main Aug 16, 2026
6 checks passed
@andrew
andrew deleted the fix/swift-registry-identities branch August 16, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle Swift package registry identities without fabricating source PURLs

2 participants