Repository navigation
Conversation
Reads SE-0292 registries with the registry Accept header, which needed a client method that sets request headers and returns response headers. Claude-Session: https://claude.ai/code/session_01NxsA75HBjdWQKcdx7FDTDc
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Closes #96
Adds a
swiftregistry for the SE-0292 registry API. There is no default registry, soregistries.New("swift", "", nil)returns the existing "no registry URL configured" error, as Helm does.FetchVersionslistsGET /{scope}/{name}, followingLink: rel="next"pages on the registry's own host (up to 50). Releases with aproblemare marked yanked. It doesn't fetch each release, so versions have no time or checksum.FetchVersionreadsGET /{scope}/{name}/{version}and returns thesource-archivechecksum assha256-<hex>integrity,originalPublicationTimeorpublishedAt, and the archive as anArtifact.FetchVersionFromPURLuses it.FetchPackageandFetchMaintainersread the latest available release's metadata.FetchDependenciesreturns nil, since dependencies are only inPackage.swift.URLs().Downloadbuilds/{scope}/{name}/{version}.zip, sofetch.Resolverresolves Swift without a metadata request.NotFoundError.Names are
scope/name, the PURL namespace and name as git-pkgs/proxy's Swift handler already writes them (pkg:swift/apple/swift-nio), or the registry identifierscope.name. Both are checked against the spec's scope and name rules before any request. A host-style namespace likepkg:swift/github.com/apple/swift-argument-parseris rejected, because the API has no way to map a source host to a scope. Starting strict leaves room to add a mapping later without changing what existing names resolve to.The registry API expects
Accept: application/vnd.swift.registry.v1+jsonand paginates throughLinkheaders, andclient.Clienthard-codedAccept: application/jsonand didn't expose response headers.GetJSONWithHeadersadds both without changing the existing methods.Against
https://tuist.dev/api/registry/swift(git-pkgs/proxy's default Swift upstream),apple/swift-niolists 194 versions, 2.65.0 resolves with a checksum that matches the downloaded zip's sha256, and missing packages and versions returnNotFoundError. That registry omitsmetadataandpublishedAt, so those fields are optional here.https://claude.ai/code/session_01NxsA75HBjdWQKcdx7FDTDc