launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #03009
[Merge] lp:~sinzui/launchpad/tea-and-biscuts into lp:launchpad
Curtis Hovey has proposed merging lp:~sinzui/launchpad/tea-and-biscuts into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #703087 in Launchpad itself: "Dotted outline of bug description runs through text, looks bad"
https://bugs.launchpad.net/launchpad/+bug/703087
Bug #706967 in Launchpad itself: "Series page missing link to view code"
https://bugs.launchpad.net/launchpad/+bug/706967
Bug #732625 in Launchpad itself: "Distribution source package display names are miscapitalized"
https://bugs.launchpad.net/launchpad/+bug/732625
Bug #735944 in Launchpad itself: "Distribution source package page shows bug counts, but distro does not use Launchpad"
https://bugs.launchpad.net/launchpad/+bug/735944
For more details, see:
https://code.launchpad.net/~sinzui/launchpad/tea-and-biscuts/+merge/54041
Trivial fixes set aside from other branches.
Launchpad bug:
https://bugs.launchpad.net/bugs/703087
https://bugs.launchpad.net/bugs/706967
https://bugs.launchpad.net/bugs/732625
https://bugs.launchpad.net/bugs/735944
Pre-implementation: no one
Test command: ./bin/test -vv \
-t xx-productseries-link-branch -t doc/distribution-sourcepackage
-t TestDistributionSourceView
There are small fixes I set aside form other branches or fixed while
triaging bugs.
Bug 703087 "Dotted outline of bug description runs through text, looks bad"
The lazr edit classes confuses browsers which outline fields that
are not *yet* editable.
Bug 706967 "Series page missing link to view code"
when you go to a series page there is only a link to the development
focus branch, not a link to directly jump to the content as well.
The link was removed from the code portlet when was added on the
project index...it needs to be added back to the series as well.
Bug #732625 "DSP display names are miscapitalized"
'ubiquity in ubuntu' should be 'ubiquity in Ubuntu'.
Bug #735944 "DSP page shows bug counts, but distro does not use Launchpad"
The page should not be showing the bugs or questions. The "Report a bug"
and "Ask a question" links are correctly hidden.
--------------------------------------------------------------------
RULES
Bug 703087 "Dotted outline of bug description runs through text, looks bad"
* Add a CSS rule to suppress outlining of the hidden text area.
Bug 706967 "Series page missing link to view code"
* Add the link directly to the productseries-index template.
Bug #732625 "DSP display names are miscapitalized"
* Update the dsp.displayname attr to use distribution.displayname
* Fix the primary test. Expect to fix lots of stories after an ec2 run.
Bug #735944 "DSP page shows bug counts, but distro does not use Launchpad"
* Add a tales guard to counts.
QA
Bug 703087 "Dotted outline of bug description runs through text, looks bad"
* Visit https://bugs.qastaging.launchpad.net/launchpad/+bug/703087
* Click on the text in the description
* Verify that the entire description is not outlined.
Bug 706967 "Series page missing link to view code"
* Visit https://qastaging.launchpad.net/launchpad/11.12
* Verify there is a link to view the branch content in the
Code for this series portlet.
Bug #732625 "DSP display names are miscapitalized"
* Visit https://bugs.qastaging.launchpad.net/ubiquity
* Verify the package name is 'ubiquity in Ubuntu'.
Bug #735944 "DSP page shows bug counts, but distro does not use Launchpad"
* Visit https://qastaging.launchpad.net/debian/+source/bzr
* Verify the page show not show counts for bugs and questions.
LINT
lib/canonical/launchpad/icing/style-3-0.css.in
lib/lp/registry/browser/distributionsourcepackage.py
lib/lp/registry/browser/tests/test_distributionsourcepackage.py
lib/lp/registry/doc/distribution-sourcepackage.txt
lib/lp/registry/model/distributionsourcepackage.py
lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt
lib/lp/registry/templates/distributionsourcepackage-index.pt
lib/lp/registry/templates/productseries-index.pt
^ lint hates the two doctests. I can clean them up before I land.
IMPLEMENTATION
Added a selector rule to disable the outline automatically added by many
browsers.
lib/canonical/launchpad/icing/style-3-0.css.in
Restored the link that was removed 6 months ago.
lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt
lib/lp/registry/templates/productseries-index.pt
Use the distro's displayname when making the dsp displayname. This is an
invasive change and I expect a lot of stories to need mechanical fixes
when the ec2 test completes.
lib/lp/registry/doc/distribution-sourcepackage.txt
lib/lp/registry/model/distributionsourcepackage.py
Added a attr to the view to help the template construct the sentence for
the services that are used.
lib/lp/registry/browser/distributionsourcepackage.py
lib/lp/registry/browser/tests/test_distributionsourcepackage.py
lib/lp/registry/templates/distributionsourcepackage-index.pt
--
https://code.launchpad.net/~sinzui/launchpad/tea-and-biscuts/+merge/54041
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~sinzui/launchpad/tea-and-biscuts into lp:launchpad.
=== modified file 'lib/canonical/launchpad/icing/style-3-0.css.in'
--- lib/canonical/launchpad/icing/style-3-0.css.in 2011-03-08 00:40:50 +0000
+++ lib/canonical/launchpad/icing/style-3-0.css.in 2011-03-18 17:06:33 +0000
@@ -923,6 +923,9 @@
top: -3px;
margin-left: 0.5em;
}
+.yui3-editable_text {
+ outline: none;
+ }
.yui3-ieditor {
padding-right: 288px;
}
=== modified file 'lib/lp/registry/browser/distributionsourcepackage.py'
--- lib/lp/registry/browser/distributionsourcepackage.py 2011-03-16 10:59:54 +0000
+++ lib/lp/registry/browser/distributionsourcepackage.py 2011-03-18 17:06:33 +0000
@@ -57,6 +57,7 @@
)
from lp.answers.interfaces.questionenums import QuestionStatus
from lp.app.browser.tales import CustomizableFormatter
+from lp.app.enums import ServiceUsage
from lp.app.interfaces.launchpad import IServiceUsage
from lp.bugs.browser.bugtask import BugTargetTraversalMixin
from lp.bugs.browser.structuralsubscription import (
@@ -516,6 +517,20 @@
"""Return result set containing open questions for this package."""
return self.context.searchQuestions(status=QuestionStatus.OPEN)
+ @cachedproperty
+ def bugs_answers_usage(self):
+ """Return a dict of uses_bugs, uses_answers, uses_both, uses_either.
+ """
+ service_usage = IServiceUsage(self.context)
+ uses_bugs = (
+ service_usage.bug_tracking_usage == ServiceUsage.LAUNCHPAD)
+ uses_answers = service_usage.answers_usage == ServiceUsage.LAUNCHPAD
+ uses_both = uses_bugs and uses_answers
+ uses_either = uses_bugs or uses_answers
+ return dict(
+ uses_bugs=uses_bugs, uses_answers=uses_answers,
+ uses_both=uses_both, uses_either=uses_either)
+
class DistributionSourcePackageChangelogView(
DistributionSourcePackageBaseView, LaunchpadView):
=== modified file 'lib/lp/registry/browser/tests/test_distributionsourcepackage.py'
--- lib/lp/registry/browser/tests/test_distributionsourcepackage.py 2011-03-16 10:59:54 +0000
+++ lib/lp/registry/browser/tests/test_distributionsourcepackage.py 2011-03-18 17:06:33 +0000
@@ -12,6 +12,7 @@
DatabaseFunctionalLayer,
LaunchpadFunctionalLayer,
)
+from lp.app.enums import ServiceUsage
from lp.soyuz.interfaces.archive import ArchivePurpose
from lp.testing import (
celebrity_logged_in,
@@ -19,6 +20,7 @@
TestCaseWithFactory,
)
from lp.testing.matchers import BrowsesWithQueryLimit
+from lp.testing.views import create_view
class TestDistributionSourcePackageFormatterAPI(TestCaseWithFactory):
@@ -53,3 +55,53 @@
self.factory.makePackageDiff(
to_source=spph.sourcepackagerelease)
self.assertThat(dsp, changelog_browses_under_limit)
+
+
+class TestDistributionSourceView(TestCaseWithFactory):
+
+ layer = DatabaseFunctionalLayer
+
+ def setUp(self):
+ super(TestDistributionSourceView, self).setUp()
+ sourcepackagename = self.factory.makeSourcePackageName('mouse')
+ distro = self.factory.makeDistribution()
+ self.dsp = distro.getSourcePackage('mouse')
+
+ def test_bugs_answers_usage_none(self):
+ # The dict values are all None.
+ view = create_view(self.dsp, '+index')
+ self.assertFalse(view.bugs_answers_usage['uses_bugs'])
+ self.assertFalse(view.bugs_answers_usage['uses_answers'])
+ self.assertFalse(view.bugs_answers_usage['uses_both'])
+ self.assertFalse(view.bugs_answers_usage['uses_either'])
+
+ def test_bugs_answers_usage_bugs(self):
+ # The dict values are all None.
+ with celebrity_logged_in('admin'):
+ self.dsp.distribution.official_malone = True
+ view = create_view(self.dsp, '+index')
+ self.assertTrue(view.bugs_answers_usage['uses_bugs'])
+ self.assertFalse(view.bugs_answers_usage['uses_answers'])
+ self.assertFalse(view.bugs_answers_usage['uses_both'])
+ self.assertTrue(view.bugs_answers_usage['uses_either'])
+
+ def test_bugs_answers_usage_answers(self):
+ # The dict values are all None.
+ with celebrity_logged_in('admin'):
+ self.dsp.distribution.answers_usage = ServiceUsage.LAUNCHPAD
+ view = create_view(self.dsp, '+index')
+ self.assertFalse(view.bugs_answers_usage['uses_bugs'])
+ self.assertTrue(view.bugs_answers_usage['uses_answers'])
+ self.assertFalse(view.bugs_answers_usage['uses_both'])
+ self.assertTrue(view.bugs_answers_usage['uses_either'])
+
+ def test_bugs_answers_usage_both(self):
+ # The dict values are all None.
+ with celebrity_logged_in('admin'):
+ self.dsp.distribution.official_malone = True
+ self.dsp.distribution.answers_usage = ServiceUsage.LAUNCHPAD
+ view = create_view(self.dsp, '+index')
+ self.assertTrue(view.bugs_answers_usage['uses_bugs'])
+ self.assertTrue(view.bugs_answers_usage['uses_answers'])
+ self.assertTrue(view.bugs_answers_usage['uses_both'])
+ self.assertTrue(view.bugs_answers_usage['uses_either'])
=== modified file 'lib/lp/registry/doc/distribution-sourcepackage.txt'
--- lib/lp/registry/doc/distribution-sourcepackage.txt 2010-10-18 22:24:59 +0000
+++ lib/lp/registry/doc/distribution-sourcepackage.txt 2011-03-18 17:06:33 +0000
@@ -42,7 +42,7 @@
pmount
>>> print dsp.displayname
- pmount in ubuntu
+ pmount in Ubuntu
>>> print dsp.title.encode('ascii', 'ignore')
pmount package in Ubuntu
=== modified file 'lib/lp/registry/model/distributionsourcepackage.py'
--- lib/lp/registry/model/distributionsourcepackage.py 2011-03-08 05:50:48 +0000
+++ lib/lp/registry/model/distributionsourcepackage.py 2011-03-18 17:06:33 +0000
@@ -169,7 +169,7 @@
def displayname(self):
"""See `IDistributionSourcePackage`."""
return '%s in %s' % (
- self.sourcepackagename.name, self.distribution.name)
+ self.sourcepackagename.name, self.distribution.displayname)
@property
def bugtargetdisplayname(self):
=== modified file 'lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt'
--- lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt 2011-01-17 20:58:07 +0000
+++ lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt 2011-03-18 17:06:33 +0000
@@ -54,7 +54,9 @@
>>> sample_browser.getControl('Branch').value = '~name12/firefox/main'
>>> sample_browser.getControl('Update').click()
-Updating the branch takes the user back to the product series page.
+Updating the branch takes Sample Person back to the product series page,
+where he can see the link to the branch and a link to see the content
+of the branch
>>> print sample_browser.title
Series trunk : Mozilla Firefox
@@ -63,6 +65,9 @@
lp://dev/firefox - Sample Person
Change branch
+ >>> print sample_browser.getLink('View the branch content').url
+ http://bazaar.launchpad.dev/~name12/firefox/main/files
+
The total and recent revision counts for the branch are displayed to
give an idea of overall and recent activity on the project.
=== modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt'
--- lib/lp/registry/templates/distributionsourcepackage-index.pt 2011-03-04 00:08:20 +0000
+++ lib/lp/registry/templates/distributionsourcepackage-index.pt 2011-03-18 17:06:33 +0000
@@ -34,18 +34,19 @@
<div id="summary"
tal:content="structure context/summary/fmt:text-to-html" />
- <p>
+ <p tal:condition="view/bugs_answers_usage/uses_either">
This package has
- <a tal:attributes="href view/menu:overview/new_bugs/url">
- <strong>
- <tal:newbugs content="newbugs"/> new bug<tal:plural content="string:s" condition="python: newbugs!=1"/>
- </strong>
+ <a tal:attributes="href view/menu:overview/new_bugs/url"
+ tal:condition="view/bugs_answers_usage/uses_bugs"
+ ><tal:newbugs content="newbugs"/> new
+ bug<tal:plural content="string:s" condition="python: newbugs!=1"/>
</a>
- and
- <a tal:attributes="href view/menu:overview/open_questions/url">
- <strong>
- <tal:openq content="open_questions"/> open question<tal:plural content="string:s" condition="python: open_questions!=1"/>.
- </strong>
+ <tal:both condition="view/bugs_answers_usage/uses_both">and</tal:both>
+ <a tal:attributes="href view/menu:overview/open_questions/url"
+ tal:condition="view/bugs_answers_usage/uses_answers"
+ ><tal:openq content="open_questions"/> open
+ question<tal:plural content="string:s"
+ condition="python: open_questions!=1"/>.
</a>
</p>
</div>
=== modified file 'lib/lp/registry/templates/productseries-index.pt'
--- lib/lp/registry/templates/productseries-index.pt 2010-10-10 21:54:16 +0000
+++ lib/lp/registry/templates/productseries-index.pt 2011-03-18 17:06:33 +0000
@@ -110,6 +110,10 @@
<div class="yui-u">
<div tal:replace="structure context/@@+code-summary" />
+
+ <p tal:condition="context/branch/required:launchpad.View|nothing">
+ <a tal:replace="structure context/branch/menu:context/source/fmt:link"/>
+ </p>
</div>
</div>