Skip to content

Commit

Permalink
Remove deprecated (and now unused) Package.getManifestURL
Browse files Browse the repository at this point in the history
  • Loading branch information
finestructure committed Jan 5, 2024
1 parent 8d0de25 commit 0a914da
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
10 changes: 0 additions & 10 deletions Sources/ValidatorCore/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,6 @@ extension Package {
enum Manifest {}
typealias ManifestURL = Tagged<Manifest, URL>

@available(*, deprecated)
static func getManifestURL(client: HTTPClient, packageURL: PackageURL) -> EventLoopFuture<ManifestURL> {
Current.fetchRepository(client, packageURL.owner, packageURL.repository)
.map(\.defaultBranch)
.map { defaultBranch in
URL(string: "https://raw.githubusercontent.com/\(packageURL.owner)/\(packageURL.repository)/\(defaultBranch)/Package.swift")!
}
.map(ManifestURL.init(rawValue:))
}

static func getManifestURL(client: HTTPClient, repository: Github.Repository) async throws -> ManifestURL {
let manifestFiles = try await Github.listRepositoryFilePaths(client: client, repository: repository)
.filter { $0.hasPrefix("Package") }
Expand Down
15 changes: 0 additions & 15 deletions Tests/ValidatorTests/ValidatorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,6 @@ final class ValidatorTests: XCTestCase {
}
}

func test_getManifestURL_deprecated() throws {
// setup
let pkgURL = PackageURL(argument: "https://github.com/foo/bar")!
let client = HTTPClient(eventLoopGroupProvider: .singleton)
defer { try? client.syncShutdown() }

// MUT
let url = try Package.getManifestURL(client: client,
packageURL: pkgURL).wait()

// validate
XCTAssertEqual(url,
.init("https://raw.githubusercontent.com/foo/bar/main/Package.swift"))
}

func test_getManifestURL() async throws {
// setup
let client = HTTPClient(eventLoopGroupProvider: .singleton)
Expand Down

0 comments on commit 0a914da

Please sign in to comment.