-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: add check updates command #577
base: master
Are you sure you want to change the base?
Conversation
b2f3436
to
dbe15b4
Compare
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.
Looking good and just a few comments.
Can you also please add descriptions to any PRs so it makes it easier to review. This should include things like
- Added commands (screenshots of the output is very useful)
- Changes to behaviour.
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.
Would love to get this merged soon! Just a small merge conflict and a few linting rules but then I think it would be good to go
simplified check_updates command fix: more user-friendly error message for check_updates on Config write failure
ff13a84
to
568c2d4
Compare
Merge conflict rectified via rebase. Apologies for the initial poor quality of this PR; most of it was discussed over Discord, and I didn't put the effort into reflecting the information here. |
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!
feat: check for updates in background and print on next run remove updates check from init, link and run move functions around in main.rs
79655eb
to
3a86854
Compare
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.
lgtm. well done!
This PR adds automatic (daily) checks for new updates for the CLI, only in interactive mode. Alternatively, a user may manually check for updates using the
railway check-updates
command.Automatic daily checks run in interactive mode, in the background, for any command called. If a new version is detected, the CLI will push a message to the user (similar to NPM) that requests they update their CLI.
Manual checks can be run as follows:
This is what the check-updates command looks like when the version has changed:

This is what the check-updates command looks like when the version has not changed:

This is what the automatic check looks like when the check detects that the version has changed:

The data is grabbed (rather slowly) via the GitHub API (endpoint https://api.github.com/repos/railwayapp/cli/releases/latest), which takes around 700ms to process. This is why we run the check in the background, and even then, we only run it daily.
First run:


Second run: