-
Notifications
You must be signed in to change notification settings - Fork 47
Remove all usage of the GitHub API #172
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
The GitHub API was previously used to retrieve previous release nightly snapshot toolchains. There's no reason for someone to use swift.org to get access to those toolchains. Also, removing GitHub API dependencies from swiftly cleans up the code, and removes the test mock responses for the tags. Remove the remains of the GitHub API from the code, tests, and documentation.
@swift-ci test macOS |
…at cannot be found on swift.org
@swift-ci test macOS |
macOS is working in spite of reporting a CI failure:
|
As far as I can tell from reading the logs, the actual error is this:
The error occurred in swiftpm-testing-helper. And the following lines are related:
On Darwin, SwiftPM seems to run swiftpm-testing-helper for swift-testing tests. SwiftPM runs swift-testing tests after XCTest tests by default even if there are no swift-testing test cases. So the test results looked like:
|
@swift-ci test macOS |
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.
Super small typos, otherwise LGTM
do { | ||
tc = try await SwiftlyCore.httpClient.getSnapshotToolchains(platform: config.platform, branch: branch).map { ToolchainVersion.snapshot($0) } | ||
} catch let branchNotFoundError as SwiftlyHTTPClient.SnapshotBranchNotFoundError { | ||
throw Error(message: "The snapshot branch \(branchNotFoundError.branch) was not found on swift.org. Note that snapshot toolchains are only available for the current `main` release and the previous x.y (major.minor) release.") |
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.
Might want to use the word latest
here as opposed to previous
. In the update command we say
""The branch (branchNotFoundErr.branch) doesn't have any snapshots available on swift.org so this snapshot build cannot be updated. It is possible that there has been a new release on swift.org and the previous release snapshot are no longer available. Install a fresh snapshot toolchain from the either the latest release x.y (major.minor) or from the main branch.""
Where we tell users "previous" are gone, install "latest". But here we say that main and "previous" are available.
Basically just some very small confusion around previous != latest
Sources/Swiftly/Update.swift
Outdated
snapshot.branch == old.branch && snapshot.date > old.date | ||
} | ||
} catch let branchNotFoundErr as SwiftlyHTTPClient.SnapshotBranchNotFoundError { | ||
throw Error(message: "The branch \(branchNotFoundErr.branch) doesn't have any snapshots available on swift.org so this snapshot build cannot be updated. It is possible that there has been a new release on swift.org and the previous release snapshot are no longer available. Install a fresh snapshot toolchain from the either the latest release x.y (major.minor) or from the main branch.") |
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.
throw Error(message: "The branch \(branchNotFoundErr.branch) doesn't have any snapshots available on swift.org so this snapshot build cannot be updated. It is possible that there has been a new release on swift.org and the previous release snapshot are no longer available. Install a fresh snapshot toolchain from the either the latest release x.y (major.minor) or from the main branch.") | |
throw Error(message: "The branch \(branchNotFoundErr.branch) doesn't have any snapshots available on swift.org so this snapshot build cannot be updated. It is possible that there has been a new release on swift.org and the previous release snapshots are no longer available. Install a fresh snapshot toolchain from the either the latest release x.y (major.minor) or from the main branch.") |
@swift-ci test macOS |
macOS CI tests are all passing despite reporting an error here. |
The GitHub API was previously used to retrieve previous release nightly snapshot toolchains. There's no reason for someone to use swift.org to get access to those toolchains. Also, removing GitHub API dependencies from swiftly cleans up the code, and removes the test mock responses for the tags.
Remove the remains of the GitHub API from the code, tests, and documentation.