← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~sinzui/launchpad/external-bug-tracker into lp:launchpad

 

Curtis Hovey has proposed merging lp:~sinzui/launchpad/external-bug-tracker into lp:launchpad.

Commit message:
Do not show bug listings on projects that do not use Lp Bug Tracking.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1061788 in Launchpad itself: "Bug are listed when the project uses an external bug tracker"
  https://bugs.launchpad.net/launchpad/+bug/1061788

For more details, see:
https://code.launchpad.net/~sinzui/launchpad/external-bug-tracker/+merge/128114

The bug-column feature that changes how bug listing were made lost the
rules to not show bug listings. The view ignores the project configuration,
showing bugs when the project does not use Lp to track bugs.

--------------------------------------------------------------------

RULES

    Pre-implementation: no one
    * The template uses not: view/should_show_bug_information to
      show the external or bug configuration information, but it
      never uses just view/should_show_bug_information to guard
      the search form and listings.


QA

    * Visit https://bugs.qastaging.launchpad.net/gedit-class-browser
    * Verify there is no search form or advanced search link.
    * View the source and verify that there is no bug-table-listing.


LINT

    lib/lp/bugs/browser/tests/test_buglisting.py
    lib/lp/bugs/templates/buglisting-default.pt


LoC

    I have a credit of 3000+ lines this week.

TEST

    ./bin/test -vvc lp.bugs.browser.tests.test_buglisting


IMPLEMENTATION

Updated the template to wrap the search form and listings with a
conditional view/should_show_bug_information.
    lib/lp/bugs/browser/tests/test_buglisting.py
    lib/lp/bugs/templates/buglisting-default.pt
-- 
https://code.launchpad.net/~sinzui/launchpad/external-bug-tracker/+merge/128114
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~sinzui/launchpad/external-bug-tracker into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/tests/test_buglisting.py'
--- lib/lp/bugs/browser/tests/test_buglisting.py	2012-10-02 06:36:44 +0000
+++ lib/lp/bugs/browser/tests/test_buglisting.py	2012-10-04 21:07:27 +0000
@@ -295,8 +295,12 @@
 
     def test_has_bugtracker_external_is_true(self):
         bug_target = self._makeBugTargetProduct(bug_tracker='external')
-        view = create_initialized_view(bug_target, '+bugs')
+        user = self.factory.makePerson
+        view = create_initialized_view(bug_target, '+bugs', principal=user)
         self.assertEqual(True, view.has_bugtracker)
+        markup = view.render()
+        self.assertIsNone(find_tag_by_id(markup, 'bugs-search-form'))
+        self.assertIsNone(find_tag_by_id(markup, 'bugs-table-listings'))
 
     def test_has_bugtracker_launchpad_is_true(self):
         bug_target = self._makeBugTargetProduct(bug_tracker='launchpad')

=== modified file 'lib/lp/bugs/templates/buglisting-default.pt'
--- lib/lp/bugs/templates/buglisting-default.pt	2012-08-21 00:34:02 +0000
+++ lib/lp/bugs/templates/buglisting-default.pt	2012-10-04 21:07:27 +0000
@@ -104,6 +104,7 @@
         </tal:has_products>
       </tal:is_project_group>
 
+      <tal:uses-lp condition="view/should_show_bug_information">
         <tal:do_not_show_advanced_form
           condition="not: view/shouldShowAdvancedForm">
           <div tal:define="batch_navigator view/search">
@@ -116,11 +117,11 @@
           <metal:advanced_form
              use-macro="context/@@+bugtask-macros-tableview/advanced_search_form" />
         </tal:show_advanced_form>
+      </tal:uses-lp>
 
       <div class="yui-u">
         <div id="structural-subscription-content-box"></div>
       </div>
-
     </div>
   </div>
 


Follow ups