Merge lp://qastaging/~dylanmccall/update-manager/group-by-applications into lp://qastaging/update-manager

Proposed by Dylan McCall
Status: Merged
Merged at revision: 2582
Proposed branch: lp://qastaging/~dylanmccall/update-manager/group-by-applications
Merge into: lp://qastaging/update-manager
Diff against target: 859 lines (+405/-239)
2 files modified
UpdateManager/Core/UpdateList.py (+175/-100)
UpdateManager/UpdatesAvailable.py (+230/-139)
To merge this branch: bzr merge lp://qastaging/~dylanmccall/update-manager/group-by-applications
Reviewer Review Type Date Requested Status
Dylan McCall (community) Needs Resubmitting
Barry Warsaw (community) Needs Fixing
Matthew Paul Thomas Pending
Review via email: mp+112678@code.qastaging.launchpad.net

Description of the change

This is a first step towards grouping updates according to the specification at https://wiki.ubuntu.com/SoftwareUpdates.

There are some details still to be worked out, but the feature so far is functional :)

Changes:
 - Changed the list of updates to a treeview, where updates are collapsed under application names.
 - UpdateList links updated packages to applications and groups them according to dependencies.
 - Restart required indicator is shown for packages with "XB-Restart-Required: system." There is a temporary override for linux-meta for testing purposes.
 - Update origins are not displayed.

Known issues, to be resolved with future work:
 - Indentation in the update tree view is presently hard coded and probably belongs (at least partly) in the light-themes package.
 - The 'Ubuntu base' update group should list specific core packages, not 'everything else.' The specification is unclear on what to do with everything else, so it's like this for the time being.
 - The Updates Required icon does not have its corresponding UI element below the download size text.
 - The Download column does not yet show a check mark for downloaded packages.
 - "Terminal" has an expander, with "gnome-terminal" as a child. Instead, group headers should simply be packages instead of their own things.

So, it isn't _finished_, but it does seem to be in a working state. The reason I'm interested in merging with trunk is because I want to keep our code in sync. Most of the crazy merge conflicts are probably done with now (especially since we seem to be standardized on 4 space indents). However, my diff spans _a lot_ of UpdateList.py and UpdatesAvailable.py, so any conflicts can be a real pain to deal with.

To post a comment you must log in.
2442. By Dylan McCall

Attempt to load a symbolic icon for 'restart required'.
Don't select second item in update list.

Revision history for this message
Barry Warsaw (barry) wrote :

See detailed review sent separately.

review: Needs Fixing
Revision history for this message
Barry Warsaw (barry) wrote :
Download full text (43.2 KiB)

Hi Dylan,

Thanks for your contribution to Update Manager, and to Ubuntu!

I've provided some detailed comments on the code below.

One thing I'd really like to see is some unittests, especially for the new
code in UpdateList.py. Would you like to take a crack at adding a few for
some of the new methods and classes you're adding? Have you run the existing
unittests to see if your changes have broken any of them? While Update
Manager doesn't have a fantastic test suite, I'm not crazy about making things
worse by adding more untested code.

Someone should also review the UI changes before this branch lands, probably
mpt or someone else on the design team. I'll request a review from mpt to
start with.

I did notice one UI problem when I ran your branch on Quantal. I see an
update for Ubuntu base (which I gather is a catch-all for anything that
doesn't fit into any other category). However, when I expand the arrow for
that group, I'm still left with a very short window, one row that contains the
"Ubuntu base" string, and a very long and mostly unusable scroll bar. Maybe
the window should expand vertically to fit the sub-package contents better, or
maybe the details window should be taller to start with.

Other than that, I think the groupings are a nice refactoring of the
information presented by Update Manager!

I'll mark the branch Needs Fixing for now, but I will be happy to re-review it
if you make the suggested changes.

=== modified file 'UpdateManager/Core/UpdateList.py'
--- UpdateManager/Core/UpdateList.py 2012-06-28 00:10:23 +0000
+++ UpdateManager/Core/UpdateList.py 2012-07-17 18:03:22 +0000
> @@ -1,25 +1,29 @@
> -# UpdateList.py
> +# UpdateList.py
> # -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; coding: utf-8 -*-
> -#
> +#

You need to be really careful about adding extra whitespace, as your patch
does here. There are several reason for this, but probably the most important
one is that such whitespace-only changes are just noise that distract from the
substantive changes, and reviews thereof. There are many options for ensuring
"whitespace normalization" in Python code, some of which can be accomplished
by your editor. E.g. I have nice functions for Emacs:

http://mail.python.org/pipermail/python-dev/2007-April/072773.html

> # Copyright (c) 2004-2008 Canonical
> -#
> +#
> # Author: Michael Vogt <email address hidden>
> -#
> -# This program is free software; you can redistribute it and/or
> -# modify it under the terms of the GNU General Public License as
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> # published by the Free Software Foundation; either version 2 of the
> # License, or (at your option) any later version.
> -#
> +#
> # This program is distributed in the hope that it will be useful,
> # but WITHOUT ANY WARRANTY; without even the implied warranty of
> # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> # GNU General Public License for more details.
> -#
> +#
> # You should have received a copy of the GNU General Public License
> # along with this program; if not, wri...

2443. By Dylan McCall

Merged changes from trunk.
Removed unnecessary TODO notes in UpdateList.py

2444. By Dylan McCall

Fixed unintended formatting changes.

2445. By Dylan McCall

Merged changes from trunk.

2446. By Dylan McCall

Fixed some code style errors in UpdateList.

Revision history for this message
Dylan McCall (dylanmccall) wrote :

Okay, I'm finally working on this and I'll let you know when it's all done. (Couple days, I hope). A lot of the weirder issues are due to me manually merging changes, apparently to the wrong version of UpdateList.py. Unfortunate waste of time, so thank you for being so patient, Barry! :)

2447. By Dylan McCall

Fixed lines longer than 79 characters in UpdateList.py.

2448. By Dylan McCall

Fixed style and commenting issues in UpdatesAvailable.py.

2449. By Dylan McCall

Merged changes from trunk

Revision history for this message
Dylan McCall (dylanmccall) wrote :

There, I think that covers the immediate problems. Those bizarre whitespace changes were because mterry had cleaned stuff up beautifully (along with the Python 3 update) between me starting and finishing this, and then I merged changes in the worst possible way. I'm sorry for taking so very long to get back to you.

Replacing pkg with package in UpdateList.py:
I'd like to leave "pkg" be in this branch, if that's okay, just because pkg seems to appear consistently across the application and in the previous version of UpdateList.py (even in the apt.pkg library we import). I agree it would be lovely to clean up, though. I honestly do cringe every time I abbreviate something :)

You were wondering about that weird function called _rate_application_for_package. Originally I had expected to need some fancier heuristics, but we seem to be getting along fine with what we have here. I agree with you, and I'll deal with that soon.

get_application_for_package:
GIO has a lovely function to parse a .desktop file, spitting out a class with a (localized) name, icon and such. The important bit is it's the same code we use in places like the Unity dash or the Applications menu in Gnome Panel, so it's all nice and familiar. Adding some comments to explain the purpose...

APP_INSTALL_PATH: Right now that is effectively the same thing that happens in Software Centre. I'm happy to turn it into a config parameter :)

I have some refactoring to do (and some new designs to implement!), so I think I will do that, and I will try to do tests and documentation alongside that work. I will resubmit then.

review: Needs Resubmitting
Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

I tried to merge trunk and got conflicts. You should merge trunk again and fix them (in UpdateManager/Core/UpdateList.py).

Some details:

=== modified file 'UpdateManager/Core/UpdateList.py'
--- UpdateManager/Core/UpdateList.py 2012-08-20 15:32:45 +0000
+++ UpdateManager/Core/UpdateList.py 2012-11-10 06:29:19 +0000
@@ -1,7 +1,7 @@
 # UpdateList.py
 # -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; coding: utf-8 -*-
 #
-# Copyright (c) 2004-2012 Canonical
+# Copyright (c) 2004-2008 Canonical

I think this shouldn't be modified.

 #
 # Author: Michael Vogt <email address hidden>
 #

You modified this file a lot, I think your name should be here too. :)

@@ -22,53 +22,103 @@

 from __future__ import print_function

+import warnings
+warnings.filterwarnings("ignore", "Accessed deprecated property",
+ DeprecationWarning)
+
 from gettext import gettext as _
-
-import apt
-import logging
 import operator
-import random
+import itertools
 import subprocess
+import os
+import glob
 import sys

What about alphabetical order here?

Revision history for this message
Michael Terry (mterry) wrote :

Dylan, I wanted to help push this over the hump. I've got a merged-with-trunk branch here: lp:~mterry/update-manager/group-by-application

I'll look into adding some unittests next and fixing the single-package headers next. Is there a team we could put a shared branch under?

Revision history for this message
Dylan McCall (dylanmccall) wrote :

Cool! There is not one at the moment, but feel free to add me to one. (I'll
be able to do that in about 8 hours).

I have a few local changes that I'm aiming to finish up and push by Sunday,
so we might want to chat about those over email or IRC or something, too.
They could make things a lot easier (once they are not broken),
particularly with single packages and packages that aren't applications;)

On Mon, Dec 17, 2012 at 11:04 AM, Michael Terry <<email address hidden>
> wrote:

> Dylan, I wanted to help push this over the hump. I've got a
> merged-with-trunk branch here:
> lp:~mterry/update-manager/group-by-application
>
> I'll look into adding some unittests next and fixing the single-package
> headers next. Is there a team we could put a shared branch under?
> --
>
> https://code.launchpad.net/~dylanmccall/update-manager/group-by-applications/+merge/112678
> You are the owner of lp:~dylanmccall/update-manager/group-by-applications.
>

Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

I can help too!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: