launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #22867
[Merge] lp:~wgrant/launchpad/disable-gitrepository-mps into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/disable-gitrepository-mps into lp:launchpad.
Commit message:
Put GitRepository:+index's MP listing behind a feature flag; it's slow.
Requested reviews:
William Grant (wgrant): code
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/disable-gitrepository-mps/+merge/354091
--
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/code/browser/tests/test_gitrepository.py'
--- lib/lp/code/browser/tests/test_gitrepository.py 2018-08-29 17:11:57 +0000
+++ lib/lp/code/browser/tests/test_gitrepository.py 2018-08-31 07:06:39 +0000
@@ -38,6 +38,7 @@
from lp.registry.interfaces.person import PersonVisibility
from lp.services.beautifulsoup import BeautifulSoup
from lp.services.database.constants import UTC_NOW
+from lp.services.features.testing import FeatureFixture
from lp.services.webapp.publisher import canonical_url
from lp.services.webapp.servers import LaunchpadTestRequest
from lp.testing import (
@@ -260,10 +261,11 @@
self.factory.makeBranchMergeProposalForGit(
target_ref=git_refs[0],
set_state=BranchMergeProposalStatus.NEEDS_REVIEW)
- with person_logged_in(repository.owner):
- browser = self.getViewBrowser(repository)
- self.assertIsNotNone(
- find_tag_by_id(browser.contents, 'landing-candidates'))
+ with FeatureFixture({"code.git.show_repository_mps": "on"}):
+ with person_logged_in(repository.owner):
+ browser = self.getViewBrowser(repository)
+ self.assertIsNotNone(
+ find_tag_by_id(browser.contents, 'landing-candidates'))
def test_landing_candidate_count(self):
source_repository = self.factory.makeGitRepository()
@@ -287,11 +289,12 @@
target_ref=target_git_refs[0],
source_ref=source_git_refs[0],
set_state=BranchMergeProposalStatus.NEEDS_REVIEW)
- with person_logged_in(target_repository.owner):
- browser = self.getViewBrowser(
- source_repository, user=source_repository.owner)
- self.assertIsNotNone(
- find_tag_by_id(browser.contents, 'landing-targets'))
+ with FeatureFixture({"code.git.show_repository_mps": "on"}):
+ with person_logged_in(target_repository.owner):
+ browser = self.getViewBrowser(
+ source_repository, user=source_repository.owner)
+ self.assertIsNotNone(
+ find_tag_by_id(browser.contents, 'landing-targets'))
class TestGitRepositoryViewPrivateArtifacts(BrowserTestCase):
=== modified file 'lib/lp/code/templates/gitrepository-index.pt'
--- lib/lp/code/templates/gitrepository-index.pt 2018-08-29 15:38:17 +0000
+++ lib/lp/code/templates/gitrepository-index.pt 2018-08-31 07:06:39 +0000
@@ -44,7 +44,7 @@
</div>
</div>
- <div class="yui-g first">
+ <div class="yui-g first" tal:condition="request/features/code.git.show_repository_mps">
<div id="repository-relations" class="portlet">
<tal:repository-pending-merges
replace="structure context/@@++repository-pending-merges" />
References