← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wallyworld/launchpad/dsp-expirable-bugs-973001 into lp:launchpad

 

Ian Booth has proposed merging lp:~wallyworld/launchpad/dsp-expirable-bugs-973001 into lp:launchpad.

Commit message:
Add new IHasExpirableBugs interface and redefine +expirable-bugs view to use it.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #973001 in Launchpad itself: "NotImplementedError BugTarget <security proxied lp.registry.model.distributionsourcepackage.DistributionSourcePackage instance at 0x12ef41d0> is not supported by . on +expirable-bugs page"
  https://bugs.launchpad.net/launchpad/+bug/973001

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/dsp-expirable-bugs-973001/+merge/128164

== Implementation ==

+expirable-bugs was defined for IBugTarget, but not everything implementing IBugTarget supports the required expirable bugs functionality. So I introduced a new IHasExpirableBugs marker interface and reworked the ZCML accordingly.

In practice, going to +expirable-bugs on a dsp now will raise a 404 instead of 500.

== Tests ==

Nothing new, rely on existing +expirable-bugs tests. 

== Lint ==

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/bugs/browser/configure.zcml
  lib/lp/bugs/interfaces/bugtarget.py
  lib/lp/registry/interfaces/distribution.py
  lib/lp/registry/interfaces/distroseries.py
  lib/lp/registry/interfaces/product.py
  lib/lp/registry/interfaces/productseries.py

-- 
https://code.launchpad.net/~wallyworld/launchpad/dsp-expirable-bugs-973001/+merge/128164
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wallyworld/launchpad/dsp-expirable-bugs-973001 into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/configure.zcml'
--- lib/lp/bugs/browser/configure.zcml	2012-10-04 01:52:19 +0000
+++ lib/lp/bugs/browser/configure.zcml	2012-10-05 05:39:22 +0000
@@ -69,7 +69,7 @@
             name="+bugs"
             template="../templates/buglisting-default.pt"/>
         <browser:page
-            for="lp.bugs.interfaces.bugtarget.IBugTarget"
+            for="lp.bugs.interfaces.bugtarget.IHasExpirableBugs"
             class="lp.bugs.browser.bugtask.BugTaskExpirableListingView"
             permission="zope.Public"
             name="+expirable-bugs"

=== modified file 'lib/lp/bugs/interfaces/bugtarget.py'
--- lib/lp/bugs/interfaces/bugtarget.py	2012-10-05 02:58:01 +0000
+++ lib/lp/bugs/interfaces/bugtarget.py	2012-10-05 05:39:22 +0000
@@ -9,6 +9,7 @@
     'BugDistroSeriesTargetDetails',
     'IBugTarget',
     'IHasBugs',
+    'IHasExpirableBugs',
     'IHasOfficialBugTags',
     'IOfficialBugTag',
     'IOfficialBugTagTarget',
@@ -288,6 +289,10 @@
         """
 
 
+class IHasExpirableBugs(Interface):
+    """Marker interface for entities supporting querying expirable bugs"""
+
+
 class IBugTarget(IHasBugs):
     """An entity on which a bug can be reported.
 

=== modified file 'lib/lp/registry/interfaces/distribution.py'
--- lib/lp/registry/interfaces/distribution.py	2012-09-05 06:48:36 +0000
+++ lib/lp/registry/interfaces/distribution.py	2012-10-05 05:39:22 +0000
@@ -67,6 +67,7 @@
 from lp.bugs.interfaces.bugsupervisor import IHasBugSupervisor
 from lp.bugs.interfaces.bugtarget import (
     IBugTarget,
+    IHasExpirableBugs,
     IOfficialBugTagTargetPublic,
     IOfficialBugTagTargetRestricted,
     )
@@ -138,7 +139,7 @@
     IHasOOPSReferences, IHasOwner, IHasSprints, IHasTranslationImports,
     ITranslationPolicy, IKarmaContext, ILaunchpadUsage, IMakesAnnouncements,
     IOfficialBugTagTargetPublic, IPillar, IServiceUsage,
-    ISpecificationTarget):
+    ISpecificationTarget, IHasExpirableBugs):
     """Public IDistribution properties."""
 
     id = Attribute("The distro's unique number.")

=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py	2012-10-03 08:41:47 +0000
+++ lib/lp/registry/interfaces/distroseries.py	2012-10-05 05:39:22 +0000
@@ -60,6 +60,7 @@
 from lp.blueprints.interfaces.specificationtarget import ISpecificationGoal
 from lp.bugs.interfaces.bugtarget import (
     IBugTarget,
+    IHasExpirableBugs,
     IHasBugs,
     IHasOfficialBugTags,
     )
@@ -173,7 +174,7 @@
     ISeriesMixin, IHasAppointedDriver, IHasOwner, IBugTarget,
     ISpecificationGoal, IHasMilestones, IHasOfficialBugTags,
     IHasBuildRecords, IHasTranslationImports, IHasTranslationTemplates,
-    IServiceUsage):
+    IServiceUsage, IHasExpirableBugs):
     """Public IDistroSeries properties."""
 
     id = Attribute("The distroseries's unique number.")

=== modified file 'lib/lp/registry/interfaces/product.py'
--- lib/lp/registry/interfaces/product.py	2012-10-03 18:35:09 +0000
+++ lib/lp/registry/interfaces/product.py	2012-10-05 05:39:22 +0000
@@ -90,6 +90,7 @@
 from lp.bugs.interfaces.bugsupervisor import IHasBugSupervisor
 from lp.bugs.interfaces.bugtarget import (
     IBugTarget,
+    IHasExpirableBugs,
     IOfficialBugTagTargetPublic,
     IOfficialBugTagTargetRestricted,
     )
@@ -433,7 +434,7 @@
 class IProductLimitedView(
     IBugTarget, ICanGetMilestonesDirectly, IHasAppointedDriver, IHasBranches,
     IHasBranchVisibilityPolicy, IHasDrivers, IHasExternalBugTracker, IHasIcon,
-    IHasLogo, IHasMergeProposals, IHasMilestones,
+    IHasLogo, IHasMergeProposals, IHasMilestones, IHasExpirableBugs,
     IHasMugshot, IHasOwner, IHasSprints, IHasTranslationImports,
     ITranslationPolicy, IKarmaContext, ILaunchpadUsage, IMakesAnnouncements,
     IOfficialBugTagTargetPublic, IHasOOPSReferences,

=== modified file 'lib/lp/registry/interfaces/productseries.py'
--- lib/lp/registry/interfaces/productseries.py	2012-01-01 02:58:52 +0000
+++ lib/lp/registry/interfaces/productseries.py	2012-10-05 05:39:22 +0000
@@ -53,6 +53,7 @@
 from lp.blueprints.interfaces.specificationtarget import ISpecificationGoal
 from lp.bugs.interfaces.bugtarget import (
     IBugTarget,
+    IHasExpirableBugs,
     IHasOfficialBugTags,
     )
 from lp.bugs.interfaces.structuralsubscription import (
@@ -130,7 +131,7 @@
 
 class IProductSeriesPublic(
     ISeriesMixin, IHasAppointedDriver, IHasOwner, IBugTarget,
-    ISpecificationGoal, IHasMilestones, IHasOfficialBugTags,
+    ISpecificationGoal, IHasMilestones, IHasOfficialBugTags, IHasExpirableBugs,
     IHasTranslationImports, IHasTranslationTemplates, IServiceUsage):
     """Public IProductSeries properties."""
     id = Int(title=_('ID'))


Follow ups