Add Swift package registry support - #259
Open
andrew wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds read-only Swift Package Registry v1 proxy support to the existing multi-ecosystem package proxy, including routing, upstream configuration, caching of source archives, URL rewriting, and UI/docs updates.
Changes:
- Introduces a new Swift registry HTTP handler (
/swift/*) that proxies registry read endpoints, rewrites registry URLs to the proxy, and caches source archives while preserving checksum/signing headers. - Adds Swift-aware Package URL (PURL) construction logic to correctly represent Swift scoped identifiers (namespace/name) in stored keys and lookups.
- Wires Swift upstream configuration (default Tuist registry) through config/env/docs and exposes Swift in the dashboard + tests.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents Swift support and adds Swift upstream env/config examples. |
| internal/server/templates_test.go | Adds coverage ensuring Swift UI instructions include --allow-insecure-http for local HTTP. |
| internal/server/server.go | Mounts /swift routes and switches PURL string building to the internal packageurl helper. |
| internal/server/server_test.go | Ensures Swift handler is mounted and publishing returns 405; checks dashboard includes swift. |
| internal/server/dashboard.go | Adds Swift to supported ecosystems and renders SwiftPM setup instructions. |
| internal/server/browse.go | Uses packageurl.MakeString for version PURL lookups (incl. Swift namespace handling). |
| internal/packageurl/packageurl.go | Adds Swift namespace-aware PURL construction helper. |
| internal/packageurl/packageurl_test.go | Tests Swift namespace/nested namespace PURL formatting and non-Swift delegation. |
| internal/handler/swift.go | Implements Swift Package Registry v1 read-only proxying + source archive caching and header preservation. |
| internal/handler/swift_test.go | Adds unit tests for Swift registry proxy behavior, rewriting, caching, and validation. |
| internal/handler/handler.go | Switches artifact PURL key construction to packageurl (Swift namespace correctness). |
| internal/handler/handler_test.go | Extends mock fetcher to capture request headers for artifact fetch tests. |
| internal/enrichment/enrichment.go | Uses packageurl for enrichment PURL construction (Swift namespace correctness). |
| internal/config/config.go | Adds upstream.swift config + PROXY_UPSTREAM_SWIFT env var wiring with default. |
| internal/config/config_test.go | Tests Swift upstream default and env override behavior. |
| docs/configuration.md | Documents upstream.swift configuration. |
| docs/architecture.md | Adds SwiftHandler to architecture documentation. |
| config.example.yaml | Adds example upstream.swift entry. |
| cmd/proxy/main.go | Adds PROXY_UPSTREAM_SWIFT to CLI help output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Add read-only Swift Package Registry v1 proxying for release lists, release metadata, manifests, identifier lookup, and source archives.
Registry URLs are rewritten through the proxy, and source archives are cached while checksum and signing headers are preserved. The Swift upstream is configurable, with the Tuist registry as the default.
Publishing remains unsupported and returns 405 Method Not Allowed.