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

reducing duplicate information in upgrade output #326

Open
carlwgeorge opened this issue Feb 28, 2023 · 11 comments
Open

reducing duplicate information in upgrade output #326

carlwgeorge opened this issue Feb 28, 2023 · 11 comments
Assignees
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Milestone

Comments

@carlwgeorge
Copy link

I noticed in the output of dnf5 upgrade there is quite a bit of duplicated information as compared to the output of dnf upgrade.

  • example dnf output
=======================================================================================================
 Package                  Architecture         Version                     Repository             Size
=======================================================================================================
Upgrading:
 filesystem               x86_64               3.18-4.fc39                 rawhide               1.1 M
  • example dnf5 output
Package                           Arch      Version                          Repository            Size
Upgrading:                                                                                             
 filesystem                       x86_64    3.18-4.fc39                      rawhide          106.0   B
   replacing filesystem           x86_64    3.18-3.fc38                      rawhide          106.0   B

Having two lines for every package with (usually) duplicated information is a lot of visual noise. For updates with many packages it makes it difficult to parse the given information quickly. While I understand that each of these fields can technically have a different value, most of this information is usually the same and not that useful to always show.

My first instinct is can we make the default dnf5 output more terse, closer to the dnf output, with just information about the new package? The more detailed output (the "replacing" line) could be available with the verbose flag. For obsoletes we could always show the "replacing" line, which is similar to what dnf does today.

That said, I do like the idea of always seeing both old and new versions in the output, but that is the only field I feel that way about. Perhaps we could change the output to be something like this:

Package                        Arch       Old Version     New Version        Repository            Size
Upgrading:                                                                                          
 filesystem                    x86_64     3.18-3.fc38     3.18-4.fc39        rawhide          106.0   B

This will show the most important changing information (the version) while leaving out the information that is usually the same. What do you think?

@Conan-Kudo
Copy link
Member

Does that fit in an 80x24 window? I think that's the major constraint we have with this stuff. Otherwise, yeah, looks good to me.

@carlwgeorge
Copy link
Author

The constraint of 24 rows doesn't make any sense to me, as the output will routinely go over that when there are multiple packages in the transaction.

At a constraint of 80 characters wide, even the current output will wrap with long package names. Example:

Package                      Arch   Version                 Repository      Size
Installing:
 NetworkManager-config-connectivity-fedora
                             noarch 1:1.42.0-1.fc39         rawhide    310.0   B

I also tried to trigger this wrapping for a long package version, and I think I found a bug. The current rawhide version of iscsi-initiator-utils is 6.2.1.4-10.git2a8f9d8.fc38, and instead of wrapping dnf5 chops off a few characters.

Package                      Arch   Version                 Repository      Size
Installing:
 iscsi-initiator-utils       x86_64 6.2.1.4-10.git2a8f9d8.f rawhide      1.4 MiB

If we're struggling for space to make the output work in 80 characters width, I would suggest dropping the arch field. Users know what architecture they're running, and packages switching to/from noarch is fairly uncommon. Even when it does happen that doesn't necessarily need to be in the default output. It could look something like this:

Package                 Old Version      New Version      Repository        Size
Upgrading:
 filesystem             3.18-3.fc38      3.18-4.fc39      rawhide        106.0 B

@j-mracek
Copy link
Contributor

I am sorry but having additional column is a nice idea if we would have only a table for upgrade operation. For downgrade operation the name of the new column is not the best and for operation remove and install the additional column is inappropriate.

In a case when replaced package the scheme will also not work nicely. In case when one package is replacing multiple packages it would be also a problem.

Obsolete - package is replacing a package or packages with a different name or with the same name.

I would be very careful with dropping ARCH column because even standard x86_64 system uses 3 basic architecture -> x86_64, i686, noarch, but there could be even more compatible architecture names.

@github-project-automation github-project-automation bot moved this to Backlog in DNF team Mar 10, 2023
@Conan-Kudo
Copy link
Member

x86_64 will potentially have seven architectures now (x86_64, x86_64_v2, x86_64_v3, x86_64_v4, i586, i686, noarch) depending on the distribution.

@carlwgeorge
Copy link
Author

I am sorry but having additional column is a nice idea if we would have only a table for upgrade operation. For downgrade operation the name of the new column is not the best and for operation remove and install the additional column is inappropriate.

For a downgrade operation, the old version would just be higher than the new version. Old and new in this context do not mean a version that sorts higher, but rather old as in before the transaction and new as in after the transaction. If you'd rather the names of the columns be literal before/after version instead of old/new version, I would be fine with that as well. Example:

Package                        Arch       Old Version     New Version        Repository            Size
Downgrading:                                                                                          
 foo                           x86_64     1.0-2.fc39      1.0-1.fc39         rawhide            106.0 B

For a remove or install operation, it would be simple to use "n/a", "none", or "-" as needed.

Package                        Arch       Old Version     New Version        Repository            Size
Installing:                                                                                          
 foo                           x86_64     n/a             1.0-2.fc39         rawhide            106.0 B
Package                        Arch       Old Version     New Version        Repository            Size
Removing:          
 foo                           x86_64     1.0-2.fc39      n/a                rawhide            106.0 B

In a case when replaced package the scheme will also not work nicely. In case when one package is replacing multiple packages it would be also a problem.

I think the "n/a" solution can work for this too. The replacing package would only have a version in the new version column, and the packages being replaced would only have a version in the old version column.

Package                        Arch       Old Version     New Version        Repository            Size
Upgrading:                                                                                             
 foo                           x86_64     n/a             1.0-1.fc39         rawhide            106.0 B
   replacing bar               x86_64     1.0-1.fc39      n/a                rawhide            106.0 B
   replacing baz               x86_64     1.0-1.fc39      n/a                rawhide            106.0 B

I would be very careful with dropping ARCH column because even standard x86_64 system uses 3 basic architecture -> x86_64, i686, noarch, but there could be even more compatible architecture names.

I only brought up the arch column because of the feedback about the terminal size constraints. I still feel that it's not necessary output the vast majority of the time, but I don't have a problem keeping it. Let's drop that idea and just keep this issue focused on the original goal of not having duplicate lines when possible.

@pavelbraginskiy
Copy link

It would be really nice if the output was in some way user-configurable. If a user has a small terminal, they probably especially don't want the upgrade operation taking up double vertical space, maybe they might choose to opt out of showing the Arch column if they don't find it useful.

@hrw
Copy link

hrw commented Jun 14, 2023

It also hides the moment when packageX Replaces packageY.

@j-mracek j-mracek added the Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take label Aug 30, 2023
@itaniknight
Copy link

dnf5 is now replacing dnf4 (and yum) in this rawhide update I just got, so this feels like a good time to comment.

dnf4's output is great, I think:

 pipewire-gstreamer            x86_64 1.0.6-1.fc41           rawhide    65 k
 pipewire-jack-audio-connection-kit
                               x86_64 1.0.6-1.fc41           rawhide    16 k
 pipewire-jack-audio-connection-kit-libs
                               x86_64 1.0.6-1.fc41           rawhide   133 k
 pipewire-libs                 i686   1.0.6-1.fc41           rawhide   1.9 M
 pipewire-libs                 x86_64 1.0.6-1.fc41           rawhide   1.8 M
 pipewire-pulseaudio           x86_64 1.0.6-1.fc41           rawhide   198 k
 pipewire-utils                x86_64 1.0.6-1.fc41           rawhide   334 k
 python3-dnf                   noarch 4.20.0-1.fc41          rawhide   621 k
 python3-dnf-plugins-core      noarch 4.7.0-1.fc41           rawhide   318 k
 python3-nftables              x86_64 1:1.0.9-4.fc41         rawhide    20 k
 tpm2-tss                      x86_64 4.1.1-1.fc41           rawhide   412 k
 tpm2-tss-fapi                 x86_64 4.1.1-1.fc41           rawhide   331 k
 xorg-x11-server-Xephyr        x86_64 1.20.14-36.fc41        rawhide   1.0 M
 xorg-x11-server-Xorg          x86_64 1.20.14-36.fc41        rawhide   1.5 M
 xorg-x11-server-common        x86_64 1.20.14-36.fc41        rawhide    36 k
Installing group/module packages:
 dnf5                          x86_64 5.2.1.0-1.fc41         rawhide   696 k
     replacing  dnf.noarch 4.19.2-1.fc41
     replacing  yum.noarch 4.19.2-1.fc41

Each package on one line, unless the name is very long or the package is replacing something with a different name.

dnf5 is doing this:

 pipewire-gstreamer                                 x86_64 1.0.6-1.fc41            rawhide    133.1 KiB
  replacing pipewire-gstreamer                      x86_64 1.0.5-2.fc41            rawhide    128.9 KiB
 pipewire-jack-audio-connection-kit                 x86_64 1.0.6-1.fc41            rawhide     30.0   B
  replacing pipewire-jack-audio-connection-kit      x86_64 1.0.5-2.fc41            rawhide     30.0   B
 pipewire-jack-audio-connection-kit-libs            x86_64 1.0.6-1.fc41            rawhide    440.4 KiB
  replacing pipewire-jack-audio-connection-kit-libs x86_64 1.0.5-2.fc41            rawhide    440.4 KiB
 pipewire-libs                                      i686   1.0.6-1.fc41            rawhide      6.6 MiB
  replacing pipewire-libs                           i686   1.0.5-2.fc41            rawhide      6.6 MiB
 pipewire-libs                                      x86_64 1.0.6-1.fc41            rawhide      6.8 MiB
  replacing pipewire-libs                           x86_64 1.0.5-2.fc41            rawhide      6.8 MiB
 pipewire-pulseaudio                                x86_64 1.0.6-1.fc41            rawhide    410.6 KiB
  replacing pipewire-pulseaudio                     x86_64 1.0.5-2.fc41            rawhide    410.6 KiB
 pipewire-utils                                     x86_64 1.0.6-1.fc41            rawhide      1.0 MiB
  replacing pipewire-utils                          x86_64 1.0.5-2.fc41            rawhide      1.0 MiB
 python3-nftables                                   x86_64 1:1.0.9-4.fc41          rawhide     45.3 KiB
  replacing python3-nftables                        x86_64 1:1.0.9-3.fc40          anaconda    45.3 KiB
 tpm2-tss                                           x86_64 4.1.1-1.fc41            rawhide      1.5 MiB
  replacing tpm2-tss                                x86_64 4.1.0-1.fc41            rawhide      1.5 MiB
 tpm2-tss-fapi                                      x86_64 4.1.1-1.fc41            rawhide    866.1 KiB
  replacing tpm2-tss-fapi                           x86_64 4.1.0-1.fc41            rawhide    866.1 KiB
 xorg-x11-server-Xephyr                             x86_64 1.20.14-36.fc41         rawhide      2.3 MiB
  replacing xorg-x11-server-Xephyr                  x86_64 1.20.14-35.fc41         rawhide      2.3 MiB
 xorg-x11-server-Xorg                               x86_64 1.20.14-36.fc41         rawhide      3.6 MiB
  replacing xorg-x11-server-Xorg                    x86_64 1.20.14-35.fc41         anaconda     3.6 MiB
 xorg-x11-server-common                             x86_64 1.20.14-36.fc41         rawhide    127.3 KiB
   replacing xorg-x11-server-common                 x86_64 1.20.14-35.fc41         anaconda   127.3 KiB

Which is not only repeating a lot of information, but because the phrase "replacing pipewire-jack-audio-connection-kit-libs" is so long it's using 103 columns per line, and at 80 columns that means there's 4 vertical lines per package update.

dnf5 is a big upgrade, I'm happy to install it. This one thing feels like a bit of a step backwards though.

@carlwgeorge
Copy link
Author

Another possible way to handle this would be to include two version strings in the version column when it is an upgrade.

Package                        Arch       Version                            Repository            Size
Upgrading:                                                                                             
 filesystem                    x86_64     3.18-8.fc40 > 3.18-9.fc41          rawhide          106.0   B

In an install or remove transaction, just a single version can be shown.

Package                        Arch       Version                            Repository            Size
Installing:                                                           
 filesystem                    x86_64     3.18-9.fc41                        rawhide          106.0   B

@long-walk
Copy link

@carlwgeorge in #1191 there is already a working implementation that use this approach. Take a look there.

@pmatilai
Copy link
Member

To me the biggest problem with the current dnf5 upgrade output (as of 5.2.7) is that the kind of anomalies that you'd want to spop get drowned in the noise when all that info is provided for every single "perfectly normal" update. Including but not limited to obsoletes, which is the thing I think about when I see "replacing". There seem to be some color encoding to differentiate obsoletes from regular updates but it should really say so instead, because color info gets easily lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
Status: In Progress
Development

No branches or pull requests

10 participants