launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #03563
[Merge] lp:~rvb/launchpad/fix-released-check-780509 into lp:launchpad
Raphaël Victor Badin has proposed merging lp:~rvb/launchpad/fix-released-check-780509 into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #780509 in Launchpad itself: "In browser.distroseries.py, the check used to decide if a series has been released should use self.context.supported."
https://bugs.launchpad.net/launchpad/+bug/780509
For more details, see:
https://code.launchpad.net/~rvb/launchpad/fix-released-check-780509/+merge/60514
This branch changes how we check a series has been released. It uses "series.supported" instead of "series.datereleased".
= Tests =
./bin/test -cvv test_distroseries test_sync_in_released_series_in_updates
= QA =
n/a
--
https://code.launchpad.net/~rvb/launchpad/fix-released-check-780509/+merge/60514
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/launchpad/fix-released-check-780509 into lp:launchpad.
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py 2011-05-09 15:50:52 +0000
+++ lib/lp/registry/browser/distroseries.py 2011-05-10 14:21:52 +0000
@@ -776,10 +776,10 @@
series_title = self.context.displayname
# If the series is released, sync packages in the "updates" pocket.
- if self.context.datereleased is None:
+ if self.context.supported:
+ destination_pocket = PackagePublishingPocket.UPDATES
+ else:
destination_pocket = PackagePublishingPocket.RELEASE
- else:
- destination_pocket = PackagePublishingPocket.UPDATES
if self.do_copy(
'selected_differences', sources, self.context.main_archive,
=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
--- lib/lp/registry/browser/tests/test_distroseries.py 2011-05-10 10:39:53 +0000
+++ lib/lp/registry/browser/tests/test_distroseries.py 2011-05-10 14:21:52 +0000
@@ -27,6 +27,7 @@
from zope.security.proxy import removeSecurityProxy
from canonical.config import config
+from canonical.database.constants import UTC_NOW
from canonical.database.sqlbase import flush_database_caches
from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
from canonical.launchpad.testing.pages import find_tag_by_id
@@ -49,13 +50,13 @@
DistroSeriesDifferenceType,
)
from lp.registry.interfaces.person import IPersonSet
+from lp.registry.interfaces.pocket import PackagePublishingPocket
+from lp.registry.interfaces.series import SeriesStatus
from lp.services.features import (
get_relevant_feature_controller,
getFeatureFlag,
)
-from lp.services.features.testing import (
- FeatureFixture,
- )
+from lp.services.features.testing import FeatureFixture
from lp.soyuz.enums import (
ArchivePermissionType,
PackagePublishingStatus,
@@ -1249,6 +1250,36 @@
derived_series, 'my-src-name', versions['parent'], view)
+ def test_sync_in_released_series_in_updates(self):
+ # If the destination series is released, the sync packages end
+ # up in the updates pocket.
+ versions = {
+ 'parent': '1.0-1',
+ }
+ derived_series, parent_series, sourcepackagename = self._setUpDSD(
+ 'my-src-name', versions=versions)
+ # Update destination series status to current and update
+ # daterelease.
+ with celebrity_logged_in('admin'):
+ derived_series.status = SeriesStatus.CURRENT
+ derived_series.datereleased = UTC_NOW
+
+ set_derived_series_sync_feature_flag(self)
+ person = self.factory.makePerson()
+ removeSecurityProxy(derived_series.main_archive).newPackageUploader(
+ person, sourcepackagename)
+ self._syncAndGetView(
+ derived_series, person, ['my-src-name'])
+ parent_pub = parent_series.main_archive.getPublishedSources(
+ name='my-src-name', version=versions['parent'],
+ distroseries=parent_series).one()
+ pub = derived_series.main_archive.getPublishedSources(
+ name='my-src-name', version=versions['parent'],
+ distroseries=derived_series).one()
+ self.assertEqual(self.factory.getAnyPocket(), parent_pub.pocket)
+ self.assertEqual(PackagePublishingPocket.UPDATES, pub.pocket)
+
+
class TestDistroSeriesNeedsPackagesView(TestCaseWithFactory):
"""Test the distroseries +needs-packaging view."""