[FIX] Prevent rate limiting by changing setup.py to only reach out to the GitHub api to get the latest codeql cli version if args.check_latest_cli is set - #49
Merged
Michael Scovetta (scovetta) merged 1 commit intoJan 23, 2023
Conversation
…t online version if args.check_latest_cli is set.
Contributor
|
I already had a fix for this in: #47 .... but had issues getting licensing approval for the commit until today. This also includes support for a GITHUB_TOKEN for an authorized check/download of the github data. Our changes look pretty much the same for the initial version check. |
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.
Before this change, it would always call
codeql.get_latest_codeql_github_version()and only check if it should actually do anything with it afterwards based onargs.check_latest_cli. This meant that it was required to hit the github API to get the latest codeql version regardless ofargs.check_latest_clibeing set, which could lead to API ratelimiting and the setup script crashing before it could launch codeql.This change gates the
codeql.get_latest_codeql_github_version()call behind aargs.check_latest_clito prevent unnecessary reliance on being able to reach the github API if the codeql latest version isn't going to be used because thecheck_latest_cliargument isn't set.