Skip to content

Commit

Permalink
Merge pull request #53 from SwiftPackageIndex/remove-old-dependency-c…
Browse files Browse the repository at this point in the history
…heck

Remove old dependency check
  • Loading branch information
finestructure authored Jan 5, 2024
2 parents a01e61f + 39c8878 commit 4cd97c1
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 401 deletions.
266 changes: 0 additions & 266 deletions Sources/ValidatorCore/Commands/CheckDependencies.swift

This file was deleted.

3 changes: 1 addition & 2 deletions Sources/ValidatorCore/Commands/Validator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import ArgumentParser
public struct Validator: AsyncParsableCommand {
public static var configuration = CommandConfiguration(
abstract: "SPI Validator",
subcommands: [CheckDependencies.self,
CheckDependencies2.self,
subcommands: [CheckDependencies2.self,
CheckRedirects.self,
MergeLists.self,
ApplyDenyList.self,
Expand Down
1 change: 1 addition & 0 deletions Sources/ValidatorCore/Github.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Foundation

import AsyncHTTPClient
import NIO
import NIOFoundationCompat
import NIOHTTP1

#if os(Linux)
Expand Down
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
23 changes: 0 additions & 23 deletions Tests/ValidatorTests/RegressionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,6 @@ import XCTest

final class RegressionTests: XCTestCase {

func test_issue_917() throws {
// Ensure we don't change existing package's capitalisation
// https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/917
// setup
let p1 = PackageURL(argument:
"https://github.com/1fr3dg/ResourcePackage.git")!
let dep = PackageURL(argument:
"https://github.com/1Fr3dG/SimpleEncrypter.git")!
let p2 = PackageURL(argument:
"https://github.com/1fr3dg/SimpleEncrypter.git")!
Current.decodeManifest = { url in
url == .init("https://raw.githubusercontent.com/1fr3dg/ResourcePackage/main/Package.swift")
? .mock(dependencyURLs: [dep])
: .mock(dependencyURLs: [])
}

// MUT
let urls = expandDependencies(inputURLs: [p1, p2], retries: 0)

// validate
XCTAssertEqual(urls, [p1, p2])
}

func test_issue_1449_DecodingError() throws {
// https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/1449
// also
Expand Down
Loading

0 comments on commit 4cd97c1

Please sign in to comment.