Merge lp:~adeuring/launchpad/bug-283941-show-patch-numbers-on-upstream-report into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Merged at revision: | not available |
| Proposed branch: | lp:~adeuring/launchpad/bug-283941-show-patch-numbers-on-upstream-report |
| Merge into: | lp:launchpad/db-devel |
| Diff against target: |
486 lines (+153/-51) 6 files modified
lib/lp/bugs/browser/bugtask.py (+4/-1) lib/lp/bugs/browser/distribution_upstream_bug_report.py (+17/-5) lib/lp/bugs/doc/distribution-upstream-bug-report.txt (+66/-25) lib/lp/bugs/stories/distribution/xx-distribution-upstream-bug-report.txt (+32/-16) lib/lp/bugs/templates/distribution-upstream-bug-report.pt (+21/-1) lib/lp/registry/model/distribution.py (+13/-3) |
| To merge this branch: | bzr merge lp:~adeuring/launchpad/bug-283941-show-patch-numbers-on-upstream-report |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Curtis Hovey (community) | ui | 2010-02-17 | Approve on 2010-02-17 |
| Brad Crittenden (community) | code | 2010-02-16 | Approve on 2010-02-16 |
|
Review via email:
|
|||
| Abel Deuring (adeuring) wrote : | # |
| Brad Crittenden (bac) wrote : | # |
Hi Abel,
Thanks for this branch. It looks good to me except for a couple of
questions. Please do have a UI review too.
--Brad
> === modified file 'lib/lp/
--- lib/lp/
> +++ lib/lp/
> @@ -1858,7 +1858,8 @@
>
>
> def get_buglisting_
> - assignee=None, importance=None, status=None, status_
> + assignee=None, importance=None, status=None, status_
> + has_patches=None):
> """Return the given URL with the search parameters specified."""
> search_params = []
>
> @@ -1870,6 +1871,8 @@
> search_
> if status_upstream is not None:
> search_
> + if has_patches is not None:
> + search_
>
> query_string = urllib.
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -60,11 +60,12 @@
> BAD_THRESHOLD = 20
>
> def __init__(self, open_bugs=0, triaged_bugs=0, upstream_bugs=0,
> - watched_bugs=0):
> + watched_bugs=0, bugs_with_
> self.open_bugs = open_bugs
> self.triaged_bugs = triaged_bugs
> self.upstream_bugs = upstream_bugs
> self.watched_bugs = watched_bugs
> + self.bugs_
>
> @property
> def triaged_
> @@ -148,9 +149,9 @@
> - *_url: convenience URLs
> """
> def __init__(self, dsp, dssp, product, open_bugs, triaged_bugs,
> - upstream_bugs, watched_bugs):
> + upstream_bugs, watched_bugs, bugs_with_
> BugReportData.
> - watched_bugs)
> + watched_bugs, bugs_with_
> self.dsp = dsp
> self.dssp = dssp
> self.product = product
> @@ -235,6 +236,14 @@
> self.watched_
> dsp_bugs_url, unwatched_
>
> + # The bugs with upstream patches URL links to all open upstream
> + # bugs that don't have a bugwatch but have patches attached.
> + bugs_with_
> + get_buglisting_
> + status_
> + self.bugs_
> + dsp_bugs_url, bugs_with_
> +
>
> class DistributionUps
> """Implements the actual upstream bug report.
> @@ -248,6 +257,7 @@
> valid_sort_keys = [
> 'bugtracker_name',
> 'bug_superviso...
| Abel Deuring (adeuring) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Brad,
thanks for your review!
On 16.02.2010 17:34, Brad Crittenden wrote:
> Review: Approve code
> Hi Abel,
>
> Thanks for this branch. It looks good to me except for a couple of
> questions. Please do have a UI review too.
Sure, I wont forget the UI review ;)
>
> --Brad
>
>
[...]
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -131,20 +131,56 @@
>> >>> task = getUtility(
>> >>> Store.of(
>> >>> print_report(
>> - pmount pmount 2 2 1 0
>> - linux-source-2.6.15 None 1 0 0 0
>> - mozilla-firefox firefox 1 1 1 1
>> -
>> -Linking that task to a bugwatch makes the watch counts update:
>> + pmount pmount 2 2 1 0 0
>> + linux-source-2.6.15 None 1 0 0 0 0
>> + mozilla-firefox firefox 1 1 1 1 0
>> +
>> +The last column counts those bugs with upstream tasks that have patches
>> +attached but which don't have an upstream bugwatch. If we add a ordinary
>> +attachment to our pmount bug, the value of the last column does not
>> +change...
>> +
>> + >>> attachment = factory.
>> + >>> print_report(
>> + pmount pmount 2 2 1 0 0
>> + linux-source-2.6.15 None 1 0 0 0 0
>> + mozilla-firefox firefox 1 1 1 1 0
>> +
>> +...but when we make this attachment a patch, the value of the column
>> +increases.
>> +
>> + >>> from lp.bugs.
>> + >>> attachment.type = BugAttachmentTy
>> + >>> Store.of(
>> + >>> print_report(
>> + pmount pmount 2 2 1 0 1
>> + linux-source-2.6.15 None 1 0 0 0 0
>> + mozilla-firefox firefox 1 1 1 1 0
>> +
>> +Note that we count only bugs with patches for products that do not
>> +use Malone officially.
>> +
>> + >>> pmount.
>> + >>> Store.of(
>> + >>> print_report(
>> + pmount pmount 2 2 1 1 0
>> + linux-source-2.6.15 None 1 0 0 0 0
>> + mozilla-firefox firefox 1 1 1 1 0
>
> I find having a '0' to be misleading. Would not using a '-' or some
> other indicator to show the data are not relevant be more appropriate?
Thanks, this is a nice idea -- but I prefer to implement this special
case in the template. Firstly, this keeps the code of the method
getPackagesAndP
simpler, and secondly, we calculate and display the sum over all rows
for all columns in the browser class. Having something other than a
number would make that code also more convoluted.
>> === modified file 'lib/lp/
>> --- lib/l...
| Abel Deuring (adeuring) wrote : | # |
screenshot: http://
The right-most column ("Patches for upstream") is new

This branch adds another column "number of bugs in a distribution that have patches attached and which may be intersting for the upstream project" to the "upstream report" page. See also bug 283941.
While Jorge suggested in the report to add the new number in parentheses after the last number in each row, I opted to add another column so that we can display a column header. Having numbers without any explanation does IMHO not make much sense, and the page requires already a wiki page with lots of explanations.
Technical changes:
The last value of the current implementation of the page is the difference of the numbers in the columns "Upstream" and "Watch", giving the number of bugs in Ubuntu where the upstream project does not have a corresponding bug.
These numbers come from an SQL query in Distribution. getPackagesAndP ublicUpstreamBu gCounts( ); the SQL expressions are
for "Upstream" and
for "Watch".
We can get the difference between these numbers by inverting the expression
which is
(Note that the value of the column RelatedProduct. official_ malone may not be NULL). In plain words: "The number of bugs where we have a bugtask in the Launchpad project and in Ubuntu, but where the upstream project does not use Launchpad". IOW, the number of bugs that have been marked in Launchpad as affecting the upstream project, but where we don't know about a corresponding bug in the real upstream bug tracker.
From these bugs, we only want those that have a patch attached, so we add another term for this condition, giving this COUNT expression for the new column of the upstream report page:
The remaining changes are mostly mechanical:
The tuples returned by Distribution. getPackagesAndP ublicUpstreamBu gCounts( ) now have another element, so the callsite had to be changed DistributionUps treamBugReport. initialize( ) had to be changed too.
The values of each displayed on the +upstreamreport gae are stored in insteances of class BugReportData, so this class is now also aware of the new number.
Finally, the number "bugs with patches interesting for upstream" is displayed as a link to a bug search oage. The link is the same as the one for the next column to the left, but with the additional parameter "show only bugs having patches".
The remaing changes are added and ...