Colin Watson has proposed merging lp:~cjwatson/launchpad/remove-git-recipes-ff 
into lp:launchpad.

Commit message:
Remove the Git recipes feature flag.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/remove-git-recipes-ff/+merge/308539

This feature has been enabled everywhere relevant for a while now and is stable.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~cjwatson/launchpad/remove-git-recipes-ff into lp:launchpad.
=== modified file 'lib/lp/code/browser/gitref.py'
--- lib/lp/code/browser/gitref.py	2016-10-05 10:07:08 +0000
+++ lib/lp/code/browser/gitref.py	2016-10-14 16:30:25 +0000
@@ -43,8 +43,6 @@
 from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference
 from lp.code.interfaces.gitref import IGitRef
 from lp.code.interfaces.gitrepository import IGitRepositorySet
-from lp.code.interfaces.sourcepackagerecipe import GIT_RECIPES_FEATURE_FLAG
-from lp.services.features import getFeatureFlag
 from lp.services.helpers import english_list
 from lp.services.propertycache import cachedproperty
 from lp.services.webapp import (
@@ -96,19 +94,13 @@
 
     def create_recipe(self):
         # You can't create a recipe for a reference in a private repository.
-        enabled = (
-            not self.context.private and
-            bool(getFeatureFlag(GIT_RECIPES_FEATURE_FLAG)))
+        enabled = not self.context.private
         text = "Create packaging recipe"
         return Link("+new-recipe", text, enabled=enabled, icon="add")
 
 
 class GitRefView(LaunchpadView, HasSnapsViewMixin):
 
-    related_features = {
-        "code.git.recipes.enabled": False,
-        }
-
     @property
     def label(self):
         return self.context.display_name

=== modified file 'lib/lp/code/browser/gitrepository.py'
--- lib/lp/code/browser/gitrepository.py	2016-10-14 15:44:39 +0000
+++ lib/lp/code/browser/gitrepository.py	2016-10-14 16:30:25 +0000
@@ -69,7 +69,6 @@
 from lp.code.interfaces.gitnamespace import get_git_namespace
 from lp.code.interfaces.gitref import IGitRefBatchNavigator
 from lp.code.interfaces.gitrepository import IGitRepository
-from lp.code.interfaces.sourcepackagerecipe import GIT_RECIPES_FEATURE_FLAG
 from lp.registry.interfaces.person import (
     IPerson,
     IPersonSet,
@@ -269,9 +268,7 @@
 
     def create_recipe(self):
         # You can't create a recipe for a private repository.
-        enabled = (
-            not self.context.private and
-            bool(getFeatureFlag(GIT_RECIPES_FEATURE_FLAG)))
+        enabled = not self.context.private
         text = "Create packaging recipe"
         return Link("+new-recipe", text, enabled=enabled, icon="add")
 
@@ -302,10 +299,6 @@
 class GitRepositoryView(InformationTypePortletMixin, LaunchpadView,
                         HasSnapsViewMixin, CodeImportTargetMixin):
 
-    related_features = {
-        "code.git.recipes.enabled": False,
-        }
-
     @property
     def page_title(self):
         return self.context.display_name

=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py	2016-09-07 11:12:58 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py	2016-10-14 16:30:25 +0000
@@ -36,7 +36,6 @@
     SourcePackageRecipeBuildView,
     )
 from lp.code.interfaces.sourcepackagerecipe import (
-    GIT_RECIPES_FEATURE_FLAG,
     MINIMAL_RECIPE_TEXT_BZR,
     MINIMAL_RECIPE_TEXT_GIT,
     )
@@ -49,7 +48,6 @@
 from lp.registry.interfaces.series import SeriesStatus
 from lp.registry.interfaces.teammembership import TeamMembershipStatus
 from lp.services.database.constants import UTC_NOW
-from lp.services.features.testing import FeatureFixture
 from lp.services.propertycache import clear_property_cache
 from lp.services.webapp import canonical_url
 from lp.services.webapp.escaping import html_escape
@@ -209,10 +207,6 @@
     branch_type = "repository"
     no_such_object_message = "is not a Git repository on Launchpad."
 
-    def setUp(self):
-        super(GitMixin, self).setUp()
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
-
     def makeBranch(self, **kwargs):
         return self.factory.makeGitRefs(**kwargs)[0]
 

=== modified file 'lib/lp/code/errors.py'
--- lib/lp/code/errors.py	2016-10-05 09:29:41 +0000
+++ lib/lp/code/errors.py	2016-10-14 16:30:25 +0000
@@ -31,7 +31,6 @@
     'ClaimReviewFailed',
     'DiffNotFound',
     'GitDefaultConflict',
-    'GitRecipesFeatureDisabled',
     'GitRepositoryCreationException',
     'GitRepositoryCreationFault',
     'GitRepositoryCreationForbidden',
@@ -497,15 +496,6 @@
         self.newest_supported = newest_supported
 
 
-@error_status(httplib.UNAUTHORIZED)
-class GitRecipesFeatureDisabled(Exception):
-    """Only certain users can create new Git recipes."""
-
-    def __init__(self):
-        message = "You do not have permission to create Git recipes."
-        Exception.__init__(self, message)
-
-
 @error_status(httplib.BAD_REQUEST)
 class RecipeBuildException(Exception):
 

=== modified file 'lib/lp/code/interfaces/sourcepackagerecipe.py'
--- lib/lp/code/interfaces/sourcepackagerecipe.py	2016-01-20 12:21:21 +0000
+++ lib/lp/code/interfaces/sourcepackagerecipe.py	2016-10-14 16:30:25 +0000
@@ -8,7 +8,6 @@
 
 
 __all__ = [
-    'GIT_RECIPES_FEATURE_FLAG',
     'IRecipeBranchSource',
     'ISourcePackageRecipe',
     'ISourcePackageRecipeData',
@@ -69,9 +68,6 @@
 from lp.soyuz.interfaces.archive import IArchive
 
 
-GIT_RECIPES_FEATURE_FLAG = u'code.git.recipes.enabled'
-
-
 MINIMAL_RECIPE_TEXT_BZR = dedent(u'''\
     # bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
     %s

=== modified file 'lib/lp/code/model/sourcepackagerecipe.py'
--- lib/lp/code/model/sourcepackagerecipe.py	2016-01-20 12:21:21 +0000
+++ lib/lp/code/model/sourcepackagerecipe.py	2016-10-14 16:30:25 +0000
@@ -41,10 +41,8 @@
 from lp.code.errors import (
     BuildAlreadyPending,
     BuildNotAllowedForDistro,
-    GitRecipesFeatureDisabled,
     )
 from lp.code.interfaces.sourcepackagerecipe import (
-    GIT_RECIPES_FEATURE_FLAG,
     IRecipeBranchSource,
     ISourcePackageRecipe,
     ISourcePackageRecipeData,
@@ -70,7 +68,6 @@
     IStore,
     )
 from lp.services.database.stormexpr import Greatest
-from lp.services.features import getFeatureFlag
 from lp.services.propertycache import (
     cachedproperty,
     get_property_cache,
@@ -230,15 +227,6 @@
         sprecipe.date_created = date_created
         sprecipe.date_last_modified = date_created
         store.add(sprecipe)
-        # We can only do this feature flag check at the end, because we need
-        # to have constructed the SourcePackageRecipeData in order to know
-        # whether it refers to a Git repository and then we need the
-        # SourcePackageRecipe to respect DB constraints before doing
-        # anything else.  The transaction will be aborted either way if the
-        # check fails.
-        if (sprecipe.base_git_repository is not None and
-                not getFeatureFlag(GIT_RECIPES_FEATURE_FLAG)):
-            raise GitRecipesFeatureDisabled
         return sprecipe
 
     @staticmethod

=== modified file 'lib/lp/code/model/tests/test_gitrepository.py'
--- lib/lp/code/model/tests/test_gitrepository.py	2016-10-12 23:24:24 +0000
+++ lib/lp/code/model/tests/test_gitrepository.py	2016-10-14 16:30:25 +0000
@@ -76,7 +76,6 @@
     IGitRepositoryView,
     )
 from lp.code.interfaces.revision import IRevisionSet
-from lp.code.interfaces.sourcepackagerecipe import GIT_RECIPES_FEATURE_FLAG
 from lp.code.model.branchmergeproposal import BranchMergeProposal
 from lp.code.model.branchmergeproposaljob import (
     BranchMergeProposalJob,
@@ -117,7 +116,6 @@
 from lp.services.config import config
 from lp.services.database.constants import UTC_NOW
 from lp.services.database.interfaces import IStore
-from lp.services.features.testing import FeatureFixture
 from lp.services.job.interfaces.job import JobStatus
 from lp.services.job.model.job import Job
 from lp.services.job.runner import JobRunner
@@ -482,14 +480,12 @@
 
     def test_destroySelf_with_SourcePackageRecipe(self):
         # If repository is a base_git_repository in a recipe, it is deleted.
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
         recipe = self.factory.makeSourcePackageRecipe(
             branches=self.factory.makeGitRefs(owner=self.user))
         recipe.base_git_repository.destroySelf(break_references=True)
 
     def test_destroySelf_with_SourcePackageRecipe_as_non_base(self):
         # If repository is referred to by a recipe, it is deleted.
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
         [ref1] = self.factory.makeGitRefs(owner=self.user)
         [ref2] = self.factory.makeGitRefs(owner=self.user)
         self.factory.makeSourcePackageRecipe(branches=[ref1, ref2])
@@ -757,7 +753,6 @@
 
     def test_deletionRequirements_with_SourcePackageRecipe(self):
         # Recipes are listed as deletion requirements.
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
         recipe = self.factory.makeSourcePackageRecipe(
             branches=self.factory.makeGitRefs())
         self.assertEqual(
@@ -1912,10 +1907,6 @@
 
     layer = ZopelessDatabaseLayer
 
-    def setUp(self):
-        super(TestGitRepositoryMarkRecipesStale, self).setUp()
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
-
     def test_base_repository_recipe(self):
         # On ref changes, recipes where this ref is the base become stale.
         [ref] = self.factory.makeGitRefs()

=== modified file 'lib/lp/code/model/tests/test_hasrecipes.py'
--- lib/lp/code/model/tests/test_hasrecipes.py	2016-01-20 12:21:21 +0000
+++ lib/lp/code/model/tests/test_hasrecipes.py	2016-10-14 16:30:25 +0000
@@ -6,8 +6,6 @@
 __metaclass__ = type
 
 from lp.code.interfaces.hasrecipes import IHasRecipes
-from lp.code.interfaces.sourcepackagerecipe import GIT_RECIPES_FEATURE_FLAG
-from lp.services.features.testing import FeatureFixture
 from lp.testing import TestCaseWithFactory
 from lp.testing.layers import DatabaseFunctionalLayer
 
@@ -49,7 +47,6 @@
     def test_git_repository_recipes(self):
         # IGitRepository.recipes should provide all the SourcePackageRecipes
         # attached to that repository.
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
         base_ref1, base_ref2 = self.factory.makeGitRefs(
             paths=[u"refs/heads/ref1", u"refs/heads/ref2"])
         [other_ref] = self.factory.makeGitRefs()
@@ -61,7 +58,6 @@
     def test_git_repository_recipes_nonbase(self):
         # IGitRepository.recipes should provide all the SourcePackageRecipes
         # that refer to the repository, even as a non-base branch.
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
         [base_ref] = self.factory.makeGitRefs()
         [nonbase_ref] = self.factory.makeGitRefs()
         [other_ref] = self.factory.makeGitRefs()
@@ -92,7 +88,6 @@
     def test_product_recipes(self):
         # IProduct.recipes should provide all the SourcePackageRecipes
         # attached to that product's branches and Git repositories.
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
         product = self.factory.makeProduct()
         branch = self.factory.makeBranch(product=product)
         [ref] = self.factory.makeGitRefs(target=product)

=== modified file 'lib/lp/code/model/tests/test_recipebuilder.py'
--- lib/lp/code/model/tests/test_recipebuilder.py	2016-03-31 14:58:46 +0000
+++ lib/lp/code/model/tests/test_recipebuilder.py	2016-10-14 16:30:25 +0000
@@ -29,13 +29,11 @@
     TestHandleStatusMixin,
     TestVerifySuccessfulBuildMixin,
     )
-from lp.code.interfaces.sourcepackagerecipe import GIT_RECIPES_FEATURE_FLAG
 from lp.code.model.recipebuilder import RecipeBuildBehaviour
 from lp.code.model.sourcepackagerecipebuild import SourcePackageRecipeBuild
 from lp.registry.interfaces.pocket import PackagePublishingPocket
 from lp.registry.interfaces.series import SeriesStatus
 from lp.services.config import config
-from lp.services.features.testing import FeatureFixture
 from lp.services.log.logger import BufferLogger
 from lp.soyuz.adapters.archivedependencies import (
     get_sources_list_for_building,
@@ -261,7 +259,6 @@
         self.assertEqual(args["archives"], expected_archives)
 
     def test_extraBuildArgs_git(self):
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
         job = self.makeJob(git=True)
         distroarchseries = job.build.distroseries.architectures[0]
         expected_archives = get_sources_list_for_building(

=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipe.py	2016-08-12 12:56:41 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py	2016-10-14 16:30:25 +0000
@@ -31,13 +31,11 @@
 from lp.buildmaster.model.buildqueue import BuildQueue
 from lp.code.errors import (
     BuildAlreadyPending,
-    GitRecipesFeatureDisabled,
     PrivateBranchRecipe,
     PrivateGitRepositoryRecipe,
     TooNewRecipeFormat,
     )
 from lp.code.interfaces.sourcepackagerecipe import (
-    GIT_RECIPES_FEATURE_FLAG,
     ISourcePackageRecipe,
     ISourcePackageRecipeSource,
     ISourcePackageRecipeView,
@@ -58,7 +56,6 @@
 from lp.registry.interfaces.series import SeriesStatus
 from lp.services.database.bulk import load_referencing
 from lp.services.database.constants import UTC_NOW
-from lp.services.features.testing import FeatureFixture
 from lp.services.propertycache import clear_property_cache
 from lp.services.webapp.authorization import check_permission
 from lp.services.webapp.publisher import canonical_url
@@ -125,10 +122,6 @@
     branch_type = "repository"
     recipe_id = "git-build-recipe"
 
-    def setUp(self):
-        super(GitMixin, self).setUp()
-        self.useFixture(FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}))
-
     def makeBranch(self, **kwargs):
         return self.factory.makeGitRefs(**kwargs)[0]
 
@@ -830,12 +823,6 @@
     TestSourcePackageRecipeMixin, GitMixin, TestCaseWithFactory):
     """Test `SourcePackageRecipe` objects for Git."""
 
-    def test_feature_flag_disabled(self):
-        # Without a feature flag, we will not create new Git recipes.
-        self.useFixture(FeatureFixture({}))
-        self.assertRaises(
-            GitRecipesFeatureDisabled, self.makeSourcePackageRecipe)
-
 
 class TestRecipeBranchRoundTrippingMixin:
 

=== modified file 'lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt'
--- lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt	2016-09-07 11:12:58 +0000
+++ lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt	2016-10-14 16:30:25 +0000
@@ -74,21 +74,15 @@
 Create a new sample repository, some branches in it, and some source package
 recipes to go along with them.
 
-    >>> from lp.code.interfaces.sourcepackagerecipe import (
-    ...     GIT_RECIPES_FEATURE_FLAG,
-    ...     )
-    >>> from lp.services.features.testing import FeatureFixture
-
     >>> login('foo....@canonical.com')
     >>> repository = factory.makeGitRepository()
     >>> ref1, ref2, ref3 = factory.makeGitRefs(
     ...     repository=repository,
     ...     paths=[u"refs/heads/a", u"refs/heads/b", u"refs/heads/c"])
-    >>> with FeatureFixture({GIT_RECIPES_FEATURE_FLAG: u"on"}):
-    ...     recipe1a = factory.makeSourcePackageRecipe(branches=[ref1])
-    ...     recipe1b = factory.makeSourcePackageRecipe(branches=[ref1])
-    ...     recipe2 = factory.makeSourcePackageRecipe(branches=[ref2])
-    ...     recipe3 = factory.makeSourcePackageRecipe(branches=[ref3])
+    >>> recipe1a = factory.makeSourcePackageRecipe(branches=[ref1])
+    >>> recipe1b = factory.makeSourcePackageRecipe(branches=[ref1])
+    >>> recipe2 = factory.makeSourcePackageRecipe(branches=[ref2])
+    >>> recipe3 = factory.makeSourcePackageRecipe(branches=[ref3])
 
 Keep these urls, including the target url.  We'll use these later.
 

=== modified file 'lib/lp/services/features/flags.py'
--- lib/lp/services/features/flags.py	2016-07-14 10:39:31 +0000
+++ lib/lp/services/features/flags.py	2016-10-14 16:30:25 +0000
@@ -228,12 +228,6 @@
      'disabled',
      'PPA Separate Long Descriptions',
      ''),
-    ('code.git.recipes.enabled',
-     'boolean',
-     'If true, allow creation of new Git-based recipes.',
-     'disabled',
-     'Git recipes',
-     'https://help.launchpad.net/Packaging/SourceBuilds'),
     ('soyuz.named_auth_token.allow_new',
      'boolean',
      'If true, allow creation of named authorization tokens for archives.',

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to