Skip to content

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

Merged
merged 5 commits into from
Oct 22, 2024

Conversation

cmcgee1024
Copy link
Member

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.

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.
@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@kkebo kkebo mentioned this pull request Oct 19, 2024
@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024
Copy link
Member Author

macOS is working in spite of reporting a CI failure:

Test Suite 'All tests' passed at 2024-10-19 14:42:19.909.
	 Executed 66 tests, with 0 failures (0 unexpected) in 82.744 (82.752) seconds

@kkebo
Copy link
Contributor

kkebo commented Oct 19, 2024

As far as I can tell from reading the logs, the actual error is this:

swiftpm_testing_helper/Entrypoint.swift:29: Fatal error: Failed to open test bundle at path /error: Exited with unexpected signal code 5

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:

  • XCTest
    • All tests passed
  • swift-testing
    • Crashed

@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

Copy link

@justice-adams-apple justice-adams-apple left a 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.")

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

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.")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.")

@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024
Copy link
Member Author

macOS CI tests are all passing despite reporting an error here.

@cmcgee1024 cmcgee1024 merged commit f627351 into swiftlang:main Oct 22, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants