-
Notifications
You must be signed in to change notification settings - Fork 11
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
Handle Retracted Packages (Qt part) #82
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wfeldt
reviewed
Jan 21, 2020
wfeldt
approved these changes
Jan 21, 2020
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
shundhammer
changed the title
WIP: Handle Retracted Packages (Qt part)
Handle Retracted Packages (Qt part)
Jan 21, 2020
mvidner
pushed a commit
to mvidner/libyui-combined-alpha-3
that referenced
this pull request
Jan 15, 2021
…acted-01 WIP: Handle Retracted Packages (Qt part)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trello
https://trello.com/c/lRisXHUt/1556-8-package-selector-improvements-for-sle-8770-new-status-retracted
Jira
https://jira.suse.com/browse/SLE-11211
Related:
https://jira.suse.com/browse/SLE-8770
Summary
Add the new retracted status to the package selector in the YaST Qt UI.
Related PR
libyui/libyui-ncurses-pkg#34 (NCurses part)
Background: Retracted
If a maintenance update is released for any of our supported products, it may happen that after its release we realize that it introduces new problems, so we have to unpublish (retract) it.
So far, our maintenance team always managed to find other solutions, but sooner or later it will happen that it takes too long to realize that an update was broken, so users will install it.
So patches can now have a new special attribute retracted that indicates that a patch exists, but should not be installed. Since a patch can consist of multiple update packages, that status trickles down to each of those packages (in that exact version). libsolv (used by libzypp) handles this.
Package Versions View
Now retracted versions of the current package are displayed in red and with a text [RETRACTED] :
If a retracted version is already installed, the installed version is also marked in the same way:
New Classification Filter: Retracted Packages
Added two new filters:
(the latter still suffers from a bug in libzypp that is being fixed on the libzypp side right now).
Why Both Filters? Why Retracted AND Retracted Installed?
When experimenting with retracted packages, I always found it quite disconcerting to know that there were some retracted packages somewhere, but the filter did not show anything (because I did not have any of them installed).
This view will very rarely contain anything anyway. It is there mostly to reassure users that their system is not in danger, that they don't have anything installed that we consider potentially harmful (so we had to retract that version).
But a view that is always empty might as well just be broken; so it gives some more reassurance to be able to see all retracted packages, even those that you don't have installed. This view will normally also be empty, but as soon as our maintenance team starts using that feature, users will hear about it and wonder if their systems are affected. When they see retracted packages in that view, but not in the "retracted installed" view, they can feel safe.
Switch to Retracted Installed Packages View if any Installed
When entering the package selector in normal mode (i.e. not showing patterns, patches, upgrade problems etc.), check if any retracted package versions are installed. If there are any, switch to the "Package Classification" filter view and activate the "Retracted Installed Packages" filter.
Why no Warning Popup?
Even though we could also show a warning popup in that situation, that could become very problematic quite easily: If it was a conscious decision by the user to install those package versions, he would still get that warning every time he enters the package selection.
Adding a "Don't show this again" checkbox would not work well there: We'd have to save that for every combination of retracted installed package versions because that can and will change over time whenever newer versions (that are not retracted) of those packages are released and available for update. This would become very annoying quite quickly.
Also, this should only happen very rarely.
Preventing Auto-Selecting Retracted Package Versions
Libzypp already takes care about that. Libzypp will not voluntarily take a retracted package version into consideration as a candidate. And if dependencies would make that necessary, this would become a (pretty complex) dependency problem that needs more sophisticated handling, very much like other dependency problems.
Other Fixes
Dramatic Package List Destructor Performance Improvement
When switching away from the "All Packages" filter (or any other that has a lot of items in the package list), there was a long lag of 10-20 seconds until the list was cleared.
This was due to excessive duplicate bookkeeping which apparently made the underlying Qt widget remove individual items and do heavy recalculations (column widths? Widget total height for scrollbar length/position when adding up individual item heights?).
The YQPkgObjList used to keep track of excluded items in a separate map, but that turned out to be completely redundant: When switching exclude rules like show/don't show -devel or -debuginfo etc. packages, it uses the underlying QTreeWidgetItem's hidden flag. When iterating over all items, it includes those hidden items by default, so the exclude rules were applied twice for items that were previously excluded.
When clearing the list, it would iterate over the excluded items separately, deleting one by one, which in turn causes the underlying QTreeItemWidget to do recalculations which are completely unneccessary anyway when right after that the widget is cleared.
Removing all that redundant code got rid of that 10-20 seconds delay. It still takes some seconds to fill the list when there are many items (naturally), but clearing it now happens instantly.
Notes for Viewing the Diff
The diff is best viewed with whitespace changes suppressed.
Our mandatory C++ coding style was applied including indentation and fixing trailing whitespace, so there are many whitespace-only changes.