start-os icon indicating copy to clipboard operation
start-os copied to clipboard

Make install progress visible from the CLI

Open ProofOfKeags opened this issue 3 years ago • 6 comments

It would be nice to know what the install progress was even in a CLI context

Reported by @chrisguida

ProofOfKeags avatar Sep 23 '21 19:09 ProofOfKeags

nifty progress bar lib https://github.com/mitsuhiko/indicatif

chrisguida avatar Oct 04 '21 20:10 chrisguida

The install progress of what?

mirkoRainer avatar May 08 '22 02:05 mirkoRainer

@mirkoRainer all installs. Was picturing package installs when I wrote this, but I suppose it could be implemented for OS updates as well.

chrisguida avatar May 09 '22 14:05 chrisguida

The install progress of what?

Currently you can see install progress in the UI dashboard but if you do a package install from the CLI you don't get any feedback about the progress of the install at the CLI. This ticket is to give a CLI style progress bar.

The approach to this would be to connect to the patchdb websocket feed and listen for diffs in the progress of the package being installed. After each update you would correspondingly update the progress bar.

ProofOfKeags avatar May 09 '22 15:05 ProofOfKeags

Am I correct in assuming that backend->src->install->mod.rs->cli_install would be an appropriate place to monitor the progress? Or maybe Line 125 pub async fn install?

It seems like there are two ways of installations, package.sideload and package.install.

I assume that package.install is the one to focus on.

If I'm in the right place, I assume that the progress bar would be external to this code but would be triggered concurrently while awaiting the cli_install code? I'm also going to have to read up on and understand more about what

#[command(
    custom_cli(cli_install(async, context(CliContext))),
    display(display_none)
)]
#[instrument(skip(ctx))]
pub async fn install(

does. And perhaps that will help me decide where to start.

The more I read this, the more I'm inclined to think the progress bar will be an async tokio call within install?

fwiw, I'm new to Rust with little practical application so thank you in advance for fielding my questions.

mirkoRainer avatar May 11 '22 20:05 mirkoRainer

Both would be nice actually. Sideloading refers to when you are installing a .s9pk that you have locally vs from a marketplace.

ProofOfKeags avatar May 11 '22 22:05 ProofOfKeags