Skip to content
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

refactor(dre): implementing background checks for upgrading #536

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

NikolaMilosa
Copy link
Contributor

As it says, this PR moves checking for new releases to a background thread, meaning it doesn't halt the execution of the commands.
Example of running any command when there is a new release available:

./target/debug/dre registry > /dev/null                                                        
 INFO  dre > Running version 0.4.0-2faf0cb-dirty
 INFO  dre::ic_admin > Using ic-admin: /home/nikola/bin/ic-admin.revisions/b39f782ae9e976f6f25c8f1d75b977bd22c81507/ic-admin
 INFO  ic_management_backend::registry > Using local registry path for network mainnet: /home/nikola/.cache/ic-registry-cache/mainnet/local_registry
 INFO  ic_management_backend::git_ic_repo > IC git repo path: /home/nikola/.cache/git/ic, lock file path: /home/nikola/.cache/git/ic.lock
 INFO  dre                                > There is a new version '0.4.1' available. Run 'dre upgrade' to upgrade

Example of running proposed dre upgrade:

./target/debug/dre upgrade                                                             
 INFO  dre > Running version 0.4.0-2faf0cb-dirty
 INFO  dre > Binary not up to date. Updating to 0.4.1
[00:00:00] [========================================] 1.45 KiB/1.45 KiB (0s) Done                                                                                                    
INFO  dre > Asset downloaded successfully
[00:00:04] [========================================] 49.87 MiB/49.87 MiB (0s) Done                                                                                                  
INFO  dre > Upgraded: 0.4.0-2faf0cb-dirty -> 0.4.1

NOTICE:
Since this is a now a subcommand, it is assumed that when you run dre upgrade you want to upgrade, thus the prompting for confirmation has been removed.

@NikolaMilosa NikolaMilosa requested a review from a team as a code owner June 26, 2024 09:52
@DFINITYManu
Copy link
Contributor

This is very cool! Thank you!

Copy link
Member

@sasa-tomic sasa-tomic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@NikolaMilosa NikolaMilosa merged commit 3e71733 into main Jun 26, 2024
4 checks passed
@NikolaMilosa NikolaMilosa deleted the nm-rethinking-upgrading branch June 26, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants