← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~jugmac00/launchpad:skip-preloading-recipe-data-for-rock-recipes into launchpad:master

 

Jürgen Gmach has proposed merging ~jugmac00/launchpad:skip-preloading-recipe-data-for-rock-recipes into launchpad:master.

Commit message:
Skip preloading recipe data for rock recipes

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jugmac00/launchpad/+git/launchpad/+merge/474516
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/launchpad:skip-preloading-recipe-data-for-rock-recipes into launchpad:master.
diff --git a/lib/lp/rocks/browser/rockrecipelisting.py b/lib/lp/rocks/browser/rockrecipelisting.py
index 4ab4c11..01191a5 100644
--- a/lib/lp/rocks/browser/rockrecipelisting.py
+++ b/lib/lp/rocks/browser/rockrecipelisting.py
@@ -9,8 +9,6 @@ __all__ = [
     "ProjectRockRecipeListingView",
 ]
 
-from functools import partial
-
 from zope.component import getUtility
 
 from lp.rocks.interfaces.rockrecipe import IRockRecipeSet
@@ -43,10 +41,15 @@ class RockRecipeListingView(LaunchpadView, FeedsMixin):
         recipes = getUtility(IRockRecipeSet).findByContext(
             self.context, visible_by_user=self.user
         )
-        loader = partial(
-            getUtility(IRockRecipeSet).preloadDataForRecipes, user=self.user
-        )
-        self.recipes = DecoratedResultSet(recipes, pre_iter_hook=loader)
+        # XXX jugmac00 2024-10-06: we need to skip preloading until the
+        # function is able to handle rock recipes with external git
+        # repositories, see https://warthogs.atlassian.net/browse/LP-1972
+        #
+        # loader = partial(
+        #     getUtility(IRockRecipeSet).preloadDataForRecipes, user=self.user
+        # )
+        # self.recipes = DecoratedResultSet(recipes, pre_iter_hook=loader)
+        self.recipes = DecoratedResultSet(recipes)
 
     @cachedproperty
     def batchnav(self):
diff --git a/lib/lp/rocks/model/rockrecipebuild.py b/lib/lp/rocks/model/rockrecipebuild.py
index bd6c420..6ac028c 100644
--- a/lib/lp/rocks/model/rockrecipebuild.py
+++ b/lib/lp/rocks/model/rockrecipebuild.py
@@ -31,7 +31,6 @@ from lp.registry.interfaces.series import SeriesStatus
 from lp.registry.model.distribution import Distribution
 from lp.registry.model.distroseries import DistroSeries
 from lp.registry.model.person import Person
-from lp.rocks.interfaces.rockrecipe import IRockRecipeSet
 from lp.rocks.interfaces.rockrecipebuild import (
     IRockFile,
     IRockRecipeBuild,
@@ -411,7 +410,7 @@ class RockRecipeBuildSet(SpecificBuildFarmJobSourceMixin):
 
     def preloadBuildsData(self, builds):
         # Circular import.
-        from lp.rocks.model.rockrecipe import RockRecipe
+        # from lp.rocks.model.rockrecipe import RockRecipe
 
         load_related(Person, builds, ["requester_id"])
         lfas = load_related(LibraryFileAlias, builds, ["log_id"])
@@ -423,8 +422,12 @@ class RockRecipeBuildSet(SpecificBuildFarmJobSourceMixin):
             DistroSeries, distroarchserieses, ["distroseries_id"]
         )
         load_related(Distribution, distroserieses, ["distribution_id"])
-        recipes = load_related(RockRecipe, builds, ["recipe_id"])
-        getUtility(IRockRecipeSet).preloadDataForRecipes(recipes)
+        # XXX jugmac00 2024-10-06: we need to skip preloading until the
+        # function is able to handle rock recipes with external git
+        # repositories, see https://warthogs.atlassian.net/browse/LP-1972
+        #
+        # recipes = load_related(RockRecipe, builds, ["recipe_id"])
+        # getUtility(IRockRecipeSet).preloadDataForRecipes(recipes)
 
     def getByBuildFarmJobs(self, build_farm_jobs):
         """See `ISpecificBuildFarmJobSource`."""