← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/remove-copypackage-flag into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/remove-copypackage-flag into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/remove-copypackage-flag/+merge/116258

The soyuz.copypackage.enabled feature flag has been enabled everywhere since 2011-08-16, and is now widely used and working well so very unlikely to be disabled again.  We might as well remove the code allowing it to be turned off.
-- 
https://code.launchpad.net/~cjwatson/launchpad/remove-copypackage-flag/+merge/116258
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/remove-copypackage-flag into lp:launchpad.
=== modified file 'lib/lp/soyuz/browser/tests/test_archive_webservice.py'
--- lib/lp/soyuz/browser/tests/test_archive_webservice.py	2012-01-18 14:30:52 +0000
+++ lib/lp/soyuz/browser/tests/test_archive_webservice.py	2012-07-23 11:55:24 +0000
@@ -17,7 +17,6 @@
 
 from lp.app.interfaces.launchpad import ILaunchpadCelebrities
 from lp.registry.interfaces.pocket import PackagePublishingPocket
-from lp.services.features.testing import FeatureFixture
 from lp.soyuz.enums import (
     ArchivePurpose,
     PackagePublishingStatus,
@@ -317,10 +316,6 @@
 class TestCopyPackage(WebServiceTestCase):
     """Webservice test cases for the copyPackage/copyPackages methods"""
 
-    def setUp(self):
-        super(TestCopyPackage, self).setUp()
-        self.useFixture(FeatureFixture({u"soyuz.copypackage.enabled":  'on'}))
-
     def setup_data(self):
         self.ws_version = "devel"
         uploader_dude = self.factory.makePerson()

=== modified file 'lib/lp/soyuz/model/archive.py'
--- lib/lp/soyuz/model/archive.py	2012-07-05 09:55:48 +0000
+++ lib/lp/soyuz/model/archive.py	2012-07-23 11:55:24 +0000
@@ -1619,8 +1619,6 @@
 
     def _checkCopyPackageFeatureFlags(self):
         """Prevent copyPackage(s) if these conditions are not met."""
-        if not getFeatureFlag(u"soyuz.copypackage.enabled"):
-            raise ForbiddenByFeatureFlag
         if (self.is_ppa and
             not getFeatureFlag(u"soyuz.copypackageppa.enabled")):
             # We have no way of giving feedback about failed jobs yet,

=== modified file 'lib/lp/soyuz/tests/test_archive.py'
--- lib/lp/soyuz/tests/test_archive.py	2012-06-29 18:43:29 +0000
+++ lib/lp/soyuz/tests/test_archive.py	2012-07-23 11:55:24 +0000
@@ -2164,27 +2164,8 @@
 
     layer = DatabaseFunctionalLayer
 
-    def test_copyPackage_requires_feature_flag(self):
-        # Ensure feature is off.
-        self.useFixture(FeatureFixture({u"soyuz.copypackage.enabled": ''}))
-        archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)
-        self.assertRaises(
-            ForbiddenByFeatureFlag,
-            archive.copyPackage,
-            None, None, None, None, None)
-
-    def test_copyPackages_requires_feature_flag(self):
-        # Ensure feature is off.
-        self.useFixture(FeatureFixture({u"soyuz.copypackage.enabled": ''}))
-        archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)
-        self.assertRaises(
-            ForbiddenByFeatureFlag,
-            archive.copyPackages,
-            None, None, None, None, None)
-
     def test_copyPackage_to_ppa_requires_feature_flag(self):
         # Ensure feature is off.
-        self.useFixture(FeatureFixture({u"soyuz.copypackage.enabled": 'on'}))
         self.useFixture(FeatureFixture({u"soyuz.copypackageppa.enabled": ''}))
         archive = self.factory.makeArchive(purpose=ArchivePurpose.PPA)
         self.assertRaises(
@@ -2194,7 +2175,6 @@
 
     def test_copyPackages_to_ppa_requires_feature_flag(self):
         # Ensure feature is off.
-        self.useFixture(FeatureFixture({u"soyuz.copypackage.enabled": 'on'}))
         self.useFixture(FeatureFixture({u"soyuz.copypackageppa.enabled": ''}))
         archive = self.factory.makeArchive(purpose=ArchivePurpose.PPA)
         self.assertRaises(
@@ -2210,7 +2190,6 @@
     def setUp(self):
         super(TestSyncSource, self).setUp()
         self.useFixture(FeatureFixture({
-            u"soyuz.copypackage.enabled": 'on',
             u"soyuz.copypackageppa.enabled": 'on',
             }))
 


Follow ups