Merge lp:~allenap/launchpad/patch-report-for-people-and-teams-bug-506018 into lp:launchpad

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: not available
Merge reported by: Gavin Panella
Merged at revision: not available
Proposed branch: lp:~allenap/launchpad/patch-report-for-people-and-teams-bug-506018
Merge into: lp:launchpad
Prerequisite: lp:~kfogel/launchpad/506018-patch-report
Diff against target: 204 lines (+88/-7)
3 files modified
lib/lp/bugs/browser/bugtarget.py (+8/-3)
lib/lp/bugs/browser/configure.zcml (+7/-0)
lib/lp/bugs/stories/patches-view/patches-view.txt (+73/-4)
To merge this branch: bzr merge lp:~allenap/launchpad/patch-report-for-people-and-teams-bug-506018
Reviewer Review Type Date Requested Status
Eleanor Berger (community) code Approve
Review via email: mp+18414@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

IPerson does not inherit from IHasBugs, so I've registered the BugPatchesView for IPerson too, and added a simple test to show it works.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

nicely done!

review: Approve (code)
Revision history for this message
Gavin Panella (allenap) wrote :

Please see r10187, some changes that Abel suggested I add to this branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2010-02-03 17:54:20 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2010-02-03 17:54:22 +0000
@@ -70,6 +70,7 @@
70from lp.registry.interfaces.distributionsourcepackage import (70from lp.registry.interfaces.distributionsourcepackage import (
71 IDistributionSourcePackage)71 IDistributionSourcePackage)
72from lp.registry.interfaces.distroseries import IDistroSeries72from lp.registry.interfaces.distroseries import IDistroSeries
73from lp.registry.interfaces.person import IPerson
73from lp.registry.interfaces.product import IProduct74from lp.registry.interfaces.product import IProduct
74from lp.registry.interfaces.productseries import IProductSeries75from lp.registry.interfaces.productseries import IProductSeries
75from lp.registry.interfaces.project import IProject76from lp.registry.interfaces.project import IProject
@@ -1398,7 +1399,10 @@
1398 @property1399 @property
1399 def label(self):1400 def label(self):
1400 """The display label for the view."""1401 """The display label for the view."""
1401 return 'Patch attachments in %s' % self.context.displayname1402 if IPerson.providedBy(self.context):
1403 return 'Patch attachments for %s' % self.context.displayname
1404 else:
1405 return 'Patch attachments in %s' % self.context.displayname
14021406
1403 def batchedPatchTasks(self):1407 def batchedPatchTasks(self):
1404 """Return a BatchNavigator for bug tasks with patch attachments."""1408 """Return a BatchNavigator for bug tasks with patch attachments."""
@@ -1418,12 +1422,13 @@
1418 status=UNRESOLVED_PLUS_FIXRELEASED_BUGTASK_STATUSES,1422 status=UNRESOLVED_PLUS_FIXRELEASED_BUGTASK_STATUSES,
1419 omit_duplicates=True, has_patch=True),1423 omit_duplicates=True, has_patch=True),
1420 self.request)1424 self.request)
1421 1425
1422 def shouldShowTargetName(self):1426 def shouldShowTargetName(self):
1423 """Return True if current context can have different bugtargets."""1427 """Return True if current context can have different bugtargets."""
1424 return (IDistribution.providedBy(self.context) or1428 return (IDistribution.providedBy(self.context) or
1425 IDistroSeries.providedBy(self.context) or1429 IDistroSeries.providedBy(self.context) or
1426 IProject.providedBy(self.context))1430 IProject.providedBy(self.context) or
1431 IPerson.providedBy(self.context))
14271432
1428 def youngestPatch(self, bug):1433 def youngestPatch(self, bug):
1429 """Return the youngest patch attached to a bug, else error."""1434 """Return the youngest patch attached to a bug, else error."""
14301435
=== modified file 'lib/lp/bugs/browser/configure.zcml'
--- lib/lp/bugs/browser/configure.zcml 2010-02-03 17:54:20 +0000
+++ lib/lp/bugs/browser/configure.zcml 2010-02-03 17:54:23 +0000
@@ -115,6 +115,13 @@
115 facet="bugs"115 facet="bugs"
116 permission="zope.Public"116 permission="zope.Public"
117 template="../templates/bugtarget-patches.pt"/>117 template="../templates/bugtarget-patches.pt"/>
118 <browser:page
119 name="+patches"
120 for="lp.registry.interfaces.person.IPerson"
121 class="lp.bugs.browser.bugtarget.BugsPatchesView"
122 facet="bugs"
123 permission="zope.Public"
124 template="../templates/bugtarget-patches.pt"/>
118 </facet>125 </facet>
119 <browser:page126 <browser:page
120 name="+bugtarget-macros-search"127 name="+bugtarget-macros-search"
121128
=== modified file 'lib/lp/bugs/stories/patches-view/patches-view.txt'
--- lib/lp/bugs/stories/patches-view/patches-view.txt 2010-02-03 17:54:20 +0000
+++ lib/lp/bugs/stories/patches-view/patches-view.txt 2010-02-03 17:54:23 +0000
@@ -9,7 +9,7 @@
99
10 >>> patchy_product = factory.doAsUser(10 >>> patchy_product = factory.doAsUser(
11 ... 'foo.bar@canonical.com', factory.makeProduct,11 ... 'foo.bar@canonical.com', factory.makeProduct,
12 ... name='patchy-product-1')12 ... name='patchy-product-1', displayname="Patchy 1")
1313
14We don't see any patches when we open the patches view.14We don't see any patches when we open the patches view.
1515
@@ -76,6 +76,13 @@
76 From: Patchy Person76 From: Patchy Person
77 Link: patch_a.diff description of patch a77 Link: patch_a.diff description of patch a
7878
79The page title and other wording in the page reflects the contents.
80
81 >>> print_location(user_browser.contents)
82 Hierarchy: Patchy 1 > Bugs > Patch attachments in Patchy 1
83 Tabs: ...
84 Main heading: Patch attachments in Patchy 1
85
79After creating some more bugs, with some non-patch and some patch86After creating some more bugs, with some non-patch and some patch
80attachments...87attachments...
8188
@@ -218,7 +225,7 @@
218 ... 'foo.bar@canonical.com', make_bugtask,225 ... 'foo.bar@canonical.com', make_bugtask,
219 ... bug=bug_c, target=patchy_product_series)226 ... bug=bug_c, target=patchy_product_series)
220 >>> user_browser.open(227 >>> user_browser.open(
221 ... 'https://launchpad.dev/patchy-product-1/trunk/+patches')228 ... 'https://bugs.launchpad.dev/patchy-product-1/trunk/+patches')
222 >>> show_patches_view(user_browser.contents)229 >>> show_patches_view(user_browser.contents)
223 Bug Importance Status Patch Age230 Bug Importance Status Patch Age
224 Bug #18: bug_c title Wishlist Fix Committed ...second...231 Bug #18: bug_c title Wishlist Fix Committed ...second...
@@ -230,6 +237,13 @@
230 Link: patch_a.diff237 Link: patch_a.diff
231 description of patch a238 description of patch a
232239
240The page title and other wording in the page reflects the contents.
241
242 >>> print_location(user_browser.contents)
243 Hierarchy: Patchy 1 > Series trunk > Bugs > Patch attachments in trunk
244 Tabs: ...
245 Main heading: Patch attachments in trunk
246
233Patches View by Distro247Patches View by Distro
234----------------------248----------------------
235249
@@ -248,6 +262,7 @@
248 ... status=BugTaskStatus.TRIAGED)262 ... status=BugTaskStatus.TRIAGED)
249263
250 >>> user_browser.open('http://bugs.launchpad.dev/ubuntu/+patches')264 >>> user_browser.open('http://bugs.launchpad.dev/ubuntu/+patches')
265
251 >>> show_patches_view(user_browser.contents)266 >>> show_patches_view(user_browser.contents)
252 Bug Importance Status Package Patch Age267 Bug Importance Status Package Patch Age
253 Bug #18: bug_c title High Triaged a52dec ...second...268 Bug #18: bug_c title High Triaged a52dec ...second...
@@ -257,6 +272,11 @@
257 From: Patchy Person272 From: Patchy Person
258 Link: patch_a.diff description of patch a273 Link: patch_a.diff description of patch a
259274
275 >>> print_location(user_browser.contents)
276 Hierarchy: Ubuntu > Bugs > Patch attachments in Ubuntu
277 Tabs: ...
278 Main heading: Patch attachments in Ubuntu
279
260Patches View by Distro Series280Patches View by Distro Series
261-----------------------------281-----------------------------
262282
@@ -276,14 +296,16 @@
276 ... target='warty', target_is_distroseries_name=True,296 ... target='warty', target_is_distroseries_name=True,
277 ... importance=BugTaskImportance.HIGH,297 ... importance=BugTaskImportance.HIGH,
278 ... status=BugTaskStatus.TRIAGED)298 ... status=BugTaskStatus.TRIAGED)
279 >>> user_browser.open('https://launchpad.dev/ubuntu/hoary/+patches')299
300 >>> user_browser.open('https://bugs.launchpad.dev/ubuntu/hoary/+patches')
280 >>> show_patches_view(user_browser.contents)301 >>> show_patches_view(user_browser.contents)
281 Bug Importance Status Package Patch Age302 Bug Importance Status Package Patch Age
282 Bug #16: bug_a title Undecided New hoary ...second...303 Bug #16: bug_a title Undecided New hoary ...second...
283 From: Patchy Person304 From: Patchy Person
284 Link: patch_a.diff305 Link: patch_a.diff
285 description of patch a306 description of patch a
286 >>> user_browser.open('https://launchpad.dev/ubuntu/warty/+patches')307
308 >>> user_browser.open('https://bugs.launchpad.dev/ubuntu/warty/+patches')
287 >>> show_patches_view(user_browser.contents)309 >>> show_patches_view(user_browser.contents)
288 Bug Importance Status Package Patch Age310 Bug Importance Status Package Patch Age
289 Bug #18: bug_c title High Triaged warty ...second...311 Bug #18: bug_c title High Triaged warty ...second...
@@ -298,6 +320,11 @@
298 Link: patch_c.diff320 Link: patch_c.diff
299 description of patch c321 description of patch c
300322
323 >>> print_location(user_browser.contents)
324 Hierarchy: Ubuntu > Warty (4.10) > Bugs > Patch attachments in Warty
325 Tabs: ...
326 Main heading: Patch attachments in Warty
327
301Patches View by Source Package328Patches View by Source Package
302------------------------------329------------------------------
303330
@@ -318,3 +345,45 @@
318 Bug #16: bug_a title Medium Fix Released ...second...345 Bug #16: bug_a title Medium Fix Released ...second...
319 From: Patchy Person346 From: Patchy Person
320 Link: patch_a.diff description of patch a347 Link: patch_a.diff description of patch a
348
349 >>> print_location(user_browser.contents)
350 Hierarchy: Ubuntu > ?evolution? package > Bugs > Patch ...
351 Tabs: ...
352 Main heading: Patch attachments in evolution in ubuntu
353
354Patches View by Person and Team
355-------------------------------
356
357The patches view works for people and teams.
358
359 >>> user_browser.open(
360 ... 'http://bugs.launchpad.dev/~%s/+patches' % (
361 ... patch_submitter.name,))
362
363 >>> show_patches_view(user_browser.contents)
364 Bug Importance Status Package Patch Age
365 Bug #17: bug_b title Critical Confirmed patchy-product-1 ...second...
366 From: Patchy Person
367 Link: patch_c.diff
368 description of patch c
369 Bug #18: bug_c title High Triaged a52dec ...second...
370 From: Patchy Person
371 Link: patch_f.diff
372 description of patch f
373 Bug #18: bug_c title High Triaged warty ...second...
374 From: Patchy Person
375 Link: patch_f.diff
376 description of patch f
377 Bug #16: bug_a title Medium Fix Released evolution ...second...
378 From: Patchy Person
379 Link: patch_a.diff
380 description of patch a
381 Bug #18: bug_c title Wishlist Fix Committed patchy-product-1 ...second...
382 From: Patchy Person
383 Link: patch_f.diff
384 description of patch f
385
386 >>> print_location(user_browser.contents)
387 Hierarchy: Patchy Person > Patch attachments for Patchy Person
388 Tabs: ...
389 Main heading: Patch attachments for Patchy Person