-
Notifications
You must be signed in to change notification settings - Fork 1.4k
integrate registry dependencies into dependency resolution #3873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
003df90
to
09a9bd8
Compare
XCTAssertMatch(workspace.delegate.events, ["did load manifest for remoteSourceControl package: http://localhost/org/bar"]) | ||
} | ||
|
||
func testBasicResolutionFromRegistry() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
@swift-ci please smoke test |
@yim-lee note changes to |
} | ||
|
||
// <http://packages.example.com/mona/LinkedList/1.1.1/Package.swift?swift-version=4>; rel="alternate"; filename="[email protected]"; swift-tools-version="4.0", | ||
func parseLinkLine(_ value: String) throws -> ManifestLink? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is kinda terrible, open to better ideas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move all this into an HTTPHeader extension
@swift-ci please smoke test |
6aecf95
to
fba8248
Compare
@swift-ci please smoke test |
guard let url = URL(string: self.url), | ||
url.scheme == "https" | ||
else { | ||
guard let url = URL(string: self.url), url.scheme == "https" else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safer to do case-insensitive compare
@@ -65,14 +65,14 @@ public struct PackageIdentity: CustomStringConvertible { | |||
} | |||
|
|||
// TODO: formalize package registry identifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR: is this done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would need to take another look. will address in follow up PR of needs more attention, it works fine for the test cases I ran
} | ||
|
||
// <http://packages.example.com/mona/LinkedList/1.1.1/Package.swift?swift-version=4>; rel="alternate"; filename="[email protected]"; swift-tools-version="4.0", | ||
func parseLinkLine(_ value: String) throws -> ManifestLink? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move all this into an HTTPHeader extension
public var id: String | ||
public var version: String | ||
public var resources: [Resource] | ||
public var metadata: AdditionalMetadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was assuming we would need this, see #3873 (comment)
// MARK: - Serialization | ||
|
||
extension RegistryClient { | ||
public enum Serialization { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure expanding a few lines of JSON processing code into JSON models is necessary. I don't think we care about most of the contents. e.g., we only care if a release
has problem
and don't care what the actual problem is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up with needing these for the test infrastructure which mimics the server, so instead of doing it only there I reused on both ends
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
motivation: support registries changes: * create RegistryPackageContainer to handle dependencies from registry, integrated with the previously introduces registry client * update workspace to create RegistryPackageContainer when dealing with registry dependencies * update registry client (RegitryManager) to perform download request (buffered) when downloading the package archive * update registry client manifest listing and handling so it supportes multi-manifest setups. simplified the client to return the manifest content instead of attempting to load it which is done in RegistryPackageContainer which has additional context * update registry client to use Codable * add testing infrastructure to MockWorkspace to mock registry dependencies * add basic tests for regsitry scenarios
fba8248
to
ce1bf91
Compare
@swift-ci please smoke test |
motivation: support registries
changes: