-
Notifications
You must be signed in to change notification settings - Fork 244
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
Improve update checker #122
Comments
Update: @baijum gave some nice pointers on how to solve this in https://gist.github.com/baijum/036a79ec2e85279af596d0a2a3e0e13e, continuing work. |
Prior to this commit, the latest release information was fetched from GitHub in a blocking manner, which means that even for a very quick command like `ocdev version`, the tool would wait for a few seconds before outputting the version, because the execution would be blocked on waiting for the response from GitHub APIs. This commit changes that and makes the request to GitHub concurrent and non-blocking. This means that if the request has not completed but the program execution has ended, then the tool will exit gracefully without waiting for the request to complete. However, if the program execution took longer than the request and the response has been received by the goroutine before the program execution is over, then, if applicable, the information is printed. Fixes redhat-developer#122
Prior to this commit, the latest release information was fetched from GitHub in a blocking manner, which means that even for a very quick command like `ocdev version`, the tool would wait for a few seconds before outputting the version, because the execution would be blocked on waiting for the response from GitHub APIs. This commit changes that and makes the request to GitHub concurrent and non-blocking. This means that if the request has not completed but the program execution has ended, then the tool will exit gracefully without waiting for the request to complete. However, if the program execution took longer than the request and the response has been received by the goroutine before the program execution is over, then, if applicable, the information is printed. Fixes redhat-developer#122
Prior to this commit, the latest release information was fetched from GitHub in a blocking manner, which means that even for a very quick command like `ocdev version`, the tool would wait for a few seconds before outputting the version, because the execution would be blocked on waiting for the response from GitHub APIs. This commit changes that and makes the request to GitHub concurrent and non-blocking. This means that if the request has not completed but the program execution has ended, then the tool will exit gracefully without waiting for the request to complete. However, if the program execution took longer than the request and the response has been received by the goroutine before the program execution is over, then, if applicable, the information is printed. Fixes redhat-developer#122
Prior to this commit, the latest release information was fetched from GitHub in a blocking manner, which means that even for a very quick command like `ocdev version`, the tool would wait for a few seconds before outputting the version, because the execution would be blocked on waiting for the response from GitHub APIs. This commit changes that and makes the request to GitHub concurrent and non-blocking. This means that if the request has not completed but the program execution has ended, then the tool will exit gracefully without waiting for the request to complete. However, if the program execution took longer than the request and the response has been received by the goroutine before the program execution is over, then, if applicable, the information is printed. Fixes redhat-developer#122
reopening Let's close this after we implement option to completely disable checking for updates |
we could implement configuration subcommand similar to
|
Also, we are fetching latest information from GitHub API. Problem is that this will hit Github API rate limiting after a few |
@kadel instead of hitting github API, can we have file like this, https://github.com/openshift/origin/blob/master/.release which we will update at every release ? |
We already have a version number in https://github.com/redhat-developer/odo/blob/master/cmd/version.go could we used that? |
@syamgk what is the status of this? |
working will push the initial commit today |
WIP PR can be found here #589 |
also #593 for eliminate calling GitHub API for version fetching |
Please, @kadel and all, don't use this signature for configuration of the CLI itself. This signature should be used for configuration of a component, meaning adding configuration to it in the form of an environment variable or a file, whether internally as a secret or configmap or value directly on the deployment. For CLI configuration I would propose one of the following alternatives:
And use set/unset/clear as verbs, instead of "create,update,delete" |
@jorgemoralespou You are right, it makes much more sense to reserve I don't like We have |
I never liked @gshipley @marekjelen any idea on how to name this? |
I am pretty much OK with the For the tool config |
so renaming it from config and configuration to utils and utility on my PR |
we can leave it as utils, utility is just more letters to type :-) commands should be |
Humm |
Current implementation noticeably slows ocdev execution even on a really fast internet connection.
We definitely should have an option to disable this check permanently. We could have something like ocdev config set checkForUpdates false and use config file to persist configuration.
We could also perform check only once a day (use config file to persist when check occurred last time)
we can do those in separate PR, but think that we definitely have to add a way to disable it.
Another option could be to perform check as async operation.
Update: 2018-07-12
Summary:
There are two things that are needed.
First
We need a configuration uption that will disable update checker.
There should be new commadn
odo config
Value of
UpdateNotification
is saved in config file.There is
Config
struct inconfig.go
that represent ODO config file structure. (odo/pkg/config/config.go
Line 31 in 4567402
There should be a new field called
UpdateNotification
.odo config set UpdateNotification false
sets value of this field to false, (or true ifodo config set UpdateNotification true
is called)Update checker should be started only when this configuration field is set to
true
.Default value if the configuration is not specified is
true
Second
We need a better way to check for updates that don't require calling GitHub API.
TBD
The text was updated successfully, but these errors were encountered: