-
Notifications
You must be signed in to change notification settings - Fork 85
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
Run update check when any client command is executed #2909
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but when I tried this manually with devstack it tells me there's an update for every command. And if I were being picky, the text output at the end of the main command's output is too squashed up, could do with some vertical whitespace. Have approved but would be nice to fix the devstack issue
@@ -213,6 +217,9 @@ func (fsr *FsRepo) Init() error { | |||
if err != nil { | |||
return err | |||
} | |||
|
|||
// TODO this should be a part of the config. | |||
telemetry.SetupFromEnvs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be in Open and Init?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think our conclusion was maybe? And we're not confident enough to consolidate this.
"github.com/pkg/errors" | ||
) | ||
|
||
const endpoint = "http://update.bacalhau.org/version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a comment/todo to move this to configuration somewhere, otherwise we're at risk of doing a release just to satisfy a move to https or a diff domain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasons for this are:
- We do actually want everyone to always use this domain, and it shouldn't be configurable
- It's actually easier to migrate a hard-coded constant than a configuration value right now because we don't have any config migraiton capability
If the concern is about testing, there's a few ways we can do that even with a hard-coded value (e.g. a mock http client).
This commit automatically kicks off a background update check whenever any client command is executed and prints the result at the end of the command. This means that update notifications will be reported as part of normal client usage rather than just when requested using the version command.
5cc83cb
to
d2ad7db
Compare
Discussed with Ross and comments are above. Broadly we're happy to merge this as long as we get the "once a day" PR out next. So I'll pick that up ASAP. |
This commit automatically kicks off a background update check whenever any client command is executed and prints the result at the end of the command. This means that update notifications will be reported as part of normal client usage rather than just when requested using the version command.
Resolves #2893.