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: Retry App Store Connect API requests that fail with server errors #249

Merged
merged 19 commits into from
Jul 26, 2022

Conversation

priitlatt
Copy link
Contributor

@priitlatt priitlatt commented Jul 25, 2022

Sometimes App Store Connect API responds to valid HTTP requests with server error response.

Those responses have status code 500 and have response payload as

{
    "errors": [
        {
            "status": "500",
            "code": "UNEXPECTED_ERROR",
            "title": "An unexpected error occurred.",
            "detail": "An unexpected error occurred on the server side. If this issue continues, contact us at https://developer.apple.com/contact/."
        }
    ]
}

Since this failure is unavoidable by the user, we should retry the request in case of server errors. As failed HTTP request break the whole action that depends on this failed App Store Connect API call, whole CI jobs can fail.

A common example of such interruption is when app-store-connect submit-to-app-store action is terminated due to 500 error in the middle of processing the upload.

With the changes in this PR app-store-connect tool gets a new option --api-server-error-retries that accepts integer values to define how many times App Store Connect API requests that fail due to server errors should be retried. By default three retry attemps are made.

Updated actions:

  • All app-store-connect actions and subactions.

@priitlatt priitlatt changed the base branch from master to logging/unexpected-errors-logging July 25, 2022 12:52
@priitlatt priitlatt marked this pull request as ready for review July 25, 2022 13:05
@priitlatt priitlatt added the enhancement New feature or request label Jul 25, 2022
Base automatically changed from logging/unexpected-errors-logging to master July 26, 2022 07:50
@priitlatt priitlatt merged commit 0aa03db into master Jul 26, 2022
@priitlatt priitlatt deleted the feature/retry-app-store-connect-500-errors branch July 26, 2022 07:55
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