Skip to content
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

Feature: Add option to retry failed altool commands #163

Merged
merged 11 commits into from
Nov 5, 2021

Conversation

priitlatt
Copy link
Contributor

@priitlatt priitlatt commented Nov 5, 2021

When running app-store-connect publish, in some cases Apple's services respond with erroneous responses to package (ipa) validation and upload requests that are invoked via altool. For example it might happen that the validation passes successfully, but right after that upload fails with authentication error, which is clearly not an expected result.

> app-store-connect publish --path /path/to/app.ipa

Publish "/path/to/app.ipa" to App Store Connect
App name: Example App
Bundle identifier: com.example.app
Certificate expires: 2022-09-22T13:55:35.000+0000
Distribution type: App Store
Min os version: 12.0
Provisioned devices: N/A
Provisions all devices: No
Supported platforms: iPhoneOS
Version code: 2322
Version: 7.0.0

Validate "/path/to/app.ipa" for App Store Connect
{
    "tool-version": "4.059.1219",
    "tool-path": "/Applications/Xcode-13.0.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework",
    "success-message": "No errors validating archive at '/path/to/app.ipa'.",
    "os-version": "11.6.0"
}
No errors validating archive at '/path/to/app.ipa'.

Upload "/path/to/app.ipa" to App Store Connect
{
    "tool-version": "4.059.1219",
    "tool-path": "/Applications/Xcode-13.0.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework",
    "os-version": "11.6.0",
    "product-errors": [
        {
            "message": "Unable to authenticate.",
            "userInfo": {
                "NSLocalizedDescription": "Unable to authenticate.",
                "NSLocalizedFailureReason": "Unable to authenticate."
            },
            "code": -19209
        }
    ]
}
Failed to upload archive at "/path/to/app.ipa"
Failed to publish /path/to/app.ipa

To overcome this issue, implement a simple retrying mechanism that will attempt the failed operation again in case the error message matches known patterns:

> app-store-connect publish --path /path/to/app.ipa

Publish "/path/to/app.ipa" to App Store Connect
App name: Example App
Bundle identifier: com.example.app
Certificate expires: 2022-09-22T13:55:35.000+0000
Distribution type: App Store
Min os version: 12.0
Provisioned devices: N/A
Provisions all devices: No
Supported platforms: iPhoneOS
Version code: 2322
Version: 7.0.0

Validate "/path/to/app.ipa" for App Store Connect
{
    "tool-version": "4.059.1219",
    "tool-path": "/Applications/Xcode-13.0.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework",
    "success-message": "No errors validating archive at '/path/to/app.ipa'.",
    "os-version": "11.6.0"
}
No errors validating archive at '/path/to/app.ipa'.

Upload "/path/to/app.ipa" to App Store Connect
Failed to upload archive, but this might be a temporary issue, retrying...
Attempt #2 to upload failed, retrying...
{
    "tool-version": "4.050.1210",
    "tool-path": "/Applications/Xcode-13.0.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework",
    "success-message": "No errors uploading '/path/to/app.ipa'",
    "os-version": "11.2.0"
}
No errors uploading '/path/to/app.ipa'

@priitlatt priitlatt added the enhancement New feature or request label Nov 5, 2021
@priitlatt priitlatt marked this pull request as ready for review November 5, 2021 14:17
@priitlatt
Copy link
Contributor Author

Logic is ready for review. Copy is missing for couple of new arguments and changelog.

@priitlatt priitlatt merged commit 618f3f7 into master Nov 5, 2021
@priitlatt priitlatt deleted the feature/retry-failed-altool-commands branch November 5, 2021 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants