Merge lp:~edwin-grubbs/launchpad/bug-597738-bug-service-status into lp:launchpad

Proposed by Edwin Grubbs
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: 11547
Proposed branch: lp:~edwin-grubbs/launchpad/bug-597738-bug-service-status
Merge into: lp:launchpad
Prerequisite: lp:~jcsackett/launchpad/deprecate-official_codehosting
Diff against target: 550 lines (+193/-107)
13 files modified
lib/lp/answers/browser/questiontarget.py (+0/-16)
lib/lp/answers/browser/tests/test_questiontarget.py (+0/-24)
lib/lp/answers/templates/unknown-support.pt (+4/-5)
lib/lp/bugs/browser/bugtarget.py (+11/-6)
lib/lp/bugs/model/bugtask.py (+1/-0)
lib/lp/bugs/stories/bugs/xx-front-page-info.txt (+21/-8)
lib/lp/bugs/templates/bugtarget-bugs.pt (+62/-24)
lib/lp/registry/browser/productseries.py (+19/-2)
lib/lp/registry/doc/product.txt (+6/-0)
lib/lp/registry/interfaces/product.py (+3/-0)
lib/lp/registry/model/product.py (+38/-21)
lib/lp/testing/factory.py (+27/-0)
lib/lp/testing/menu.py (+1/-1)
To merge this branch: bzr merge lp:~edwin-grubbs/launchpad/bug-597738-bug-service-status
Reviewer Review Type Date Requested Status
Curtis Hovey (community) ui Approve
Henning Eggers (community) ui* Approve
Deryck Hodge (community) ui Abstain
Jelmer Vernooij (community) code Approve
Review via email: mp+34250@code.launchpad.net

Description of the change

Summary
-------

This branch provides the user with more information about filing bugs on
the bugs.launchpad.net/$project page. This branch also takes advantage
of the new bug_tracking_usage attribute that returns an enum as opposed
to the old official_malone boolean. If the project is not using
Launchpad as the bug tracker, the page will also inform the user of any
ubuntu packages linked to the project under which bugs can be filed.

This branch is dependent on
lp:~jcsackett/launchpad/deprecate-official_codehosting

Implementation details
----------------------

lib/lp/answers/browser/questiontarget.py
lib/lp/answers/browser/tests/test_questiontarget.py
lib/lp/answers/templates/unknown-support.pt
lib/lp/bugs/browser/bugtarget.py
lib/lp/bugs/stories/bugs/xx-front-page-info.txt
lib/lp/bugs/templates/bugtarget-bugs.pt
lib/lp/registry/doc/product.txt
lib/lp/registry/interfaces/product.py
lib/lp/registry/model/product.py

Tests
-----

./bin/test -vv -t 'xx-front-page-info.txt|doc/product.txt'

Demo and Q/A
------------

* Open http://launchpad.dev/firefox/+configure-bugtracker
  * Switch the "Bugs are tracked" field between the values.
* Open http://bugs.launchpad.dev/firefox
  * If bugs are tracked in launchpad, a bug table should be shown.
  * If bugs are tracked externally, the page should contain:
      <meta name="robots" content="noindex,nofollow"/>
      <strong>Bugs are tracked in _SOME BUGTRACKER_.</strong>

      <a>Getting started with bug tracking in Launchpad.</a>
      Firefox bug reports are also tracked in <a>mozilla-firefox in Ubuntu</a>.

  * If launchpad doesn't know where bugs are tracked, it should contain:
      <meta name="robots" content="noindex,nofollow"/>
      <strong>
      Launchpad does not know where to forward bug reports to contact the*
      developers of Mozilla Firefox.
      </strong>

      <a>Getting started with bug tracking in Launchpad.</a>
      Firefox bug reports are tracked in <a>mozilla-firefox in Ubuntu</a>.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

The text "Mozilla Firefox bug reports are tracked in: mozilla-firefox in ubuntu, mozilla-firefox in ubuntu." is a bit confusing. The text is repeated, but I would also argue that the text should mention somehow that those places are not for the bugs for upstream Firefox.

Perhaps something like: "Launchpad keeps track of bug reports for <a>mozilla-firefox in Ubuntu</a>."

review: Needs Fixing (code)
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

> The text "Mozilla Firefox bug reports are tracked in: mozilla-firefox in
> ubuntu, mozilla-firefox in ubuntu." is a bit confusing. The text is repeated,
> but I would also argue that the text should mention somehow that those places
> are not for the bugs for upstream Firefox.
>
> Perhaps something like: "Launchpad keeps track of bug reports for <a>mozilla-
> firefox in Ubuntu</a>."

Hi Jelmer,

Thanks for the review. I've made the wording changes you suggested, and I resolved the merge conflict with devel. When I removed the code that made the results distinct on the distro, I didn't realize that what was really necessary was to make it distinct on the distro/sourcepackagename. I did that, so now you won't see the odd duplicates on that page. I also added some testing for that text.

-Edwin

Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve (code)
Revision history for this message
Deryck Hodge (deryck) wrote :

Since I'm not a UI reviewer, I'll abstain from review; however, as a bugs guy looking at the change, I'm not sure the language is quite right for the case where we don't know where bugs are tracked. Saying Launchpad "does not know where to forward bug reports" assumes the project doesn't host itself on Launchpad. I think it would read better as Launchpad "does not know where $project tracks its bugs." Or something like that.

Just my .02c. :-) Nice work, otherwise.

Cheers,
deryck

review: Abstain (ui)
Revision history for this message
Henning Eggers (henninge) wrote :

Hi Edwin!
Thanks for adding these helpful comments. I think the help link is very important. Although you don't mention it it looks like you did the same for answers. Generally this looks good to me although I have a few small comments.

"Launchpad does not know where to forward bug reports to contact the developers of Mozilla Firefox."
That sentence seems to either be missing a "to" or I am misunderstanding it. Maybe it should simply be "Launchpad does not know where to forward bug reports to." or even just "Bugs are not tracked in Launchpad". The latter is consistent with "Bugs are tracked in The Mozilla.org Bug Tracker."

I wonder if the next line should be prefixed with "Hint: Launchpad keeps track of ..." to make clear it's a hint and not contradicting the previous line. The same line on the answers page should be worded similarly.

Actually, I think these wording questions are Matt Revell's domain .... ;-)

OK, here is the real UI issue I have:
"Launchpad allows your project to track questions and create FAQs." sits right on top the helpful links. There should at least be some padding in between those but really I think that line should go away completely. It can be integrated in the help link, e.g. "Getting started with offering support for your project." which explains a bit more what this is about.

With that last change in place, I can approve the UI here. That's it. ;-)

Henning

review: Approve (ui*)
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

> Hi Edwin!
> Thanks for adding these helpful comments. I think the help link is very
> important. Although you don't mention it it looks like you did the same for
> answers. Generally this looks good to me although I have a few small comments.
>
> "Launchpad does not know where to forward bug reports to contact the
> developers of Mozilla Firefox."
> That sentence seems to either be missing a "to" or I am misunderstanding it.
> Maybe it should simply be "Launchpad does not know where to forward bug
> reports to." or even just "Bugs are not tracked in Launchpad". The latter is
> consistent with "Bugs are tracked in The Mozilla.org Bug Tracker."

The reason for the wordiness is that I'm trying to explain to the user the difference between reporting a bug on ubuntu's firefox package and reporting a bug to the actual developers, since this page will suggest reporting a bug on the package if the project doesn't use Launchpad as their bug tracker. I want to avoid saying "Bugs are not tracked in Launchpad. You can submit a bug for the firefox package." since that sounds contradictory.

How does this sound? "Mozilla Firefox must be configured in order for Launchpad to forward bugs to the project's developers."

> I wonder if the next line should be prefixed with "Hint: Launchpad keeps track
> of ..." to make clear it's a hint and not contradicting the previous line. The
> same line on the answers page should be worded similarly.
>
> Actually, I think these wording questions are Matt Revell's domain .... ;-)
>
> OK, here is the real UI issue I have:
> "Launchpad allows your project to track questions and create FAQs." sits right
> on top the helpful links. There should at least be some padding in between
> those but really I think that line should go away completely. It can be
> integrated in the help link, e.g. "Getting started with offering support for
> your project." which explains a bit more what this is about.

I think that getting rid of the text looks cleaner than integrating it with the help link, but I don't know how important it is to explain that "offering support" means tracking questions and creating FAQs.

I'll let the secondary UI reviewer weigh in before I change the branch.

> With that last change in place, I can approve the UI here. That's it. ;-)
>
> Henning

Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (5.8 KiB)

Hi Edwin, et al.

I have some concerns about the consistency of the unknown/external/lp
states for all bug targets and some of their states. I think we need to
address all of these and I think we need to plan one or more branches to
complete the bugs app front page for bugtargets

(distro) https://bugs.launchpad.dev/kubuntu as Admin

    I see a message about forwarding bugs, but I know distros cannot
    have remote bug trackers. The choice is Launchpad or does not use
    Launchpad. The current message is better

    This is a fair example of why we do not use context/title inline.

    I see "_Enable bug tracking._" I think there should be an edit icon
    preceding it.

(dsp) https://bugs.launchpad.dev/kubuntu/+source/mozilla-firefox

    Oh my! This implies kubuntu does use bugs. I get an oops if I try to
    report bug.
    /me looks at fedora on lpnet.
    https://bugs.edge.launchpad.net/fedora/+source/mozilla-firefox
    also prompts me to report a bug and it too oopses :(
    ^ This is a separate issue but this is exactly the kind of
      mis-communication we are trying to fix. bridging the grape is not
      done until we address this.
      https://bugs.edge.launchpad.net/malone/+bug/635302

(project) https://bugs.launchpad.dev/gnome-terminal with bug tracker

    Looks good.

(project) https://bugs.launchpad.dev/thunderbird after linking to two packages

    I see
        Launchpad keeps track of bug reports for _cnews in ubuntu_,
        _pmount in ubuntu_.
    which is very odd. Some projects produce 20 packages and some have
    names nothing like the upstream project in Lp. I am not sure Launchpad
    is tracking this bugs, Ubuntu is. Maybe
        Ubuntu tracks bugs related to packages derived from this project:
        _cnews in ubuntu_, _pmount in ubuntu_.

(project group) https://bugs.launchpad.dev/launchpad-mirrors

    Implies the project groups has projects that track bugs. This is not
    True. The page should state that none of the group's project use
    Launchpad to track bugs. There is nothing to configure since the behaviour
    is derived from the state of member projects. The answers app tells the
    user that Lp does not know where support is managed.

> === modified file 'lib/lp/bugs/templates/bugtarget-bugs.pt'
> --- lib/lp/bugs/templates/bugtarget-bugs.pt 2010-08-04 11:01:15 +0000
> +++ lib/lp/bugs/templates/bugtarget-bugs.pt 2010-09-10 14:33:54 +0000
> ...
>
> @@ -162,27 +166,55 @@
>
> <p id="no-bugs-report"><a href="+filebug">Report a bug.</a></p>
> </tal:no_hot_bugs>
> - </tal:uses_malone>
> -
> - <tal:not_uses_malone condition="not: view/uses_launchpad_bugtracker"
> - tal:define ="configure_bugtracker context/menu:overview/configure_bugtracker | nothing">
> - <p id="no-malone"><strong><tal:project_title replace="context/title" /> does not use Launchpad for
> - bug tracking.</strong></p>
> - <p tal:condition="view/external_bugtracker"
> - id="bugtracker"><strong>Bugs are tracked in
> - <tal:bugtracker replace="structure view/bugtracker" />.</strong>
> - </p>
> -
> - <p tal:condition="context/required:launchpad.Edi...

Read more...

review: Needs Information (ui)
Revision history for this message
Curtis Hovey (sinzui) wrote :

> > Hi Edwin!
> > Thanks for adding these helpful comments. I think the help link is very
> > important. Although you don't mention it it looks like you did the same for
> > answers. Generally this looks good to me although I have a few small
> comments.
> >
> > "Launchpad does not know where to forward bug reports to contact the
> > developers of Mozilla Firefox."
> > That sentence seems to either be missing a "to" or I am misunderstanding
> it.
> > Maybe it should simply be "Launchpad does not know where to forward bug
> > reports to." or even just "Bugs are not tracked in Launchpad". The latter is
> > consistent with "Bugs are tracked in The Mozilla.org Bug Tracker."
>
>
> The reason for the wordiness is that I'm trying to explain to the user the
> difference between reporting a bug on ubuntu's firefox package and reporting a
> bug to the actual developers, since this page will suggest reporting a bug on
> the package if the project doesn't use Launchpad as their bug tracker. I want
> to avoid saying "Bugs are not tracked in Launchpad. You can submit a bug for
> the firefox package." since that sounds contradictory.
>
> How does this sound? "Mozilla Firefox must be configured in order for
> Launchpad to forward bugs to the project's developers."

I think this text is fine. I think part of the problem is really about the Ubuntu case. Ubuntu is not tracking project bugs, it is tracking package bugs:

Ubuntu tracks bugs related to packages derived from this project:
        _cnews in ubuntu_, _pmount in ubuntu_.

...

> > integrated in the help link, e.g. "Getting started with offering support for
> > your project." which explains a bit more what this is about.
>
>
> I think that getting rid of the text looks cleaner than integrating it with
> the help link, but I don't know how important it is to explain that "offering
> support" means tracking questions and creating FAQs.

Instead of support, maybe we should just say "questions and FAQs", because that is what we want to know. I will be adding fields for mailing lists and forums for answers in my after hours, so I expect the external page will clearly state where the user can find the answers to his or her questions.

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :
Download full text (7.3 KiB)

> Hi Edwin, et al.
>
> I have some concerns about the consistency of the unknown/external/lp
> states for all bug targets and some of their states. I think we need to
> address all of these and I think we need to plan one or more branches to
> complete the bugs app front page for bugtargets
>
> (distro) https://bugs.launchpad.dev/kubuntu as Admin
>
> I see a message about forwarding bugs, but I know distros cannot
> have remote bug trackers. The choice is Launchpad or does not use
> Launchpad. The current message is better

I have added a conditional to display the old message if the context cannot have an external bug tracker.

> This is a fair example of why we do not use context/title inline.
>
> I see "_Enable bug tracking._" I think there should be an edit icon
> preceding it.

I have added the sprite to this link.

> (dsp) https://bugs.launchpad.dev/kubuntu/+source/mozilla-firefox
>
> Oh my! This implies kubuntu does use bugs. I get an oops if I try to
> report bug.
> /me looks at fedora on lpnet.
> https://bugs.edge.launchpad.net/fedora/+source/mozilla-firefox
> also prompts me to report a bug and it too oopses :(
> ^ This is a separate issue but this is exactly the kind of
> mis-communication we are trying to fix. bridging the grape is not
> done until we address this.
> https://bugs.edge.launchpad.net/malone/+bug/635302

The DSP's default view is +bugs instead of +bugs-index, so it has no logic to inform the user that Launchpad doesn't track bugs for the DSP.

> (project) https://bugs.launchpad.dev/gnome-terminal with bug tracker
>
> Looks good.
>
> (project) https://bugs.launchpad.dev/thunderbird after linking to two packages
>
> I see
> Launchpad keeps track of bug reports for _cnews in ubuntu_,
> _pmount in ubuntu_.
> which is very odd. Some projects produce 20 packages and some have
> names nothing like the upstream project in Lp. I am not sure Launchpad
> is tracking this bugs, Ubuntu is. Maybe
> Ubuntu tracks bugs related to packages derived from this project:
> _cnews in ubuntu_, _pmount in ubuntu_.

I have made that change to the wording.

> (project group) https://bugs.launchpad.dev/launchpad-mirrors
>
> Implies the project groups has projects that track bugs. This is not
> True. The page should state that none of the group's project use
> Launchpad to track bugs. There is nothing to configure since the behaviour
> is derived from the state of member projects. The answers app tells the
> user that Lp does not know where support is managed.

Just like DSPs, ProjectGroups use +bugs instead of +bugs-index, so it will take some work in a later branch to fix.

> > === modified file 'lib/lp/bugs/templates/bugtarget-bugs.pt'
> > --- lib/lp/bugs/templates/bugtarget-bugs.pt 2010-08-04 11:01:15 +0000
> > +++ lib/lp/bugs/templates/bugtarget-bugs.pt 2010-09-10 14:33:54 +0000
> > ...
> >
> > @@ -162,27 +166,55 @@
> >
> > <p id="no-bugs-report"><a href="+filebug">Report a bug.</a></p>
> > </tal:no_hot_bugs>
> > - </tal:uses_malone>
> > -
> > - <tal:not_uses_...

Read more...

Revision history for this message
Curtis Hovey (sinzui) wrote :

Thanks for examining these issue and explaining what is happening. I think your branch is fine to land. We can discuss next steps in a separate thread. The series.title is an interesting issue because the attr is in the process of being removed from distroseries as a part of the Derivative distro work.

review: Approve (ui)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/answers/browser/questiontarget.py'
--- lib/lp/answers/browser/questiontarget.py 2010-09-03 13:32:42 +0000
+++ lib/lp/answers/browser/questiontarget.py 2010-09-14 13:29:47 +0000
@@ -507,22 +507,6 @@
507 question.sourcepackagename.name)507 question.sourcepackagename.name)
508508
509 @property509 @property
510 def ubuntu_packages(self):
511 """The Ubuntu `IDistributionSourcePackage`s linked to the context.
512
513 If the context is an `IProduct` and it has `IPackaging` links to
514 Ubuntu, a list is returned. Otherwise None is returned
515 """
516 if IProduct.providedBy(self.context):
517 ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
518 packages = [
519 package for package in self.context.distrosourcepackages
520 if package.distribution == ubuntu]
521 if len(packages) > 0:
522 return packages
523 return None
524
525 @property
526 def can_configure_answers(self):510 def can_configure_answers(self):
527 """Can the user configure answers for the `IQuestionTarget`."""511 """Can the user configure answers for the `IQuestionTarget`."""
528 target = self.context512 target = self.context
529513
=== modified file 'lib/lp/answers/browser/tests/test_questiontarget.py'
--- lib/lp/answers/browser/tests/test_questiontarget.py 2010-09-06 09:11:43 +0000
+++ lib/lp/answers/browser/tests/test_questiontarget.py 2010-09-14 13:29:47 +0000
@@ -135,30 +135,6 @@
135 self.assertViewTemplate(question_set, 'question-listing.pt')135 self.assertViewTemplate(question_set, 'question-listing.pt')
136136
137137
138class TestSearchQuestionsView_ubuntu_packages(TestSearchQuestionsView):
139 """Test the behaviour of SearchQuestionsView.ubuntu_packages."""
140
141 def test_nonproduct_ubuntu_packages(self):
142 distribution = self.factory.makeDistribution()
143 view = create_initialized_view(distribution, '+questions')
144 packages = view.ubuntu_packages
145 self.assertEqual(None, packages)
146
147 def test_product_ubuntu_packages_unlinked(self):
148 product = self.factory.makeProduct()
149 view = create_initialized_view(product, '+questions')
150 packages = view.ubuntu_packages
151 self.assertEqual(None, packages)
152
153 def test_product_ubuntu_packages_linked(self):
154 product = self.factory.makeProduct()
155 self.linkPackage(product, 'cow')
156 view = create_initialized_view(product, '+questions')
157 packages = view.ubuntu_packages
158 self.assertEqual(1, len(packages))
159 self.assertEqual('cow', packages[0].name)
160
161
162class TestSearchQuestionsViewUnknown(TestSearchQuestionsView):138class TestSearchQuestionsViewUnknown(TestSearchQuestionsView):
163 """Test the behaviour of SearchQuestionsView unknown support."""139 """Test the behaviour of SearchQuestionsView unknown support."""
164140
165141
=== modified file 'lib/lp/answers/templates/unknown-support.pt'
--- lib/lp/answers/templates/unknown-support.pt 2010-08-05 17:14:05 +0000
+++ lib/lp/answers/templates/unknown-support.pt 2010-09-14 13:29:47 +0000
@@ -21,9 +21,9 @@
21 </p>21 </p>
2222
23 <p id="ubuntu-support"23 <p id="ubuntu-support"
24 tal:define="packages view/ubuntu_packages"24 tal:define="packages context/ubuntu_packages | nothing"
25 tal:condition="packages">25 tal:condition="packages">
26 <tal:project replace="context/displayname" /> questions are also26 <tal:project replace="context/displayname" /> questions are
27 tracked in: <tal:packages repeat="package packages">27 tracked in: <tal:packages repeat="package packages">
28 <tal:package replace="structure package/fmt:link" /><tal:comma28 <tal:package replace="structure package/fmt:link" /><tal:comma
29 condition="not:repeat/package/end">, </tal:comma></tal:packages>.29 condition="not:repeat/package/end">, </tal:comma></tal:packages>.
@@ -31,10 +31,9 @@
3131
32 <p id="configure-support"32 <p id="configure-support"
33 tal:condition="view/can_configure_answers">33 tal:condition="view/can_configure_answers">
34 Launchpad allows your project to track questions and create FAQs.34 <a class="sprite maybe"
35 <br /><a class="sprite maybe"
36 href="https://help.launchpad.net/Answers">Getting started35 href="https://help.launchpad.net/Answers">Getting started
37 with support tracking in Launchpad</a>.36 tracking questions and FAQs in Launchpad</a>.
38 <br /><a tal:replace="structure context/menu:overview/configure_answers/fmt:link" />37 <br /><a tal:replace="structure context/menu:overview/configure_answers/fmt:link" />
39 </p>38 </p>
40 </div>39 </div>
4140
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2010-09-03 03:12:39 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2010-09-14 13:29:47 +0000
@@ -1252,13 +1252,18 @@
1252 bug_statuses_to_show.append(BugTaskStatus.FIXRELEASED)1252 bug_statuses_to_show.append(BugTaskStatus.FIXRELEASED)
12531253
1254 @property1254 @property
1255 def uses_launchpad_bugtracker(self):1255 def can_have_external_bugtracker(self):
1256 """Whether this distro or product tracks bugs in launchpad.1256 return (IProduct.providedBy(self.context)
12571257 or IProductSeries.providedBy(self.context))
1258 :returns: boolean1258
1259 @property
1260 def bug_tracking_usage(self):
1261 """Whether the context tracks bugs in launchpad.
1262
1263 :returns: ServiceUsage enum value
1259 """1264 """
1260 service_usage = IServiceUsage(self.context)1265 service_usage = IServiceUsage(self.context)
1261 return service_usage.bug_tracking_usage == ServiceUsage.LAUNCHPAD1266 return service_usage.bug_tracking_usage
12621267
1263 @property1268 @property
1264 def external_bugtracker(self):1269 def external_bugtracker(self):
@@ -1278,7 +1283,7 @@
12781283
1279 :returns: str which may contain HTML.1284 :returns: str which may contain HTML.
1280 """1285 """
1281 if self.uses_launchpad_bugtracker:1286 if self.bug_tracking_usage == ServiceUsage.LAUNCHPAD:
1282 return 'Launchpad'1287 return 'Launchpad'
1283 elif self.external_bugtracker:1288 elif self.external_bugtracker:
1284 return BugTrackerFormatterAPI(self.external_bugtracker).link(None)1289 return BugTrackerFormatterAPI(self.external_bugtracker).link(None)
12851290
=== modified file 'lib/lp/bugs/model/bugtask.py'
--- lib/lp/bugs/model/bugtask.py 2010-09-03 03:12:39 +0000
+++ lib/lp/bugs/model/bugtask.py 2010-09-14 13:29:47 +0000
@@ -159,6 +159,7 @@
159from lp.soyuz.model.publishing import SourcePackagePublishingHistory159from lp.soyuz.model.publishing import SourcePackagePublishingHistory
160from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease160from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
161161
162
162debbugsseveritymap = {163debbugsseveritymap = {
163 None: BugTaskImportance.UNDECIDED,164 None: BugTaskImportance.UNDECIDED,
164 'wishlist': BugTaskImportance.WISHLIST,165 'wishlist': BugTaskImportance.WISHLIST,
165166
=== modified file 'lib/lp/bugs/stories/bugs/xx-front-page-info.txt'
--- lib/lp/bugs/stories/bugs/xx-front-page-info.txt 2010-05-08 15:29:56 +0000
+++ lib/lp/bugs/stories/bugs/xx-front-page-info.txt 2010-09-14 13:29:47 +0000
@@ -19,7 +19,8 @@
19 >>> anon_browser.open('http://bugs.launchpad.dev/test-project')19 >>> anon_browser.open('http://bugs.launchpad.dev/test-project')
20 >>> uses_malone_p = find_tag_by_id(anon_browser.contents, 'no-malone')20 >>> uses_malone_p = find_tag_by_id(anon_browser.contents, 'no-malone')
21 >>> print extract_text(uses_malone_p)21 >>> print extract_text(uses_malone_p)
22 Simple Test Project does not use Launchpad for bug tracking.22 Test-project must be configured in order for Launchpad to forward bugs to
23 the project's developers.
2324
24Only users who have permission to do so can enable bug tracking25Only users who have permission to do so can enable bug tracking
25for a project.26for a project.
@@ -53,7 +54,7 @@
53 >>> bug_list = find_tag_by_id(54 >>> bug_list = find_tag_by_id(
54 ... anon_browser.contents, 'no-bugs-filed')55 ... anon_browser.contents, 'no-bugs-filed')
55 >>> print extract_text(bug_list)56 >>> print extract_text(bug_list)
56 There are currently no bugs filed against Project Uses Malone.57 There are currently no bugs filed against Uses-malone.
5758
58Since there are no bugs at all filed for the project, no search box is59Since there are no bugs at all filed for the project, no search box is
59shown.60shown.
@@ -100,7 +101,7 @@
100 >>> bug_list = find_tag_by_id(101 >>> bug_list = find_tag_by_id(
101 ... anon_browser.contents, 'no-bugs-filed')102 ... anon_browser.contents, 'no-bugs-filed')
102 >>> print extract_text(bug_list)103 >>> print extract_text(bug_list)
103 There are currently no open bugs filed against Project Uses Malone.104 There are currently no open bugs filed against Uses-malone.
104105
105But since the project has a bug, the search box is still visible.106But since the project has a bug, the search box is still visible.
106107
@@ -112,8 +113,7 @@
112 Advanced search113 Advanced search
113114
114Projects that use an external bug tracker will list the tracker on a115Projects that use an external bug tracker will list the tracker on a
115bugs home page in addition to the message that the project does not116bugs home page.
116use Launchpad for bug tracking.
117117
118 >>> login('foo.bar@canonical.com')118 >>> login('foo.bar@canonical.com')
119 >>> some_tracker = factory.makeBugTracker(119 >>> some_tracker = factory.makeBugTracker(
@@ -121,9 +121,22 @@
121 >>> test_project.bugtracker = some_tracker121 >>> test_project.bugtracker = some_tracker
122 >>> logout()122 >>> logout()
123 >>> anon_browser.open('http://bugs.launchpad.dev/test-project')123 >>> anon_browser.open('http://bugs.launchpad.dev/test-project')
124 >>> uses_malone_p = find_tag_by_id(anon_browser.contents, 'no-malone')
125 >>> print extract_text(uses_malone_p)
126 Simple Test Project does not use Launchpad for bug tracking.
127 >>> tracker_text = find_tag_by_id(anon_browser.contents, 'bugtracker')124 >>> tracker_text = find_tag_by_id(anon_browser.contents, 'bugtracker')
128 >>> print extract_text(tracker_text)125 >>> print extract_text(tracker_text)
129 Bugs are tracked in tracker.example.com/.126 Bugs are tracked in tracker.example.com/.
127
128Projects that are linked to an Ubuntu distro source package and that
129don't use Launchpad for bug tracking will inform the user that a bug can
130be reported on the project's source packages.
131
132 >>> login('foo.bar@canonical.com')
133 >>> factory.makePackagingLink(
134 ... productseries=test_project.development_focus,
135 ... sourcepackagename='test-project-package',
136 ... in_ubuntu=True)
137 >>> logout()
138 >>> anon_browser.open('http://bugs.launchpad.dev/test-project')
139 >>> print extract_text(
140 ... find_tag_by_id(anon_browser.contents, 'also-in-ubuntu'))
141 Ubuntu also tracks bugs for packages derived from this project:
142 test-project-package in ubuntu.
130143
=== modified file 'lib/lp/bugs/templates/bugtarget-bugs.pt'
--- lib/lp/bugs/templates/bugtarget-bugs.pt 2010-08-04 11:01:15 +0000
+++ lib/lp/bugs/templates/bugtarget-bugs.pt 2010-09-14 13:29:47 +0000
@@ -10,12 +10,15 @@
10 i18n:domain="malone"10 i18n:domain="malone"
11>11>
12 <metal:block fill-slot="head_epilogue">12 <metal:block fill-slot="head_epilogue">
13 <meta tal:condition="not: view/bug_tracking_usage/enumvalue:LAUNCHPAD"
14 name="robots" content="noindex,nofollow" />
13 <style type="text/css">15 <style type="text/css">
14 p#more-hot-bugs {float:right; margin-top:7px;}16 p#more-hot-bugs {float:right; margin-top:7px;}
15 </style>17 </style>
16 </metal:block>18 </metal:block>
17 <body>19 <body>
18 <tal:side metal:fill-slot="side" condition="view/uses_launchpad_bugtracker">20 <tal:side metal:fill-slot="side"
21 condition="view/bug_tracking_usage/enumvalue:LAUNCHPAD">
19 <div id="involvement" class="portlet">22 <div id="involvement" class="portlet">
20 <ul class="involvement">23 <ul class="involvement">
21 <li style="border: none">24 <li style="border: none">
@@ -95,7 +98,8 @@
9598
9699
97100
98 <tal:uses_malone condition="view/uses_launchpad_bugtracker">101 <tal:uses_launchpad_bugtracker
102 condition="view/bug_tracking_usage/enumvalue:LAUNCHPAD">
99 <tal:has_bugtasks condition="context/has_bugtasks">103 <tal:has_bugtasks condition="context/has_bugtasks">
100 <div class="search-box" style="margin-bottom:2em">104 <div class="search-box" style="margin-bottom:2em">
101 <metal:search105 <metal:search
@@ -158,31 +162,65 @@
158 <tal:no_hot_bugs condition="not: view/hot_bugs_info/bugtasks">162 <tal:no_hot_bugs condition="not: view/hot_bugs_info/bugtasks">
159 <p id="no-bugs-filed"><strong>There are currently no163 <p id="no-bugs-filed"><strong>There are currently no
160 <span tal:condition="context/has_bugtasks">open</span> bugs filed164 <span tal:condition="context/has_bugtasks">open</span> bugs filed
161 against <tal:project_title replace="context/title" />.</strong></p>165 against <tal:displayname replace="context/displayname" />.</strong></p>
162166
163 <p id="no-bugs-report"><a href="+filebug">Report a bug.</a></p>167 <p id="no-bugs-report"><a href="+filebug">Report a bug.</a></p>
164 </tal:no_hot_bugs>168 </tal:no_hot_bugs>
165 </tal:uses_malone>169 </tal:uses_launchpad_bugtracker>
166170
167 <tal:not_uses_malone condition="not: view/uses_launchpad_bugtracker"171 <p id="no-malone"
168 tal:define ="configure_bugtracker context/menu:overview/configure_bugtracker | nothing">172 tal:condition="view/bug_tracking_usage/enumvalue:UNKNOWN">
169 <p id="no-malone"><strong><tal:project_title replace="context/title" /> does not use Launchpad for173 <strong tal:condition="view/can_have_external_bugtracker">
170 bug tracking.</strong></p>174 <tal:displayname replace="context/displayname" />
171 <p tal:condition="view/external_bugtracker"175 must be configured in order for Launchpad to forward bugs to
172 id="bugtracker"><strong>Bugs are tracked in176 the project's developers.
173 <tal:bugtracker replace="structure view/bugtracker" />.</strong>177 </strong>
174 </p>178 <strong tal:condition="not: view/can_have_external_bugtracker">
175179 <tal:displayname replace="context/displayname" />
176 <p tal:condition="context/required:launchpad.Edit"180 does not use Launchpad for bug tracking.
177 id="no-malone-edit"181 </strong>
178 >182 </p>
179 <a tal:condition="configure_bugtracker"183
180 tal:replace="structure configure_bugtracker/fmt:link"/>184 <p tal:condition="view/external_bugtracker"
181 <a tal:condition="not: configure_bugtracker"185 id="bugtracker">
182 tal:attributes="href string:${context/fmt:url/+edit}">186 <strong>Bugs are tracked in
183 Enable bug tracking.</a>187 <tal:bugtracker replace="structure view/bugtracker" />.
184 </p>188 </strong>
185 </tal:not_uses_malone>189 </p>
190
191 <tal:also_in_ubuntu
192 condition="not: view/bug_tracking_usage/enumvalue:LAUNCHPAD">
193 <p tal:define="packages context/ubuntu_packages | nothing"
194 tal:condition="packages"
195 id="also-in-ubuntu">
196 Ubuntu
197 <tal:also condition="view/external_bugtracker">also</tal:also>
198 tracks bugs for packages derived from this project:
199 <tal:packages repeat="package packages">
200 <span style="white-space: nowrap"
201 tal:content="structure package/fmt:link" /><tal:comma
202 condition="not:repeat/package/end">,</tal:comma></tal:packages>.
203 </p>
204 </tal:also_in_ubuntu>
205
206 <div
207 tal:condition="not: view/bug_tracking_usage/enumvalue:LAUNCHPAD"
208 tal:define="configure_bugtracker context/menu:overview/configure_bugtracker | nothing">
209 <a class="sprite maybe"
210 href="https://help.launchpad.net/Bugs">Getting started
211 with bug tracking in Launchpad</a>.
212
213 <p tal:condition="context/required:launchpad.Edit"
214 id="no-malone-edit"
215 >
216 <a tal:condition="configure_bugtracker"
217 tal:replace="structure configure_bugtracker/fmt:link"/>
218 <a class="sprite edit"
219 tal:condition="not: configure_bugtracker"
220 tal:attributes="href string:${context/fmt:url/+edit}">
221 Enable bug tracking.</a>
222 </p>
223 </div>
186224
187 </div><!-- main -->225 </div><!-- main -->
188 </body>226 </body>
189227
=== modified file 'lib/lp/registry/browser/productseries.py'
--- lib/lp/registry/browser/productseries.py 2010-09-09 18:21:55 +0000
+++ lib/lp/registry/browser/productseries.py 2010-09-14 13:29:47 +0000
@@ -280,12 +280,29 @@
280 usedfor = IProductSeries280 usedfor = IProductSeries
281 facet = 'overview'281 facet = 'overview'
282 links = [282 links = [
283 'edit', 'delete', 'driver', 'link_branch', 'ubuntupkg',283 'configure_bugtracker',
284 'create_milestone', 'create_release', 'rdf', 'subscribe',284 'create_milestone',
285 'create_release',
286 'delete',
287 'driver',
288 'edit',
289 'link_branch',
290 'rdf',
285 'set_branch',291 'set_branch',
292 'subscribe',
293 'ubuntupkg',
286 ]294 ]
287295
288 @enabled_with_permission('launchpad.Edit')296 @enabled_with_permission('launchpad.Edit')
297 def configure_bugtracker(self):
298 text = 'Configure bug tracker'
299 summary = 'Specify where bugs are tracked for this project'
300 return Link(
301 canonical_url(self.context.product,
302 view_name='+configure-bugtracker'),
303 text, summary, icon='edit')
304
305 @enabled_with_permission('launchpad.Edit')
289 def edit(self):306 def edit(self):
290 """Return a link to edit this series."""307 """Return a link to edit this series."""
291 text = 'Change details'308 text = 'Change details'
292309
=== modified file 'lib/lp/registry/doc/product.txt'
--- lib/lp/registry/doc/product.txt 2010-09-10 13:29:42 +0000
+++ lib/lp/registry/doc/product.txt 2010-09-14 13:29:47 +0000
@@ -225,6 +225,11 @@
225 >>> [(sp.name, sp.distribution.name) for sp in alsa.distrosourcepackages]225 >>> [(sp.name, sp.distribution.name) for sp in alsa.distrosourcepackages]
226 [(u'alsa-utils', u'debian'), (u'alsa-utils', u'ubuntu')]226 [(u'alsa-utils', u'debian'), (u'alsa-utils', u'ubuntu')]
227227
228For convenience, you can get just the distro source packages for Ubuntu.
229
230 >>> [(sp.name, sp.distribution.name) for sp in alsa.ubuntu_packages]
231 [(u'alsa-utils', u'ubuntu')]
232
228The date_next_suggest_packaging attribute records the date when Launchpad can233The date_next_suggest_packaging attribute records the date when Launchpad can
229resume suggesting Ubuntu packages that the project provides. A value of None234resume suggesting Ubuntu packages that the project provides. A value of None
230means that no user has ever confirmed that that the project has no Ubuntu235means that no user has ever confirmed that that the project has no Ubuntu
@@ -714,6 +719,7 @@
714 ... print series.name719 ... print series.name
715 trunk720 trunk
716721
722
717Changing ownership723Changing ownership
718==================724==================
719725
720726
=== modified file 'lib/lp/registry/interfaces/product.py'
--- lib/lp/registry/interfaces/product.py 2010-08-31 00:02:42 +0000
+++ lib/lp/registry/interfaces/product.py 2010-09-14 13:29:47 +0000
@@ -644,6 +644,9 @@
644 distrosourcepackages = Attribute(_("List of distribution packages for "644 distrosourcepackages = Attribute(_("List of distribution packages for "
645 "this product"))645 "this product"))
646646
647 ubuntu_packages = Attribute(
648 _("List of distribution packages for this product in Ubuntu"))
649
647 series = exported(650 series = exported(
648 doNotSnapshot(651 doNotSnapshot(
649 CollectionField(value_type=Object(schema=IProductSeries))))652 CollectionField(value_type=Object(schema=IProductSeries))))
650653
=== modified file 'lib/lp/registry/model/product.py'
--- lib/lp/registry/model/product.py 2010-09-03 11:05:21 +0000
+++ lib/lp/registry/model/product.py 2010-09-14 13:29:47 +0000
@@ -48,6 +48,9 @@
48 SQLBase,48 SQLBase,
49 sqlvalues,49 sqlvalues,
50 )50 )
51from canonical.launchpad.components.decoratedresultset import (
52 DecoratedResultSet,
53 )
51from canonical.launchpad.interfaces.launchpad import (54from canonical.launchpad.interfaces.launchpad import (
52 IHasIcon,55 IHasIcon,
53 IHasLogo,56 IHasLogo,
@@ -64,6 +67,7 @@
64 MAIN_STORE,67 MAIN_STORE,
65 )68 )
66from canonical.launchpad.webapp.sorting import sorted_version_numbers69from canonical.launchpad.webapp.sorting import sorted_version_numbers
70
67from lp.answers.interfaces.faqtarget import IFAQTarget71from lp.answers.interfaces.faqtarget import IFAQTarget
68from lp.answers.interfaces.questioncollection import (72from lp.answers.interfaces.questioncollection import (
69 QUESTION_STATUS_DEFAULT_SEARCH,73 QUESTION_STATUS_DEFAULT_SEARCH,
@@ -146,6 +150,7 @@
146from lp.registry.model.productlicense import ProductLicense150from lp.registry.model.productlicense import ProductLicense
147from lp.registry.model.productrelease import ProductRelease151from lp.registry.model.productrelease import ProductRelease
148from lp.registry.model.productseries import ProductSeries152from lp.registry.model.productseries import ProductSeries
153from lp.registry.model.sourcepackagename import SourcePackageName
149from lp.registry.model.structuralsubscription import (154from lp.registry.model.structuralsubscription import (
150 StructuralSubscriptionTargetMixin,155 StructuralSubscriptionTargetMixin,
151 )156 )
@@ -829,28 +834,40 @@
829 (x.sourcepackagename.name, x.distroseries.name,834 (x.sourcepackagename.name, x.distroseries.name,
830 x.distroseries.distribution.name))835 x.distroseries.distribution.name))
831836
832 @property837 @cachedproperty
833 def distrosourcepackages(self):838 def distrosourcepackages(self):
834 from lp.registry.model.distributionsourcepackage \839 from lp.registry.model.distributionsourcepackage import (
835 import DistributionSourcePackage840 DistributionSourcePackage,
836 clause = """ProductSeries.id=Packaging.productseries AND841 )
837 ProductSeries.product = %s842 store = IStore(Packaging)
838 """ % sqlvalues(self.id)843 origin = [
839 clauseTables = ['ProductSeries']844 Packaging,
840 ret = Packaging.select(clause, clauseTables,845 Join(SourcePackageName,
841 prejoins=["sourcepackagename", "distroseries.distribution"])846 Packaging.sourcepackagename == SourcePackageName.id),
842 distros = set()847 Join(ProductSeries, Packaging.productseries == ProductSeries.id),
843 dsps = []848 Join(DistroSeries, Packaging.distroseries == DistroSeries.id),
844 for packaging in ret:849 Join(Distribution, DistroSeries.distribution == Distribution.id),
845 distro = packaging.distroseries.distribution850 ]
846 if distro in distros:851 result = store.using(*origin).find(
847 continue852 (SourcePackageName, Distribution),
848 distros.add(distro)853 ProductSeries.product == self)
849 dsps.append(DistributionSourcePackage(854 result = result.order_by(SourcePackageName.name, Distribution.name)
850 sourcepackagename=packaging.sourcepackagename,855 result.config(distinct=True)
851 distribution=distro))856
852 return sorted(dsps, key=lambda x:857 return [
853 (x.sourcepackagename.name, x.distribution.name))858 DistributionSourcePackage(
859 sourcepackagename=sourcepackagename,
860 distribution=distro)
861 for sourcepackagename, distro in result]
862
863 @cachedproperty
864 def ubuntu_packages(self):
865 """The Ubuntu `IDistributionSourcePackage`s linked to the `IProduct`.
866 """
867 ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
868 return [
869 package for package in self.distrosourcepackages
870 if package.distribution == ubuntu]
854871
855 @property872 @property
856 def bugtargetdisplayname(self):873 def bugtargetdisplayname(self):
857874
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2010-09-09 20:12:02 +0000
+++ lib/lp/testing/factory.py 2010-09-14 13:29:47 +0000
@@ -182,6 +182,10 @@
182from lp.registry.interfaces.mailinglistsubscription import (182from lp.registry.interfaces.mailinglistsubscription import (
183 MailingListAutoSubscribePolicy,183 MailingListAutoSubscribePolicy,
184 )184 )
185from lp.registry.interfaces.packaging import (
186 IPackagingUtil,
187 PackagingType,
188 )
185from lp.registry.interfaces.person import (189from lp.registry.interfaces.person import (
186 IPerson,190 IPerson,
187 IPersonSet,191 IPersonSet,
@@ -993,6 +997,29 @@
993 removeSecurityProxy(branch).reviewer = reviewer997 removeSecurityProxy(branch).reviewer = reviewer
994 return branch998 return branch
995999
1000 def makePackagingLink(self, productseries=None, sourcepackagename=None,
1001 distroseries=None, packaging_type=None, owner=None,
1002 in_ubuntu=False):
1003 if productseries is None:
1004 productseries = self.makeProduct().development_focus
1005 if sourcepackagename is None or isinstance(sourcepackagename, str):
1006 sourcepackagename = self.makeSourcePackageName(sourcepackagename)
1007 if distroseries is None:
1008 distribution = None
1009 if in_ubuntu:
1010 distribution = getUtility(ILaunchpadCelebrities).ubuntu
1011 distroseries = self.makeDistroSeries(distribution=distribution)
1012 if packaging_type is None:
1013 packaging_type = PackagingType.PRIME
1014 if owner is None:
1015 owner = self.makePerson()
1016 return getUtility(IPackagingUtil).createPackaging(
1017 productseries=productseries,
1018 sourcepackagename=sourcepackagename,
1019 distroseries=distroseries,
1020 packaging=packaging_type,
1021 owner=owner)
1022
996 def makePackageBranch(self, sourcepackage=None, distroseries=None,1023 def makePackageBranch(self, sourcepackage=None, distroseries=None,
997 sourcepackagename=None, **kwargs):1024 sourcepackagename=None, **kwargs):
998 """Make a package branch on an arbitrary package.1025 """Make a package branch on an arbitrary package.
9991026
=== modified file 'lib/lp/testing/menu.py'
--- lib/lp/testing/menu.py 2010-09-12 11:43:36 +0000
+++ lib/lp/testing/menu.py 2010-09-14 13:29:47 +0000
@@ -11,7 +11,7 @@
11def check_menu_links(menu):11def check_menu_links(menu):
12 context = menu.context12 context = menu.context
13 for link in menu.iterlinks():13 for link in menu.iterlinks():
14 if link.target.startswith('/'):14 if link.target.startswith(('/', 'http://')):
15 # The context is not the context of this target.15 # The context is not the context of this target.
16 continue16 continue
17 if '?' in link.target:17 if '?' in link.target: