← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/remove-derived-series-jobs-flag into lp:launchpad

 

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

Commit message:
Remove soyuz.derived_series_jobs.enabled feature flag, which has been enabled everywhere since June 2011.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/remove-derived-series-jobs-flag/+merge/148356

The soyuz.derived_series_jobs.enabled feature flag has been enabled everywhere since 2011-06-09, and there doesn't seem any particular likelihood of needing to disable it.  We might as well remove the code allowing it to be turned off.
-- 
https://code.launchpad.net/~cjwatson/launchpad/remove-derived-series-jobs-flag/+merge/148356
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/remove-derived-series-jobs-flag into lp:launchpad.
=== modified file 'cronscripts/distroseriesdifference_job.py'
--- cronscripts/distroseriesdifference_job.py	2012-01-01 03:14:54 +0000
+++ cronscripts/distroseriesdifference_job.py	2013-02-14 01:21:22 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/python -S
 #
-# Copyright 2010 Canonical Ltd.  This software is licensed under the
+# Copyright 2010-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Process DistroSeriesDifferences."""
@@ -9,14 +9,10 @@
 
 import _pythonpath
 
-from lp.services.features import getFeatureFlag
 from lp.services.job.runner import JobCronScript
 from lp.soyuz.interfaces.distributionjob import (
     IDistroSeriesDifferenceJobSource,
     )
-from lp.soyuz.model.distroseriesdifferencejob import (
-    FEATURE_FLAG_ENABLE_MODULE,
-    )
 
 
 class RunDistroSeriesDifferenceJob(JobCronScript):
@@ -25,12 +21,6 @@
     config_name = 'distroseriesdifferencejob'
     source_interface = IDistroSeriesDifferenceJobSource
 
-    def main(self):
-        if not getFeatureFlag(FEATURE_FLAG_ENABLE_MODULE):
-            self.logger.info("Feature flag is not enabled.")
-            return
-        super(RunDistroSeriesDifferenceJob, self).main()
-
 
 if __name__ == '__main__':
     script = RunDistroSeriesDifferenceJob()

=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py	2013-01-24 05:50:23 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py	2013-02-14 01:21:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2012 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Functional tests for uploadprocessor.py."""
@@ -60,7 +60,6 @@
 from lp.registry.model.sourcepackagename import SourcePackageName
 from lp.services.config import config
 from lp.services.database.constants import UTC_NOW
-from lp.services.features.testing import FeatureFixture
 from lp.services.librarian.interfaces import ILibraryFileAliasSet
 from lp.services.log.logger import (
     BufferLogger,
@@ -89,9 +88,6 @@
 from lp.soyuz.model.binarypackagename import BinaryPackageName
 from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease
 from lp.soyuz.model.component import Component
-from lp.soyuz.model.distroseriesdifferencejob import (
-    FEATURE_FLAG_ENABLE_MODULE,
-    )
 from lp.soyuz.model.publishing import (
     BinaryPackagePublishingHistory,
     SourcePackagePublishingHistory,
@@ -169,9 +165,6 @@
         self.log = BufferLogger()
 
         self.switchToAdmin()
-        self.useFixture(FeatureFixture({
-            FEATURE_FLAG_ENABLE_MODULE: u'on',
-        }))
         self.switchToUploader()
 
     def tearDown(self):

=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
--- lib/lp/registry/browser/tests/test_distroseries.py	2013-01-03 00:27:37 +0000
+++ lib/lp/registry/browser/tests/test_distroseries.py	2013-02-14 01:21:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2011 Canonical Ltd.  This software is licensed under the
+# Copyright 2011-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Tests for `lp.registry.browser.distroseries`."""
@@ -86,7 +86,6 @@
 from lp.soyuz.interfaces.sourcepackageformat import (
     ISourcePackageFormatSelectionSet,
     )
-from lp.soyuz.model import distroseriesdifferencejob
 from lp.soyuz.model.archivepermission import ArchivePermission
 from lp.soyuz.model.packagecopyjob import PlainPackageCopyJob
 from lp.soyuz.scripts.initialize_distroseries import InitializationError
@@ -100,7 +99,6 @@
     normalize_whitespace,
     person_logged_in,
     StormStatementRecorder,
-    TestCase,
     TestCaseWithFactory,
     with_celebrity_logged_in,
     )
@@ -129,12 +127,6 @@
         }))
 
 
-def set_derived_series_difference_jobs_feature_flag(test_case):
-    test_case.useFixture(FeatureFixture({
-        distroseriesdifferencejob.FEATURE_FLAG_ENABLE_MODULE: u'on',
-        }))
-
-
 class TestDistroSeriesView(TestCaseWithFactory):
     """Test the distroseries +index view."""
 
@@ -1811,7 +1803,6 @@
         self.assertFalse(view.hasPendingDSDUpdate(dsd))
 
     def test_hasPendingDSDUpdate_returns_True_if_pending_update(self):
-        set_derived_series_difference_jobs_feature_flag(self)
         dsd = self.factory.makeDistroSeriesDifference()
         self.makeDSDJob(dsd)
         view = create_initialized_view(

=== modified file 'lib/lp/registry/tests/test_initderiveddistroseries.py'
--- lib/lp/registry/tests/test_initderiveddistroseries.py	2012-01-20 15:42:44 +0000
+++ lib/lp/registry/tests/test_initderiveddistroseries.py	2013-02-14 01:21:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Canonical Ltd.  This software is licensed under the
+# Copyright 2010-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Test initializing a distroseries using
@@ -11,13 +11,9 @@
 from zope.security.proxy import removeSecurityProxy
 
 from lp.registry.interfaces.distroseries import DerivationError
-from lp.services.features.testing import FeatureFixture
 from lp.soyuz.interfaces.distributionjob import (
     IInitializeDistroSeriesJobSource,
     )
-from lp.soyuz.model.distroseriesdifferencejob import (
-    FEATURE_FLAG_ENABLE_MODULE,
-    )
 from lp.soyuz.scripts.tests.test_initialize_distroseries import (
     InitializationHelperTestCase,
     )
@@ -111,29 +107,9 @@
             child,
             [(u'p1', u'0.1-1'), (u'p2', u'2.1')])
 
-    def test_multiple_parents_dsd_flag_on(self):
-        # An initialization can happen if the flag for distroseries
-        # difference creation is on.
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: u'on'}))
-        parent1, parent2 = self.setUpParents(
-            packages1={'p1': '0.1-1'}, packages2={'p2': '2.1'})
-        child = self.factory.makeDistroSeries()
-        switch_dbuser('initializedistroseries')
-
-        child = self._fullInitialize(
-            [parent1, parent2], child=child)
-        # Make sure the initialization was successful.
-        self.assertBinPackagesAndVersions(
-            child,
-            [(u'p1', u'0.1-1'), (u'p2', u'2.1')])
-        # Switch back to launchpad_main to be able to cleanup the
-        # feature flags.
-        switch_dbuser('launchpad_main')
-
     def test_multiple_parents_do_not_close_bugs(self):
         # The initialization does not close the bugs on the copied
         # publications (and thus does not try to access the bug table).
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: u'on'}))
         parent1, parent2 = self.setUpParents(
             packages1={'p1': '0.1-1'}, packages2={'p2': '2.1'})
         child = self.factory.makeDistroSeries()

=== modified file 'lib/lp/services/features/flags.py'
--- lib/lp/services/features/flags.py	2013-02-07 06:10:38 +0000
+++ lib/lp/services/features/flags.py	2013-02-14 01:21:22 +0000
@@ -160,12 +160,6 @@
      '',
      '',
      ''),
-    ('soyuz.derived_series_jobs.enabled',
-     'boolean',
-     "Compute package differences for derived distributions.",
-     '',
-     '',
-     ''),
     ('visible_render_time',
      'boolean',
      'Shows the server-side page render time in the login widget.',

=== modified file 'lib/lp/soyuz/doc/gina.txt'
--- lib/lp/soyuz/doc/gina.txt	2012-11-22 00:15:23 +0000
+++ lib/lp/soyuz/doc/gina.txt	2013-02-14 01:21:22 +0000
@@ -50,13 +50,6 @@
     ...     hoary, celebs.launchpad_developers)
     >>> login(ANONYMOUS)
 
-    # Enable the Derived Series feature flag, to make sure gina likes it.
-    >>> from lp.services.features.testing import FeatureFixture
-    >>> from lp.soyuz.model.distroseriesdifferencejob import (
-    ...     FEATURE_FLAG_ENABLE_MODULE,
-    ...     )
-    >>> fixture = FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: u'on'})
-    >>> fixture.setUp()
     >>> pf = ProcessorFamily.selectOneBy(name="x86")
     >>> breezy_i386 = DistroArchSeries(distroseries=breezy,
     ...                         processorfamily=pf,
@@ -196,7 +189,6 @@
     >>> proc.wait()
     0
     >>> transaction.commit()
-    >>> fixture.cleanUp()
 
 
 Testing Source Package Results

=== modified file 'lib/lp/soyuz/model/distroseriesdifferencejob.py'
--- lib/lp/soyuz/model/distroseriesdifferencejob.py	2012-05-14 01:29:38 +0000
+++ lib/lp/soyuz/model/distroseriesdifferencejob.py	2013-02-14 01:21:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2011 Canonical Ltd.  This software is licensed under the
+# Copyright 2011-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Job class to request generation or update of `DistroSeriesDifference`s."""
@@ -27,7 +27,6 @@
     IMasterStore,
     IStore,
     )
-from lp.services.features import getFeatureFlag
 from lp.services.job.model.job import Job
 from lp.soyuz.interfaces.distributionjob import (
     DistributionJobType,
@@ -43,9 +42,6 @@
 from lp.soyuz.model.publishing import SourcePackagePublishingHistory
 
 
-FEATURE_FLAG_ENABLE_MODULE = u"soyuz.derived_series_jobs.enabled"
-
-
 def make_metadata(sourcepackagename_id, parent_series_id):
     """Return JSON metadata for a job on `sourcepackagename_id`."""
     return {
@@ -169,9 +165,6 @@
     def createForPackagePublication(cls, derived_series, 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
@@ -214,8 +207,6 @@
     @classmethod
     def massCreateForSeries(cls, derived_series):
         """See `IDistroSeriesDifferenceJobSource`."""
-        if not getFeatureFlag(FEATURE_FLAG_ENABLE_MODULE):
-            return
         for parent_series in derived_series.getParentSeries():
             create_multiple_jobs(derived_series, parent_series)
 

=== modified file 'lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py	2012-10-18 13:34:39 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py	2013-02-14 01:21:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2010-2012 Canonical Ltd.  This software is licensed under the
+# Copyright 2010-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Test the initialize_distroseries script machinery."""
@@ -16,7 +16,6 @@
 from lp.registry.interfaces.distroseriesparent import IDistroSeriesParentSet
 from lp.registry.interfaces.pocket import PackagePublishingPocket
 from lp.services.database.lpstorm import IStore
-from lp.services.features.testing import FeatureFixture
 from lp.soyuz.enums import (
     ArchivePurpose,
     PackageUploadStatus,
@@ -35,10 +34,7 @@
     )
 from lp.soyuz.model.component import ComponentSelection
 from lp.soyuz.model.distroarchseries import DistroArchSeries
-from lp.soyuz.model.distroseriesdifferencejob import (
-    FEATURE_FLAG_ENABLE_MODULE,
-    find_waiting_jobs,
-    )
+from lp.soyuz.model.distroseriesdifferencejob import find_waiting_jobs
 from lp.soyuz.model.section import SectionSelection
 from lp.soyuz.scripts.initialize_distroseries import (
     InitializationError,
@@ -1388,7 +1384,6 @@
         # of the DSDJs with all the parents.
         parent1, unused = self.setupParent(packages={u'p1': u'1.2'})
         parent2, unused = self.setupParent(packages={u'p2': u'1.5'})
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: 'on'}))
         child = self._fullInitialize([parent1, parent2])
 
         self.assertNotEqual([], self.getWaitingJobs(child, 'p1', parent1))
@@ -1404,7 +1399,6 @@
             previous_parents=[prev_parent1, prev_parent2])
         parent3, unused = self.setupParent(
             packages={u'p2': u'2.5', u'p3': u'1.1'})
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: 'on'}))
         self._fullInitialize(
             [prev_parent1, prev_parent2, parent3], child=child)
 
@@ -1430,7 +1424,6 @@
         test1.addSources('p1')
         parent3, unused = self.setupParent(
             packages={u'p1': u'2.5', u'p3': u'4.4'})
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: 'on'}))
         self._fullInitialize(
             [prev_parent1, prev_parent2, parent3], child=child,
             packagesets=(str(test1.id),))

=== modified file 'lib/lp/soyuz/tests/test_distroseriesdifferencejob.py'
--- lib/lp/soyuz/tests/test_distroseriesdifferencejob.py	2012-06-29 08:40:05 +0000
+++ lib/lp/soyuz/tests/test_distroseriesdifferencejob.py	2013-02-14 01:21:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2011 Canonical Ltd.  This software is licensed under the
+# Copyright 2011-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Test `DistroSeriesDifferenceJob` and utility."""
@@ -37,7 +37,6 @@
     create_job,
     create_multiple_jobs,
     DistroSeriesDifferenceJob,
-    FEATURE_FLAG_ENABLE_MODULE,
     find_waiting_jobs,
     make_metadata,
     may_require_job,
@@ -70,10 +69,6 @@
 
     layer = ZopelessDatabaseLayer
 
-    def setUp(self):
-        super(TestDistroSeriesDifferenceJobSource, self).setUp()
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: u'on'}))
-
     def getJobSource(self):
         return getUtility(IDistroSeriesDifferenceJobSource)
 
@@ -316,16 +311,6 @@
             parent_jobs[0], dsp.parent_series,
             [package.id, parent_dsp.parent_series.id])
 
-    def test_createForPackagePublication_obeys_feature_flag(self):
-        dsp = self.factory.makeDistroSeriesParent()
-        package = self.factory.makeSourcePackageName()
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: ''}))
-        self.getJobSource().createForPackagePublication(
-            dsp.derived_series, package, PackagePublishingPocket.RELEASE)
-        self.assertContentEqual(
-            [],
-            find_waiting_jobs(dsp.derived_series, package, dsp.parent_series))
-
     def test_createForPackagePublication_ignores_backports_and_proposed(self):
         dsp = self.factory.makeDistroSeriesParent()
         package = self.factory.makeSourcePackageName()
@@ -361,16 +346,6 @@
             1, len(find_waiting_jobs(
                 dsp.derived_series, spn, dsp.parent_series)))
 
-    def test_createForSPPHs_obeys_feature_flag(self):
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: ''}))
-        dsp = self.factory.makeDistroSeriesParent()
-        spph = self.factory.makeSourcePackagePublishingHistory(
-            dsp.parent_series, pocket=PackagePublishingPocket.RELEASE)
-        spn = spph.sourcepackagerelease.sourcepackagename
-        self.getJobSource().createForSPPHs([spph])
-        self.assertContentEqual(
-            [], find_waiting_jobs(dsp.derived_series, spn, dsp.parent_series))
-
     def test_createForSPPHs_ignores_backports_and_proposed(self):
         dsp = self.factory.makeDistroSeriesParent()
         spr = self.factory.makeSourcePackageRelease()
@@ -452,19 +427,6 @@
         self.assertContentEqual(
             [], find_waiting_jobs(dsp.derived_series, spn, dsp.parent_series))
 
-    def test_massCreateForSeries_obeys_feature_flag(self):
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: ''}))
-        dsp = self.factory.makeDistroSeriesParent()
-        spph = self.createSPPHs(dsp.derived_series, 1)[0]
-        self.getJobSource().massCreateForSeries(dsp.derived_series)
-
-        self.assertContentEqual(
-            [],
-            find_waiting_jobs(
-                dsp.derived_series,
-                spph.sourcepackagerelease.sourcepackagename,
-                dsp.parent_series))
-
     def test_getPendingJobsForDifferences_finds_job(self):
         dsd = self.factory.makeDistroSeriesDifference()
         job = create_job(
@@ -647,7 +609,6 @@
 
     def setUp(self):
         super(TestDistroSeriesDifferenceJobEndToEnd, self).setUp()
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: u'on'}))
         self.store = IMasterStore(DistroSeriesDifference)
 
     def getJobSource(self):
@@ -987,7 +948,6 @@
 
     def test_DerivedDistroseriesDifferenceJob(self):
         self.useFixture(FeatureFixture({
-            FEATURE_FLAG_ENABLE_MODULE: u'on',
             'jobs.celery.enabled_classes': 'DistroSeriesDifferenceJob',
             }))
         dsp = self.factory.makeDistroSeriesParent()

=== modified file 'lib/lp/soyuz/tests/test_packagecopyjob.py'
--- lib/lp/soyuz/tests/test_packagecopyjob.py	2012-12-26 01:32:19 +0000
+++ lib/lp/soyuz/tests/test_packagecopyjob.py	2013-02-14 01:21:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2010-2012 Canonical Ltd.  This software is licensed under the
+# Copyright 2010-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Tests for sync package jobs."""
@@ -55,9 +55,6 @@
 from lp.soyuz.interfaces.sourcepackageformat import (
     ISourcePackageFormatSelectionSet,
     )
-from lp.soyuz.model.distroseriesdifferencejob import (
-    FEATURE_FLAG_ENABLE_MODULE,
-    )
 from lp.soyuz.model.packagecopyjob import PackageCopyJob
 from lp.soyuz.model.queue import PackageUpload
 from lp.soyuz.tests.test_publishing import SoyuzTestPublisher
@@ -485,9 +482,6 @@
     def test_run(self):
         # A proper test run synchronizes packages.
 
-        # Turn on DSD jobs.
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: 'on'}))
-
         job = create_proper_job(self.factory)
         self.assertEqual("libc", job.package_name)
         self.assertEqual("2.8-1", job.package_version)
@@ -1609,9 +1603,8 @@
 
     def test_run(self):
         # A proper test run synchronizes packages.
-        # Turn on DSD jobs.
+        # Turn on Celery handling of PCJs.
         self.useFixture(FeatureFixture({
-            FEATURE_FLAG_ENABLE_MODULE: 'on',
             'jobs.celery.enabled_classes': 'PlainPackageCopyJob',
         }))
 

=== modified file 'lib/lp/soyuz/tests/test_publishing.py'
--- lib/lp/soyuz/tests/test_publishing.py	2013-01-22 02:06:59 +0000
+++ lib/lp/soyuz/tests/test_publishing.py	2013-02-14 01:21:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2012 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Test native publication workflow for Soyuz. """
@@ -29,7 +29,6 @@
 from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
 from lp.services.config import config
 from lp.services.database.constants import UTC_NOW
-from lp.services.features.testing import FeatureFixture
 from lp.services.librarian.interfaces import ILibraryFileAliasSet
 from lp.services.log.logger import DevNullLogger
 from lp.soyuz.adapters.overrides import UnknownOverridePolicy
@@ -50,10 +49,7 @@
     )
 from lp.soyuz.interfaces.queue import QueueInconsistentStateError
 from lp.soyuz.interfaces.section import ISectionSet
-from lp.soyuz.model.distroseriesdifferencejob import (
-    FEATURE_FLAG_ENABLE_MODULE,
-    find_waiting_jobs,
-    )
+from lp.soyuz.model.distroseriesdifferencejob import find_waiting_jobs
 from lp.soyuz.model.distroseriespackagecache import DistroSeriesPackageCache
 from lp.soyuz.model.processor import ProcessorFamily
 from lp.soyuz.model.publishing import (
@@ -1175,9 +1171,6 @@
 
     layer = ZopelessDatabaseLayer
 
-    def enableDistroDerivation(self):
-        self.useFixture(FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: u'on'}))
-
     def test_requestDeletion_marks_SPPHs_deleted(self):
         spph = self.factory.makeSourcePackagePublishingHistory()
         getUtility(IPublishingSet).requestDeletion(
@@ -1218,7 +1211,6 @@
             series, pocket=PackagePublishingPocket.RELEASE)
         spn = spph.sourcepackagerelease.sourcepackagename
 
-        self.enableDistroDerivation()
         getUtility(IPublishingSet).requestDeletion(
             [spph], self.factory.makePerson())
 


Follow ups