Merge lp:~kfogel/launchpad/506018-patch-report into lp:launchpad
| Status: | Merged |
|---|---|
| Merged at revision: | not available |
| Proposed branch: | lp:~kfogel/launchpad/506018-patch-report |
| Merge into: | lp:launchpad |
| Diff against target: |
743 lines (+567/-9) 9 files modified
lib/canonical/launchpad/icing/style.css (+5/-1) lib/lp/bugs/browser/bugtarget.py (+74/-2) lib/lp/bugs/browser/configure.zcml (+8/-1) lib/lp/bugs/interfaces/bugtarget.py (+1/-1) lib/lp/bugs/interfaces/bugtask.py (+4/-0) lib/lp/bugs/model/bugtarget.py (+1/-1) lib/lp/bugs/stories/patches-view/patches-view.txt (+323/-0) lib/lp/bugs/templates/bugtarget-patches.pt (+125/-0) lib/lp/testing/factory.py (+26/-3) |
| To merge this branch: | bzr merge lp:~kfogel/launchpad/506018-patch-report |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Karl Fogel (community) | Approve on 2010-02-03 | ||
| Martin Albisetti (community) | ui | 2010-01-28 | Approve on 2010-02-03 |
| Abel Deuring (community) | code | Approve on 2010-02-02 | |
| Eleanor Berger (community) | code | 2010-01-28 | Approve on 2010-02-02 |
|
Review via email:
|
|||
| Karl Fogel (kfogel) wrote : | # |
| Martin Albisetti (beuno) wrote : | # |
Overall, this branch is fantastic. I know a lot of people will appreciate a lot your work on this.
A few small tweaks discussed on IRC:
- Padding in the tooltips would be super nice
- I'd add an "Order by: " label to the ordering drop down, and drop the "by" from each option to improve readability
- Bug icons don't respect importance
| Eleanor Berger (intellectronica) wrote : | # |
> === modified file 'lib/canonical/
> --- lib/canonical/
> +++ lib/canonical/
> @@ -1458,7 +1458,7 @@
>
> div.popupTitle {
> background: #ffffdc;
> - padding: 0 1em;
> + padding: 0.5em 1em;
> border: 1px black solid;
> position: absolute;
> display: none;
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -1,4 +1,4 @@
> -# Copyright 2009 Canonical Ltd. This software is licensed under the
> +# Copyright 2010 Canonical Ltd. This software is licensed under the
> # GNU Affero General Public License version 3 (see the file LICENSE).
>
> """IBugTarget-
> @@ -15,12 +15,15 @@
> "FileBugViewBase",
> "OfficialBugTag
> "ProjectFileBug
> + "BugsPatchesView",
> ]
Let's sort this alphabetically, so that it's easier to locate an export later.
>
> import cgi
> from cStringIO import StringIO
> +from datetime import datetime
> from email import message_from_string
> from operator import itemgetter
> +from pytz import timezone
> from simplejson import dumps
> import tempfile
> import urllib
> @@ -40,6 +43,7 @@
> from canonical.config import config
> from lp.bugs.
> from lp.bugs.
> +from lp.bugs.
> from canonical.
> BugFeedLink, BugTargetLatest
> PersonLatestBug
> @@ -73,6 +77,7 @@
> LaunchpadEditFo
> canonical_url, custom_widget, safe_action)
> from canonical.
> +from canonical.
> from canonical.
> from canonical.
> from canonical.
> @@ -1372,3 +1377,51 @@
> class BugsVHostBreadc
> rootsite = 'bugs'
> text = 'Bugs'
> +
> +
> +class BugsPatchesView
> + """View list of patch attachments associated with bugs."""
> +
> + @property
> + def label(self):
> + """The display label for the view."""
> + return 'Patch attachments in %s' % self.context.
> +
> + def batchedPatchTas
> + """Return a BatchNavigator for bug tasks with patch attachments."""
> + any_unresolved
> + UNRESOLVED_
We avoid using line continuation in Launchpad code, because we don't like how
it messes with the interpretation of the text file (the parser consideres
everything after the \ to actually be on the same line). Instead we use
parentheses, like this:
any_unresolved
UNRESOLVED_
| Abel Deuring (adeuring) wrote : | # |
On 28.01.2010 19:23, Tom Berger wrote:
>> === added directory 'lib/lp/
>> === added file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -0,0 +1,301 @@
>> +Patches View
>> +============
>> +
>> +Patches View by Product
>> +------
>> +
>> +We have a view listing patches attached to bugs that target a given
>> +product. At first, the product is new and has no bugs.
>> +
>> + >>> def make_thing(
>> + ... login('<email address hidden>')
>> + ... result = factory_
>> + ... transaction.
>> + ... logout()
>> + ... return result
>
> That's a nice helper function. Let's extract it out of this test and make it
> generally available to all tests. It probably deserves a more descriptive name,
> though.
A generally available function should have a way to specify the user
that should login: Some objects can only be created by script users.
And this is actually a good candidate for using the "with" statement --
provided that Jeroen does not object to using it for "transaction
wrapping". (see the notes for last reviewers meeting. Has Barry posted
them already?)
Something like
with factory.
factory.
would look much nicer than
make_
Abel
| Eleanor Berger (intellectronica) wrote : | # |
On 28 January 2010 19:51, Abel Deuring <email address hidden> wrote:
> On 28.01.2010 19:23, Tom Berger wrote:
>>> === added directory 'lib/lp/
>>> === added file 'lib/lp/
>>> --- lib/lp/
>>> +++ lib/lp/
>>> @@ -0,0 +1,301 @@
>>> +Patches View
>>> +============
>>> +
>>> +Patches View by Product
>>> +------
>>> +
>>> +We have a view listing patches attached to bugs that target a given
>>> +product. At first, the product is new and has no bugs.
>>> +
>>> + >>> def make_thing(
>>> + ... login('<email address hidden>')
>>> + ... result = factory_
>>> + ... transaction.
>>> + ... logout()
>>> + ... return result
>>
>> That's a nice helper function. Let's extract it out of this test and make it
>> generally available to all tests. It probably deserves a more descriptive name,
>> though.
>
> A generally available function should have a way to specify the user
> that should login: Some objects can only be created by script users.
>
> And this is actually a good candidate for using the "with" statement --
> provided that Jeroen does not object to using it for "transaction
> wrapping". (see the notes for last reviewers meeting. Has Barry posted
> them already?)
>
> Something like
>
> with factory.
> factory.
>
> would look much nicer than
>
> make_thing(
+1000000
| Karl Fogel (kfogel) wrote : | # |
Well, doing the Python 'with' thing in story test code proved problematic. But otherwise, all comments have been incorporated now, and pushed up. Thanks, guys.
| Karl Fogel (kfogel) wrote : | # |
Note that Michael Hudson effectively reviewed my re-submission when he reviewed
https:/
because he commented on my changes from here (which had been merged into that branch) as well as Tom's. I'm not sure he found any problems with Tom's, actually :-).
So, before reviewing this, please see Michael's comments; he may have already said what you were going to say.
| Eleanor Berger (intellectronica) wrote : | # |
You've addressed all of my concerns and the code looks great now.
| Abel Deuring (adeuring) wrote : | # |
Hi Karl,
I looked at the changes between revision 10189 and 10194 -- everything is fine.
| Abel Deuring (adeuring) wrote : | # |
recent screenshots for the UI review:
http://
http://
http://
http://
http://
| Martin Albisetti (beuno) wrote : | # |
A wonderful piece of work. The sooner this lands, the better.
| Karl Fogel (kfogel) wrote : | # |
LGTM too now, not that I'm a reviewer, and it's mostly my own change.

With Abel, add a "+patches" view based on IHasBugs.
The patch report lists bugtasks -- for bugs that have patch attachments -- on products, series, and packages. The listing can be sorted by importance, status, and bug age. (Sorting on patch age is not yet implemented, and will be done a separate branch. Likewise, the patch report for persons/teams is not yet implemented, and will be a separate branch.)
To review, load new sampledata from http:// people. canonical. com/~kfogel/ 506018/ newsampledata- dev.sql. gz . Then visit pages like these:
https:/ /bugs.launchpad .dev/patches- view-test/ +patches /bugs.launchpad .dev/firefox/ +patches /launchpad. dev/ubuntu/ +patches /bugs.launchpad .dev/ubuntu/ +source/ cdrkit/ +patches
https:/
https:/
https:/