launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #02989
lp:~thumper/launchpad/add-publishing-for-factory-distro-sourcepackage-bug-tasks into lp:launchpad
Tim Penhey has proposed merging lp:~thumper/launchpad/add-publishing-for-factory-distro-sourcepackage-bug-tasks into lp:launchpad with lp:~thumper/launchpad/bugtask-tales-addition as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~thumper/launchpad/add-publishing-for-factory-distro-sourcepackage-bug-tasks/+merge/53733
Several minor tweaks in this branch.
lib/lp/bugs/model/bug.py
- if the target is a source package, the distroseries is always set,
so we can clean up some of this logic.
lib/lp/bugs/model/bugtask.py
- Use BaseItem instead of DBItem and Item for type checks.
lib/lp/testing/factory.py
- When creating DistibutionSourcePackage bug tasks, add publishing
history by default.
--
https://code.launchpad.net/~thumper/launchpad/add-publishing-for-factory-distro-sourcepackage-bug-tasks/+merge/53733
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~thumper/launchpad/add-publishing-for-factory-distro-sourcepackage-bug-tasks into lp:launchpad.
=== modified file 'lib/lp/bugs/model/bug.py'
--- lib/lp/bugs/model/bug.py 2011-03-15 04:15:45 +0000
+++ lib/lp/bugs/model/bug.py 2011-03-17 03:04:33 +0000
@@ -1131,14 +1131,8 @@
distribution = target.distribution
source_package_name = target.sourcepackagename
if ISourcePackage.providedBy(target):
- if target.distroseries is not None:
- distro_series = target.distroseries
- source_package_name = target.sourcepackagename
- elif target.distribution is not None:
- distribution = target.distribution
- source_package_name = target.sourcepackagename
- else:
- source_package_name = target.sourcepackagename
+ distro_series = target.distroseries
+ source_package_name = target.sourcepackagename
new_task = getUtility(IBugTaskSet).createTask(
self, owner=owner, product=product,
=== modified file 'lib/lp/bugs/model/bugtask.py'
--- lib/lp/bugs/model/bugtask.py 2011-03-17 03:04:32 +0000
+++ lib/lp/bugs/model/bugtask.py 2011-03-17 03:04:33 +0000
@@ -25,10 +25,7 @@
from itertools import chain
from operator import attrgetter
-from lazr.enum import (
- DBItem,
- Item,
- )
+from lazr.enum import BaseItem
import pytz
from sqlobject import (
ForeignKey,
@@ -170,8 +167,6 @@
from lp.services import features
from lp.services.propertycache import get_property_cache
from lp.soyuz.enums import PackagePublishingStatus
-from lp.soyuz.model.publishing import SourcePackagePublishingHistory
-from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
debbugsseveritymap = {
@@ -1591,7 +1586,7 @@
in status.query_values) + ')'
elif zope_isinstance(status, not_equals):
return '(NOT %s)' % self._buildStatusClause(status.value)
- elif zope_isinstance(status, DBItem):
+ elif zope_isinstance(status, BaseItem):
with_response = (
status == BugTaskStatusSearch.INCOMPLETE_WITH_RESPONSE)
without_response = (
@@ -2034,7 +2029,7 @@
if hw_clause is not None:
extra_clauses.append(hw_clause)
- if zope_isinstance(params.linked_branches, Item):
+ if zope_isinstance(params.linked_branches, BaseItem):
if params.linked_branches == BugBranchSearch.BUGS_WITH_BRANCHES:
extra_clauses.append(
"""EXISTS (
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2011-03-15 23:13:37 +0000
+++ lib/lp/testing/factory.py 2011-03-17 03:04:33 +0000
@@ -179,6 +179,9 @@
MirrorContent,
MirrorSpeed,
)
+from lp.registry.interfaces.distributionsourcepackage import (
+ IDistributionSourcePackage,
+ )
from lp.registry.interfaces.distroseries import IDistroSeries
from lp.registry.interfaces.distroseriesdifference import (
IDistroSeriesDifferenceSource,
@@ -1672,8 +1675,12 @@
prerequisite_target = target.distribution
if ISourcePackage.providedBy(target):
# We can't have a series task without a distribution task.
- prerequisite_target = target.distribution.getSourcePackage(
- target.sourcepackagename)
+ prerequisite_target = target.distribution_sourcepackage
+ if publish:
+ self.makeSourcePackagePublishingHistory(
+ distroseries=target.distroseries,
+ sourcepackagename=target.sourcepackagename)
+ if IDistributionSourcePackage.providedBy(target):
if publish:
self.makeSourcePackagePublishingHistory(
distroseries=target.distribution.currentseries,
@@ -1681,7 +1688,7 @@
if prerequisite_target is not None:
prerequisite = bug.getBugTask(prerequisite_target)
if prerequisite is None:
- self.makeBugTask(bug, prerequisite_target)
+ self.makeBugTask(bug, prerequisite_target, publish=publish)
return removeSecurityProxy(bug).addTask(owner, target)