Merge lp:~jcsackett/launchpad/projectgroup-branches-652156 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | j.c.sackett |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11771 |
Proposed branch: | lp:~jcsackett/launchpad/projectgroup-branches-652156 |
Merge into: | lp:launchpad |
Diff against target: |
204 lines (+116/-4) 6 files modified
lib/lp/code/browser/tests/test_branchlisting.py (+33/-0) lib/lp/code/stories/branches/xx-project-branches.txt (+4/-2) lib/lp/code/templates/project-branches.pt (+27/-2) lib/lp/code/tests/test_project.py (+36/-0) lib/lp/registry/interfaces/projectgroup.py (+7/-0) lib/lp/registry/model/projectgroup.py (+9/-0) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/projectgroup-branches-652156 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | ui | Approve | |
Guilherme Salgado (community) | ui* | Approve | |
Edwin Grubbs (community) | code | Approve | |
Review via email: mp+38355@code.launchpad.net |
Commit message
Updates the projectgroup branches page to show a message consistent with the other codehosting_usage messages when there are no branches, instead of an empty table.
Description of the change
Summary
=======
Updates the projectgroup branch listing page to display a message similar to other codehosting usage messages for other pillars (e.g. "<Product> does not use Launchpad for codehosting.")
Right now if no products are configured to have branches on Launchpad (the condition to set codehosting_usage to LAUNCHPAD), the project group simply shows an empty table with a message about using bazaar; in line with the bridging the gap tasks, it should simply state the the project group isn't using launchpad for codehosting, and be done with it.
Proposed fix
============
Detect when there are no branches and display the appropriate message instead of using the branch-listing portlet.
Preimplementation talk
=======
Spoke with Edwin Grubbs. We brought up the possiblity of linking out to all the products for the group so someone could configure the products, but to do so sanely (i.e. only show the links for products the viewer can configure) requires doing database checks for every product; this could lead to death by SQL timeouts.
Implementation details
=======
Largely as in proposed. A new property, has_branches, was added to projectgroups to check if there are any branches for the projectgroup's products. If this returns false, the message is shown.
Tests
=====
bin/test -vvct TestProjectBranches
bin/test -vvct TestProjectBran
Screenshots
===========
The old appearance is available at:
http://
The new appearance is available at:
http://
The appearance with any branches (in either case) is available at:
http://
Lint
====
make lint output:
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
Hi JC,
This branch looks good. I just have one comment below.
-Edwin
>=== modified file 'lib/lp/ code/browser/ tests/test_ branchlisting. py' code/browser/ tests/test_ branchlisting. py 2010-08-24 02:21:50 +0000 code/browser/ tests/test_ branchlisting. py 2010-10-14 14:37:22 +0000 chListing( TestCaseWithFac tory): nalLayer ctBranchListing , self).setUp() makeProject( ) makeProduct( project= self.project) branches_ gets_message_ not_listing( self): wser( url(self. project, rootsite='code')) displayname) by_id(browser. contents, "no-branchtable") text(no_ branch_ div) get_listing( self): makeProductBran ch(product= self.product) wser( url(self. project, rootsite='code')) by_id(browser. contents, "branchtable") t(None, table) TestLoader( ).loadTestsFrom Name(__ name__)
>--- lib/lp/
>+++ lib/lp/
>@@ -421,5 +421,33 @@
> self.assertIs(None, branches)
>
>
>+class TestProjectBran
>+
>+ layer = DatabaseFunctio
>+
>+ def setUp(self):
>+ super(TestProje
>+ self.project = self.factory.
>+ self.product = self.factory.
>+
>+ def test_no_
>+ # If there are no product branches on the project's products, then
>+ # the view shows the no code hosting message instead of a listing.
>+ browser = self.getUserBro
>+ canonical_
>+ expected_text = ("None of %s's projects are using Launchpad to host "
>+ "code." % self.project.
>+ no_branch_div = find_tag_
>+ text = extract_
>
>
>You're missing an assertEqual or assertIn here.
>
>
>+
>+ def test_branches_
>+ # If a product has a branch, then the project view has a branch
>+ # listing.
>+ branch = self.factory.
>+ browser = self.getUserBro
>+ canonical_
>+ table = find_tag_
>+ self.assertIsNo
>+
> def test_suite():
> return unittest.
>