-
Notifications
You must be signed in to change notification settings - Fork 664
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
Add framework for an update checker and prompter #688
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.
We're trying to go for semantic versioning, so the target version scheme would be MAJOR.MINOR.PATCH
, also to simplify - if there's any suffix, it's a lower version. -pre
wouldn't be anything special.
And I think we can ignore the YEAR.MONTH...
version scheme as we've abandoned it and the updater would never see them?
So I'd order the (relevant) version numbers like so (newest to oldest):
v1.0.0
v1.0.0-blah
v0.6.0
v0.6.0-pre1
v0.5
WDYT?
Yep, ok. |
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.
Hmm this seems to do the checking on the client side, I thought we'd do this in the daemon and push through the RPC… I know both sides may actually be up for upgrade, so we may need both in the long run…
Seems there's a bunch of formatting-only changes, would be good if you undid them.
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.
Yep, ok.
Then again, we rely on git describe
to name versions, so a stable v0.6.0
would be treated as an update on v0.6.0-1-g123456
, which would be a later commit… Maybe we should go the dpkg
route... (alphabetical, with ~
lower than nil)…
Scratch that, missed the |
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.
This is a partial review only, but committing as I have already a few comments and requests.
I like the separation of the update_prompt
implementations and that the check is offloaded to a different thread. However, I am concerned with the safety of the current mechanism and have some suggestions to improve clarity.
Build will fail until we actually adopt semantic versioning |
We did already :) I fixed a tiny conflict in |
From CI:
|
9ec22d5
to
ca0290d
Compare
Codecov Report
@@ Coverage Diff @@
## master #688 +/- ##
==========================================
- Coverage 66.59% 66.51% -0.09%
==========================================
Files 168 174 +6
Lines 5943 6041 +98
==========================================
+ Hits 3958 4018 +60
- Misses 1985 2023 +38
Continue to review full report at Codecov.
|
Small change: moved all version string parsing into a single block, and catch any semver parse error. If either current version or update version string is not of the correct format, it will just print a warning (it used to crash) |
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.
Neat. Great approach overall. A few requests and questions below.
Improves formatting, due to heading newline, as well as consistency with other commands.
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.
Ok, I think we're at the point where we can merge, so let's go for it!
bors r=ricab,Saviq,townsend2010
688: Add framework for an update checker and prompter r=ricab,Saviq,townsend2010 a=gerboland An UpdatePrompt implementation decides if an update prompt should be shown to the user, and will populate the gRPC UpdateInfo struct with update information. GithubUpdatePrompt spins up a thread to check for updates every 24 hours, and will prompt the user that an update is available every 6 hours. DisabledUpdatePrompt is for platforms that have their own update mechanism that we use. Since on Linux we use Snaps, this is used. Co-authored-by: Gerry Boland <[email protected]> Co-authored-by: Michał Sawicz <[email protected]> Co-authored-by: Ricardo Abreu <[email protected]>
Build failed |
Expected failure on macOS. |
688: Add framework for an update checker and prompter r=ricab,Saviq,townsend2010 a=gerboland An UpdatePrompt implementation decides if an update prompt should be shown to the user, and will populate the gRPC UpdateInfo struct with update information. GithubUpdatePrompt spins up a thread to check for updates every 24 hours, and will prompt the user that an update is available every 6 hours. DisabledUpdatePrompt is for platforms that have their own update mechanism that we use. Since on Linux we use Snaps, this is used. Co-authored-by: Gerry Boland <[email protected]> Co-authored-by: Michał Sawicz <[email protected]> Co-authored-by: Ricardo Abreu <[email protected]>
An UpdatePrompt implementation decides if an update prompt should be shown to the user, and will populate the gRPC UpdateInfo struct with update information.
GithubUpdatePrompt spins up a thread to check for updates every 24 hours, and will prompt the user that an update is available every 6 hours.
DisabledUpdatePrompt is for platforms that have their own update mechanism that we use. Since on Linux we use Snaps, this is used.