Skip to content

Add Swift package registry support - #259

Open
andrew wants to merge 4 commits into
mainfrom
swift-registry-support
Open

Add Swift package registry support#259
andrew wants to merge 4 commits into
mainfrom
swift-registry-support

Conversation

@andrew

@andrew andrew commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

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.

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

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.

Comment thread internal/handler/swift.go Outdated
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.

2 participants