Merge lp:~kfogel/launchpad/505845-affects-person-from-dups into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Graham Binns on 2010-01-20 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~kfogel/launchpad/505845-affects-person-from-dups |
| Merge into: | lp:launchpad |
| Diff against target: |
308 lines (+219/-5) 5 files modified
lib/lp/bugs/configure.zcml (+3/-0) lib/lp/bugs/doc/bug.txt (+145/-1) lib/lp/bugs/interfaces/bug.py (+22/-2) lib/lp/bugs/model/bug.py (+46/-2) lib/lp/bugs/stories/webservice/xx-bug.txt (+3/-0) |
| To merge this branch: | bzr merge lp:~kfogel/launchpad/505845-affects-person-from-dups |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Graham Binns (community) | code | 2010-01-20 | Approve on 2010-01-20 |
| Karl Fogel (community) | Resubmit on 2010-01-20 | ||
|
Review via email:
|
|||
| Karl Fogel (kfogel) wrote : | # |
| Graham Binns (gmb) wrote : | # |
Nice branch! Couple of nitpicks and a question about your XXX, but
otherwise nothing major. r=me with the fix for the XXX applied if
possible (or a promise that it will land shortly after this branch
does).
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -1242,12 +1242,18 @@
> 0
> >>> test_bug.
> 3
> + >>> test_bug.
> + >>> test_bug.
> + False
> + >>> test_bug.
> + 1
> + >>> test_bug.
> + 2
>
> We can also get the collection of users affected by a bug.
>
> >>> print '\n'.join(
> ... sorted(user.name for user in test_bug.
> - blaze-bayley
> bruce-dickinson
> paul-dianno
>
> @@ -1255,6 +1261,144 @@
> >>> print list(unaffectin
> [<Person at ...>]
>
> +Similarly, we can get the collection of users unaffected by a bug.
> +
> + >>> print '\n'.join(
> + ... sorted(user.name for user in test_bug.
> + blaze-bayley
> +
> +If a user is marked as being affected by a bug (either by explicitly
> +marking it so, or by being the bug's owner), and then that bug is
> +marked as a duplicate of master bug, then the users_affected_
> +the master bug increases too.
> +
> + >>> dupe_affected_user = factory.
> + >>> dupe_one = factory.
> + >>> dupe_one.
> + >>> test_bug.
> + 3
> +
> +And the list of users the master bug affects includes that user.
> +
> + >>> print '\n'.join(
> + ... sorted(user.name for user in test_bug.
> + bruce-dickinson
> + paul-dianno
> + sheila-shakespeare
> +
> +However, if the user was also marked as being affected by the master
> +bug, then the master bug's user_affected_count does *not* increment
> +just because she is also affected by the duplicate.
> +
> + >>> test_bug.
> + >>> test_bug.
> + 3
> +
> +And the list of users that the master bug affects still includes the
> +user, of course.
> +
> + >>> print '\n'.join(
> + ... sorted(user.name for user in test_bug.
> + bruce-dickinson
> + paul-dianno
> + sheila-shakespeare
> +
> +If there is another dup of the master bug, filed by someone else, the
> +master bug's affected count with dups increases.
> +
> + >>> dupe_affected_
> + >>> dupe_three = factory.
> + >>> dupe_three.
> + >>> test_bug.
> + 4
> +
> +If the user claims that two bugs both affect her, then if they are
> +both marked as duplicates of the master bugs, the master bug's
> +user_affected_
> +
...
| Karl Fogel (kfogel) wrote : | # |
Fixed typos, and took care of "XXX" comment with a surprisingly simple solution (well, surprising to me anyway).

Fix bug #505845 by adding new properties Bug.users_ affected_ with_dupes and Bug.users_ affected_ count_with_ dupes, so bug heat can do the correct calculations, and (eventually) so the web UI can show more accurate information.
Along the way, fix a long-standing bug in Bug.users_affected whereby it was counting users who had explicitly said "does not affect me" as being affected.
Note the one "XXX" still in the change.