Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
#59214 made
download()retry transport errors and HTTP 408/429/5xx, but the lookups that run before the downloads (resolveNightlyVersion,resolveLatestV1Versionand themaven-metadata.xmlfetch inresolveSnapshotUrl) still callfetchonce. One dropped connection to npm or Sonatype ends the SwiftPM setup withfetch failed, which is what took down the CI lanes linked in the issue.This adds a small
fetchWithRetrythat uses the same attempts, backoff and retryable statuses asdownload(), and the three lookups go through it. 404s and other client errors still fail on the first try.Fixes #59942
Changelog:
[INTERNAL] [FIXED] - Retry SwiftPM artifact version lookups on transient failures
Test Plan:
Added tests to
download-spm-artifacts-test.jsfor a dropped connection on the nightly lookup and a 503 on the snapshot metadata, and the latest-v1 failure test now checks it gives up after 3 attempts. The two tests that used a 5xx to mean "lookup failed" now use a 404. All 78 tests in the file pass, and the new ones fail without the change. I don't have Xcode on this machine, so I didn't run the full SwiftPM setup.