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

Gracefully handle github api overload #128

Merged
merged 4 commits into from
Jul 13, 2023

Conversation

personalcomputer
Copy link
Contributor

@personalcomputer personalcomputer commented Mar 16, 2023

Bug Overview: ridectl mistakenly believes it is outdated whenever the GitHub API is overloaded. However, there is no update available, it believes it is outdated even if you have the latest version of ridectl.

Bug Impact: When ridectl beleives it is outdated, it halts what it is doing and creates a blocking user interaction prompt asking user if they want to update. This behavior of blocking and telling users to repeatedly update even though they are already on the latest version and no updates are availabile is very confusing for users (especially if the user does agree to update every time they are prompted, again and again, perhaps user will get stuck in a loop and not even realize they can skip this step and still use the tool...). Not only that, but by blocking on user input for no reason it breaks the ability to use ridectl within automated scripts.

Bug Repro steps:

  • 0.) Install latest version of ridectl
  • 1.) Invoke ridectl 1000 times (enough to hit github unauthenticated api rate limit. I hit it after only ~50 reqs or so today, it seems to be a shared limit of 1000/hour for all unauthenticated users in the world)
  • 2.) Invoke ridectl again -
    Expected behavior: ridectl will work as normal, except perhaps with a warning message saying it was unable to check the version.
    Observed behavior: ridectl errantly claims it is outdated and then completely halts, blocks waiting indefinitely for input on STDIN.

Fix

  • This PR provides a warning only if the github version check api (releases api) is down (ratelimited), instead of mistakenly prompting user to update.
  • This PR also adds unrelated change of reporting what the allegedly latest ridectl version is, whenever prompting user to update, so user can see visually how outdated they are and be able to confirm themselves if it is accurate or not.

@vivekjainx86 vivekjainx86 merged commit a057bc5 into master Jul 13, 2023
2 checks passed
@vivekjainx86 vivekjainx86 deleted the johnmi/dontblockwhenrunningathighvolume branch July 13, 2023 07:28
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.

4 participants