← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] launchpad:test-lp-feature into launchpad:master

 

Finn Gärtner has proposed merging launchpad:test-lp-feature into launchpad:master.

Commit message:
feat!: Remove create recipe links on brazaar branch pages

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~launchpad/launchpad/+git/launchpad/+merge/493312

Removes links to the create recipe page on bazaar branch pages. Backend code will be removed in a separate refactor MP.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of launchpad:test-lp-feature into launchpad:master.
diff --git a/lib/lp/code/browser/branch.py b/lib/lp/code/browser/branch.py
index c7b8416..7d8d870 100644
--- a/lib/lp/code/browser/branch.py
+++ b/lib/lp/code/browser/branch.py
@@ -247,7 +247,6 @@ class BranchContextMenu(ContextMenu, HasRecipesMenuMixin, HasSnapsMenuMixin):
     links = [
         "add_subscriber",
         "browse_revisions",
-        "create_recipe",
         "create_snap",
         "link_bug",
         "link_blueprint",
@@ -345,12 +344,6 @@ class BranchContextMenu(ContextMenu, HasRecipesMenuMixin, HasSnapsMenuMixin):
             "+upgrade", "Upgrade this branch", icon="edit", enabled=enabled
         )
 
-    def create_recipe(self):
-        # You can't create a recipe for a private branch.
-        enabled = not self.context.private
-        text = "Create packaging recipe"
-        return Link("+new-recipe", text, enabled=enabled, icon="add")
-
 
 class BranchMirrorMixin:
     """Provide mirror_location property.
diff --git a/lib/lp/code/browser/tests/test_sourcepackagerecipe.py b/lib/lp/code/browser/tests/test_sourcepackagerecipe.py
index 0e406f3..3f07f6c 100644
--- a/lib/lp/code/browser/tests/test_sourcepackagerecipe.py
+++ b/lib/lp/code/browser/tests/test_sourcepackagerecipe.py
@@ -843,85 +843,6 @@ class TestSourcePackageRecipeAddViewMixin:
         self.assertIsNot(None, new_ppa)
 
 
-class TestSourcePackageRecipeAddViewBzr(
-    TestSourcePackageRecipeAddViewMixin, BzrMixin, TestCaseForRecipe
-):
-    def makeBranchAndPackage(self):
-        product = self.factory.makeProduct(
-            name="ratatouille", displayname="Ratatouille"
-        )
-        branch = self.factory.makeBranch(
-            owner=self.chef, product=product, name="veggies"
-        )
-        self.factory.makeSourcePackage(sourcepackagename="ratatouille")
-        return branch
-
-    def test_new_recipe_with_package_branches(self):
-        # The series branches table should not appear if there are none.
-        (
-            branch,
-            related_series_branch_info,
-            related_package_branches,
-        ) = self.makeRelatedBranches(with_series_branches=False)
-        browser = self.getUserBrowser(
-            canonical_url(branch, view_name="+new-recipe"), user=self.chef
-        )
-        soup = BeautifulSoup(browser.contents)
-        related_branches = soup.find("fieldset", {"id": "related-branches"})
-        self.assertIsNot(related_branches, None)
-        related_branches = soup.find("div", {"id": "related-package-branches"})
-        self.assertIsNot(related_branches, None)
-        related_branches = soup.find("div", {"id": "related-series-branches"})
-        self.assertIs(related_branches, None)
-
-    def test_new_recipe_with_series_branches(self):
-        # The package branches table should not appear if there are none.
-        (
-            branch,
-            related_series_branch_info,
-            related_package_branches,
-        ) = self.makeRelatedBranches(with_package_branches=False)
-        browser = self.getUserBrowser(
-            canonical_url(branch, view_name="+new-recipe"), user=self.chef
-        )
-        soup = BeautifulSoup(browser.contents)
-        related_branches = soup.find("fieldset", {"id": "related-branches"})
-        self.assertIsNot(related_branches, None)
-        related_branches = soup.find("div", {"id": "related-series-branches"})
-        self.assertIsNot(related_branches, None)
-        related_branches = soup.find("div", {"id": "related-package-branches"})
-        self.assertIs(related_branches, None)
-
-    def test_new_product_branch_recipe_with_related_branches(self):
-        # The related branches should be rendered correctly on the page.
-        (
-            branch,
-            related_series_branch_info,
-            related_package_branch_info,
-        ) = self.makeRelatedBranches()
-        browser = self.getUserBrowser(
-            canonical_url(branch, view_name="+new-recipe"), user=self.chef
-        )
-        self.checkRelatedBranches(
-            related_series_branch_info,
-            related_package_branch_info,
-            browser.contents,
-        )
-
-    def test_new_sourcepackage_branch_recipe_with_related_branches(self):
-        # The related branches should be rendered correctly on the page.
-        reference_branch = self.makePackageBranch()
-        branch, _, related_package_branch_info = self.makeRelatedBranches(
-            reference_branch
-        )
-        browser = self.getUserBrowser(
-            canonical_url(branch, view_name="+new-recipe"), user=self.chef
-        )
-        self.checkRelatedBranches(
-            set(), related_package_branch_info, browser.contents
-        )
-
-
 class TestSourcePackageRecipeAddViewGit(
     TestSourcePackageRecipeAddViewMixin, GitMixin, TestCaseForRecipe
 ):
diff --git a/lib/lp/code/templates/branch-recipes.pt b/lib/lp/code/templates/branch-recipes.pt
index 53b4468..aa6e462 100644
--- a/lib/lp/code/templates/branch-recipes.pt
+++ b/lib/lp/code/templates/branch-recipes.pt
@@ -15,12 +15,6 @@
       <a href="/+help-code/related-recipes.html" target="help"
          class="sprite maybe action-icon">(?)</a>
     </div>
-
-    <span
-      tal:define="link context_menu/create_recipe"
-      tal:condition="link/enabled"
-      tal:replace="structure link/render"
-      />
   </div>
 
 </div>