Merge lp:~wgrant/launchpad/disable-gitrepository-mps into lp:launchpad

Proposed by William Grant on 2018-08-31
Status: Merged
Merged at revision: 18767
Proposed branch: lp:~wgrant/launchpad/disable-gitrepository-mps
Merge into: lp:launchpad
Diff against target: 58 lines (+13/-10)
2 files modified
lib/lp/code/browser/tests/test_gitrepository.py (+12/-9)
lib/lp/code/templates/gitrepository-index.pt (+1/-1)
To merge this branch: bzr merge lp:~wgrant/launchpad/disable-gitrepository-mps
Reviewer Review Type Date Requested Status
William Grant code Approve on 2018-08-31
Review via email: mp+354091@code.launchpad.net

Commit message

Put GitRepository:+index's MP listing behind a feature flag; it's slow.

To post a comment you must log in.
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/tests/test_gitrepository.py'
2--- lib/lp/code/browser/tests/test_gitrepository.py 2018-08-29 17:11:57 +0000
3+++ lib/lp/code/browser/tests/test_gitrepository.py 2018-08-31 07:06:39 +0000
4@@ -38,6 +38,7 @@
5 from lp.registry.interfaces.person import PersonVisibility
6 from lp.services.beautifulsoup import BeautifulSoup
7 from lp.services.database.constants import UTC_NOW
8+from lp.services.features.testing import FeatureFixture
9 from lp.services.webapp.publisher import canonical_url
10 from lp.services.webapp.servers import LaunchpadTestRequest
11 from lp.testing import (
12@@ -260,10 +261,11 @@
13 self.factory.makeBranchMergeProposalForGit(
14 target_ref=git_refs[0],
15 set_state=BranchMergeProposalStatus.NEEDS_REVIEW)
16- with person_logged_in(repository.owner):
17- browser = self.getViewBrowser(repository)
18- self.assertIsNotNone(
19- find_tag_by_id(browser.contents, 'landing-candidates'))
20+ with FeatureFixture({"code.git.show_repository_mps": "on"}):
21+ with person_logged_in(repository.owner):
22+ browser = self.getViewBrowser(repository)
23+ self.assertIsNotNone(
24+ find_tag_by_id(browser.contents, 'landing-candidates'))
25
26 def test_landing_candidate_count(self):
27 source_repository = self.factory.makeGitRepository()
28@@ -287,11 +289,12 @@
29 target_ref=target_git_refs[0],
30 source_ref=source_git_refs[0],
31 set_state=BranchMergeProposalStatus.NEEDS_REVIEW)
32- with person_logged_in(target_repository.owner):
33- browser = self.getViewBrowser(
34- source_repository, user=source_repository.owner)
35- self.assertIsNotNone(
36- find_tag_by_id(browser.contents, 'landing-targets'))
37+ with FeatureFixture({"code.git.show_repository_mps": "on"}):
38+ with person_logged_in(target_repository.owner):
39+ browser = self.getViewBrowser(
40+ source_repository, user=source_repository.owner)
41+ self.assertIsNotNone(
42+ find_tag_by_id(browser.contents, 'landing-targets'))
43
44
45 class TestGitRepositoryViewPrivateArtifacts(BrowserTestCase):
46
47=== modified file 'lib/lp/code/templates/gitrepository-index.pt'
48--- lib/lp/code/templates/gitrepository-index.pt 2018-08-29 15:38:17 +0000
49+++ lib/lp/code/templates/gitrepository-index.pt 2018-08-31 07:06:39 +0000
50@@ -44,7 +44,7 @@
51 </div>
52 </div>
53
54- <div class="yui-g first">
55+ <div class="yui-g first" tal:condition="request/features/code.git.show_repository_mps">
56 <div id="repository-relations" class="portlet">
57 <tal:repository-pending-merges
58 replace="structure context/@@++repository-pending-merges" />