Remove printlog from downloadURLFromGit function#978
Merged
scriptingosx merged 1 commit intoInstallomator:mainfrom May 26, 2023
Merged
Remove printlog from downloadURLFromGit function#978scriptingosx merged 1 commit intoInstallomator:mainfrom
scriptingosx merged 1 commit intoInstallomator:mainfrom
Conversation
The printlog function uses echo which causes unexpected output from the function "downloadURLFromGit". Example: In function "downloadURLFromGit", if the downloadURL cannot be read from Github API (which it can't very often because of the Github API ratelimit being set to 60 requests per 60 minutes from the same IP) the "printlog" function used will use an echo to write message to console. However this echo:d message will also be the final output of the function "downloadURLFromGit" since the variable "$downloadURL" is not empty. When running Installomator in DEBUG mode and trying to download dockutil and the x-ratelimit-limit is reached for the IP I request from the function "downloadURLFromGit" will output the following to the variable $downloadURL: "2023-04-05 14:58:22 : INFO : dockutil : GitHub API not returning URL, trying https://github.com/kcrawford/dockutil/releases/latest." This can also be seen in the console DEBUG output for the $downloadURL variable: 2023-04-05 14:58:23 : DEBUG : dockutil : downloadURL=2023-04-05 14:58:22 : INFO : dockutil : GitHub API not returning URL, trying https://github.com/kcrawford/dockutil/releases/latest. Source: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting
Collaborator
|
Thank you! |
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.
The printlog function uses echo which causes unexpected output from the function "downloadURLFromGit".
Example:
In function "downloadURLFromGit", if the downloadURL cannot be read from Github API (which it can't very often because of the Github API ratelimit being set to 60 requests per 60 minutes from the same IP) the "printlog" function used will use an echo to write message to console. However this echo:d message will also be the final output of the function "downloadURLFromGit" since the variable "$downloadURL" is not empty. When running Installomator in DEBUG mode and trying to download dockutil and the x-ratelimit-limit is reached for the IP I request from the function "downloadURLFromGit" will output the following to the variable $downloadURL: "2023-04-05 14:58:22 : INFO : dockutil : GitHub API not returning URL, trying https://github.com/kcrawford/dockutil/releases/latest."
This can also be seen in the console DEBUG output for the $downloadURL variable: 2023-04-05 14:58:23 : DEBUG : dockutil : downloadURL=2023-04-05 14:58:22 : INFO : dockutil : GitHub API not returning URL, trying https://github.com/kcrawford/dockutil/releases/latest.
Source:
https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting