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

Add an option to retry when GlotPress download fails on "429 Too Many Requests" errors #402

Merged
merged 3 commits into from
Aug 19, 2022

Conversation

AliSoftware
Copy link
Contributor

@AliSoftware AliSoftware commented Aug 18, 2022

Why?

We still keep having 429 - Too Many Requests errors from time to time when running the actions which download the app translations from GlotPress.

For example, on average I encounter those on at least 1-3 locales every time I'm doing a new beta or final release, forcing me to interrupt the lane, discard the unstaged changes in git, restart the lane from scratch again, and pray it will pass on those subsequent tries, otherwise I'll have to do all that again. And since the more you retry, the closer you are to the quota limit… things tend to actually get worse on subsequent retries.

This has become quite painful while doing betas and releases, especially for WordPress (which has more than 40 locales to download, so the chances of hitting the 429 error on at least one of them are higher)

How?

This simply asks the user if they want to retry a the download of a locale if one fails.

  • This not only allows us to avoid having to restart the whole lane and thus the download of all locales from scratch (reducing the risk of hitting the quota once again)
  • But also allows the script to pause until the user replies to the UI.confirm prompt before retrying, which allows to leave some time before the first and next retry of the request, giving us even more chances for the quota limit to cool down before the next try.

Related work

In parallel to that, other work is being done to help getting rid of this 429 error and quota limit. Especially, we've asked for the gp-import-export plugin to be installed on both of our GlotPress instances so we could do bulk-downloads of all the locales at once with a single request, and we plan to implement the code to in the release-toolkit to be able to use it hopefully soon (we already have a Draft here, but it's still very early stage so far).

Supporting bulk-download in the release-toolkit will require a bit more involved work though, for which I don't have the bandwidth for just yet. So this workaround of still using one-at-a-time locales download but allowing retry would hopefully help mitigate the issue in the meantime.

@AliSoftware AliSoftware self-assigned this Aug 18, 2022
@AliSoftware AliSoftware added the enhancement New feature or request label Aug 18, 2022
@AliSoftware AliSoftware changed the title Add an option to retry when GlotPress download fails Add an option to retry when GlotPress download fails on "429 Too Many Requests" errors Aug 18, 2022
@AliSoftware AliSoftware marked this pull request as ready for review August 18, 2022 12:54
@AliSoftware AliSoftware requested a review from a team August 18, 2022 12:54
Copy link
Contributor

@spencertransier spencertransier left a comment

Choose a reason for hiding this comment

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

These changes look good to me! I read through it and it all makes sense 👍

Copy link
Contributor

@mokagio mokagio left a comment

Choose a reason for hiding this comment

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

I'd normally make a snarky remark to suggest adding tests for the retry logic. But I don't think it's needed in this instance because:

  • Requires non-trivial test setup to cover a niche feature
  • We already have a new implementation of the whole workflow in the works, so any extra time spent here has low ROI

mokagio added a commit to wordpress-mobile/WordPress-iOS that referenced this pull request Aug 19, 2022
The automation hit an HTTP error, likely the known HTTP 429 GlotPress
error (e.g. see
wordpress-mobile/release-toolkit#402), and those
files were deleted.

The tooling is right in deleting the files when it can't find a
translation for them. But in this instance the translations were there,
we just had an issue in downloading them.

Notice that does not apply to the `release_notes.txt` file. There is no
translation available at this point in time.
@AliSoftware AliSoftware merged commit eab670b into trunk Aug 19, 2022
@AliSoftware AliSoftware deleted the l10n/429-retry branch August 19, 2022 10:53
AliSoftware added a commit to wordpress-mobile/WordPress-Android that referenced this pull request Aug 19, 2022
So I can get the latest non-breaking version of the release-toolkit for when I will be doing the final release later today

Especially as that latest minor version includes wordpress-mobile/release-toolkit#402 which will help me mitigate any quota limit error I'll very likely get while downloading latest translations from GlotPress
mokagio added a commit to wordpress-mobile/WordPress-iOS that referenced this pull request Sep 2, 2022
These were deleted during the last `gp_downloadmetadata` likely because
of a 429 error from GlotPress.

Various GlotPress actions were updated to retry when receiving a 429 in
wordpress-mobile/release-toolkit#402, but
`gp_downloadmetadata` was not one of them.
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.

3 participants