Open OddBloke opened 5 years ago
So things are substantially complicated by the fact that we hand off to apt-get
to perform the whole time-consuming action, so as things stand it's largely a black box to us. Without any granularity of data, I think the best we can do is "5. a spinner".
I spoke with @julian-klode on IRC yesterday about our options, here is a (lightly edited) transcript:
<@Odd_Bloke> juliank: For the UA client, we are being asked if we can improve the progress feedback during the installation of packages; do you have any suggestions of how we could interact with apt to do this?
<juliank> Odd_Bloke: what does it do now? does it even let apt print progress?
<@Odd_Bloke> juliank: It just says "this could take a while" and then prints something out after apt is complete.
<juliank> ok
<@Odd_Bloke> So nothing, really.
<juliank> So why not show the apt output?
<juliank> I think there are also some progress fds for install, but not for download IIRC
<juliank> if you want full UI control, you'd have to go via python-apt and implementing progress classes
<@Odd_Bloke> juliank: Do you know of any examples of that python-apt use that I could take a look at?
<@Odd_Bloke> (Not looking for you to do any work here, this is probably low on our list of priorities!)
<juliank> Odd_Bloke: Not really
<@Odd_Bloke> OK, thanks for the help!
<juliank> Odd_Bloke: It's basically apt.Cache(); for name in names: cache[name].mark_install(); and then cache.commit()
<juliank> commit() takes two arguments
<juliank> https://apt-team.pages.debian.net/python-apt/library/apt.cache.html#apt.cache.Cache.commit
<juliank> The documentation is broken
<juliank> You can subclass AcquireProgress and InstallProgress in https://apt-team.pages.debian.net/python-apt/library/apt.progress.base.html
<juliank> or use existing text ones: https://apt-team.pages.debian.net/python-apt/library/apt.progress.text.html
To summarise: there isn't much we can do using the apt-get
command line (other than perhaps scrape the data or pass it through verbatim to the user), and we would need to transition to using python-apt to do anything more complex.
Alas. So, a spinner then? (See halo and yaspin for example.)
If activating a UA service is something you do only once or twice in the life of a system, and it’s not time-critical, it may be worthwhile for the operation to take a bit longer for the sake of having more informative progress. So I’ll repeat here my other suggestion, of doing apt-get install --download-only
first, so that you can output something like
Installing FIPS packages: ◐ Downloading…
and then during the real apt-get install
replacing that line with
Installing FIPS packages: ◒ Installing…
Thank you mpt, apologies for not capturing that here!
Tracking in SC-1155
During the UX review, it was noted that just emitting "This could take some time" is the worst way of signalling progress to users. The potential better ways of doing this, in order of desirability, are:
This issue is to determine the path we want to take.