launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #03309
[Merge] lp:~julian-edwards/launchpad/ignore-crackports-bug-741681 into lp:launchpad
Julian Edwards has proposed merging lp:~julian-edwards/launchpad/ignore-crackports-bug-741681 into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~julian-edwards/launchpad/ignore-crackports-bug-741681/+merge/57527
= Summary =
Ignore -backports and -proposed when calculating differences between two
distroseries. Those pockets contain packages that are not officially part of
a distribution, and if the derived distro really wants packages from them, users
can do a manual sync in the API in the rare occasion that happens.
== Implementation details ==
The createForPackagePublication() classmethod now takes a pocket argument (arguably
it should just take the publishing record but that would mean a lot of test changes)
and does nothing if the pocket is -backports or -proposed.
== Tests ==
bin/test -cvv test_distroseriesdifferencejob
== Demo and Q/A ==
n/a yet
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/soyuz/model/distroseriesdifferencejob.py
lib/lp/soyuz/model/publishing.py
lib/lp/soyuz/interfaces/distributionjob.py
lib/lp/soyuz/tests/test_distroseriesdifferencejob.py
--
https://code.launchpad.net/~julian-edwards/launchpad/ignore-crackports-bug-741681/+merge/57527
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~julian-edwards/launchpad/ignore-crackports-bug-741681 into lp:launchpad.
=== modified file 'lib/lp/soyuz/interfaces/distributionjob.py'
--- lib/lp/soyuz/interfaces/distributionjob.py 2011-03-18 01:17:42 +0000
+++ lib/lp/soyuz/interfaces/distributionjob.py 2011-04-13 16:14:37 +0000
@@ -144,11 +144,12 @@
class IDistroSeriesDifferenceJobSource(IJobSource):
"""An `IJob` for creating `DistroSeriesDifference`s."""
- def createForPackagePublication(distroseries, sourcepackagename):
+ def createForPackagePublication(distroseries, sourcepackagename, pocket):
"""Create jobs as appropriate for a given status publication.
:param distroseries: A `DistroSeries` that is assumed to be
derived from another one.
:param sourcepackagename: A `SourcePackageName` that is being
published in `distroseries`.
+ :param pocket: The `PackagePublishingPocket` for the publication.
"""
=== modified file 'lib/lp/soyuz/model/distroseriesdifferencejob.py'
--- lib/lp/soyuz/model/distroseriesdifferencejob.py 2011-04-04 07:21:23 +0000
+++ lib/lp/soyuz/model/distroseriesdifferencejob.py 2011-04-13 16:14:37 +0000
@@ -18,6 +18,7 @@
from lp.registry.interfaces.distroseriesdifference import (
IDistroSeriesDifferenceSource,
)
+from lp.registry.interfaces.pocket import PackagePublishingPocket
from lp.registry.model.distroseriesdifference import DistroSeriesDifference
from lp.registry.model.sourcepackagename import SourcePackageName
from lp.services.features import getFeatureFlag
@@ -115,10 +116,19 @@
class_job_type = DistributionJobType.DISTROSERIESDIFFERENCE
@classmethod
- def createForPackagePublication(cls, distroseries, sourcepackagename):
+ def createForPackagePublication(cls, distroseries, sourcepackagename,
+ pocket):
"""See `IDistroSeriesDifferenceJobSource`."""
if not getFeatureFlag(FEATURE_FLAG_ENABLE_MODULE):
return
+ # -backports and -proposed are not really part of a standard
+ # distribution's packages so we're ignoring them here. They can
+ # always be manually synced by the users if necessary, in the
+ # rare occasions that they require them.
+ if pocket in (
+ PackagePublishingPocket.BACKPORTS,
+ PackagePublishingPocket.PROPOSED):
+ return
jobs = []
children = list(distroseries.getDerivedSeries())
for relative in children + [distroseries]:
=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py 2011-04-05 00:18:20 +0000
+++ lib/lp/soyuz/model/publishing.py 2011-04-13 16:14:37 +0000
@@ -341,7 +341,7 @@
dsd_job_source = getUtility(IDistroSeriesDifferenceJobSource)
dsd_job_source.createForPackagePublication(
self.distroseries,
- self.sourcepackagerelease.sourcepackagename)
+ self.sourcepackagerelease.sourcepackagename, self.pocket)
def requestObsolescence(self):
"""See `IArchivePublisher`."""
@@ -1441,7 +1441,7 @@
if archive == distroseries.main_archive:
dsd_job_source = getUtility(IDistroSeriesDifferenceJobSource)
dsd_job_source.createForPackagePublication(
- distroseries, sourcepackagerelease.sourcepackagename)
+ distroseries, sourcepackagerelease.sourcepackagename, pocket)
return pub
def getBuildsForSourceIds(
=== modified file 'lib/lp/soyuz/tests/test_distroseriesdifferencejob.py'
--- lib/lp/soyuz/tests/test_distroseriesdifferencejob.py 2011-04-04 14:42:31 +0000
+++ lib/lp/soyuz/tests/test_distroseriesdifferencejob.py 2011-04-13 16:14:37 +0000
@@ -20,6 +20,7 @@
DistroSeriesDifferenceStatus,
DistroSeriesDifferenceType,
)
+from lp.registry.interfaces.pocket import PackagePublishingPocket
from lp.registry.model.distroseriesdifference import DistroSeriesDifference
from lp.services.features.testing import FeatureFixture
from lp.services.job.interfaces.job import JobStatus
@@ -152,7 +153,8 @@
# Create a job for the derived_series parent, which should create
# two jobs. One for derived_series, and the other for its child.
self.getJobSource().createForPackagePublication(
- derived_series.parent_series, package)
+ derived_series.parent_series, package,
+ PackagePublishingPocket.RELEASE)
jobs = (list(
find_waiting_jobs(derived_series.parent_series, package)) +
list(find_waiting_jobs(derived_series, package)))
@@ -169,7 +171,7 @@
derived_series = self.makeDerivedDistroSeries()
package = self.factory.makeSourcePackageName()
self.getJobSource().createForPackagePublication(
- derived_series, package)
+ derived_series, package, PackagePublishingPocket.RELEASE)
jobs = list(find_waiting_jobs(derived_series, package))
self.assertEqual(1, len(jobs))
self.assertEqual(package.id, jobs[0].metadata['sourcepackagename'])
@@ -178,14 +180,24 @@
distroseries = self.makeDerivedDistroSeries()
package = self.factory.makeSourcePackageName()
self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: ''}))
- self.getJobSource().createForPackagePublication(distroseries, package)
+ self.getJobSource().createForPackagePublication(
+ distroseries, package, PackagePublishingPocket.RELEASE)
+ self.assertContentEqual([], find_waiting_jobs(distroseries, package))
+
+ def test_createForPackagePublication_ignores_backports_and_proposed(self):
+ distroseries = self.makeDerivedDistroSeries()
+ package = self.factory.makeSourcePackageName()
+ self.getJobSource().createForPackagePublication(
+ distroseries, package, PackagePublishingPocket.BACKPORTS)
+ self.getJobSource().createForPackagePublication(
+ distroseries, package, PackagePublishingPocket.PROPOSED)
self.assertContentEqual([], find_waiting_jobs(distroseries, package))
def test_cronscript(self):
derived_series = self.makeDerivedDistroSeries()
package = self.factory.makeSourcePackageName()
self.getJobSource().createForPackagePublication(
- derived_series, package)
+ derived_series, package, PackagePublishingPocket.RELEASE)
transaction.commit() # The cronscript is a different process.
return_code, stdout, stderr = run_script(
'cronscripts/distroseriesdifference_job.py', ['-v'])
@@ -207,7 +219,7 @@
derived_series = self.makeDerivedDistroSeries()
package = self.factory.makeSourcePackageName()
job = self.getJobSource().createForPackagePublication(
- derived_series, package)
+ derived_series, package, PackagePublishingPocket.RELEASE)
job[0].start()
job[0].run()
job[0].job.complete() # So we can create another job.
@@ -220,7 +232,7 @@
self.assertEqual(1, ds_diff.count())
# If we run the job again, it will not create another DSD.
job = self.getJobSource().createForPackagePublication(
- derived_series, package)
+ derived_series, package, PackagePublishingPocket.RELEASE)
job[0].start()
job[0].run()
ds_diff = store.find(
@@ -338,7 +350,8 @@
return self.factory.makeSourcePackagePublishingHistory(
sourcepackagerelease=spr, archive=archive,
distroseries=distroseries,
- status=PackagePublishingStatus.PUBLISHED)
+ status=PackagePublishingStatus.PUBLISHED,
+ pocket=PackagePublishingPocket.RELEASE)
def findDSD(self, derived_series, source_package_name):
return self.store.find(
Follow ups