Merge lp://staging/~wgrant/launchpad/unuse-bugtask-markers into lp://staging/launchpad

Proposed by William Grant
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 13489
Proposed branch: lp://staging/~wgrant/launchpad/unuse-bugtask-markers
Merge into: lp://staging/launchpad
Diff against target: 609 lines (+71/-215)
11 files modified
lib/canonical/launchpad/doc/canonical_url_examples.txt (+5/-5)
lib/canonical/launchpad/mail/helpers.py (+2/-50)
lib/lp/bugs/browser/bugtask.py (+20/-61)
lib/lp/bugs/browser/configure.zcml (+6/-37)
lib/lp/bugs/browser/tests/bugtask-adding-views.txt (+15/-14)
lib/lp/bugs/doc/bugtask-package-widget.txt (+3/-3)
lib/lp/bugs/doc/bugtask.txt (+0/-22)
lib/lp/bugs/model/tests/test_bugtask.py (+3/-4)
lib/lp/bugs/stories/bugtask-management/xx-change-milestone.txt (+2/-2)
lib/lp/bugs/subscribers/bugtask.py (+2/-2)
lib/lp/registry/vocabularies.py (+13/-15)
To merge this branch: bzr merge lp://staging/~wgrant/launchpad/unuse-bugtask-markers
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+68636@code.staging.launchpad.net

Commit message

[incr] [r=sinzui][bug=80902] Remove most uses of the I*BugTask marker interfaces.

Description of the change

This branch begins the elimination of IUpstreamBugTask, IDistroBugTask, IDistroSeriesBugTask and IProductSeriesBugTask. They're fairly silly marker interfaces on top of IBugTask, which serve little purpose. I've replaced most of the uses with direct attribute or target interface checks.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

I think this branch is good to land, but I have a few questions I hope to you can answer.

I see the milestone controls have a sensible name now, but I do not see how this was accomplished. I assume all is good since tests did not break.
- ... name='1.0_firefox.milestone')
+ ... name='firefox_1.0.milestone')

I think getMilestoneTarget() is wrong, and it has been wrong since mid 2006. Milestones names are owned by the pillar (since 2006), though their direct parent as of 2009 is the series. I expect the rules for productseries and distroseries to be identical, yet they are not. A the milestone target for a productseries is a product. Why is a distroseries a milestone target? And why is a distroseries the target for a sourcepackage?
+ if IProduct.providedBy(bug_target):
+ target = milestone_context.product
+ elif IProductSeries.providedBy(bug_target):
+ target = milestone_context.productseries.product
+ elif (IDistribution.providedBy(bug_target) or
+ IDistributionSourcePackage.providedBy(bug_target)):
+ target = milestone_context.distribution
+ elif (IDistroSeries.providedBy(bug_target) or
+ ISourcePackage.providedBy(bug_target)):
+ target = milestone_context.distroseries
You may not know the answer to this since this change preserves the existing behaviour. My question does not block your landing. This may relate to https://bugs.launchpad.net/launchpad/+bug/423692

review: Needs Information (code)
Revision history for this message
Robert Collins (lifeless) wrote :

Code wise, I see one little thing that might be interesting to change
in a followup:
 rather than
if <>
elif <>

patterns, you could define self.target once, and then delegate things
(like bug supervisor) to the target [for in-python code].

Revision history for this message
William Grant (wgrant) wrote :

> I think this branch is good to land, but I have a few questions I hope to you
> can answer.
>
> I see the milestone controls have a sensible name now, but I do not see how
> this was accomplished. I assume all is good since tests did not break.
> - ... name='1.0_firefox.milestone')
> + ... name='firefox_1.0.milestone')

The chunk at line 160 of the diff de-duplicates some code, and ends up putting the productseries name after the product name, as was already done with distroseries. There may be more test failures, but this is all I found with a cursory check.

> I think getMilestoneTarget() is wrong, and it has been wrong since mid 2006.
> Milestones names are owned by the pillar (since 2006), though their direct
> parent as of 2009 is the series. I expect the rules for productseries and
> distroseries to be identical, yet they are not. A the milestone target for a
> productseries is a product. Why is a distroseries a milestone target? And why
> is a distroseries the target for a sourcepackage?
> + if IProduct.providedBy(bug_target):
> + target = milestone_context.product
> + elif IProductSeries.providedBy(bug_target):
> + target = milestone_context.productseries.product
> + elif (IDistribution.providedBy(bug_target) or
> + IDistributionSourcePackage.providedBy(bug_target)):
> + target = milestone_context.distribution
> + elif (IDistroSeries.providedBy(bug_target) or
> + ISourcePackage.providedBy(bug_target)):
> + target = milestone_context.distroseries
> You may not know the answer to this since this change preserves the existing
> behaviour. My question does not block your landing. This may relate to
> https://bugs.launchpad.net/launchpad/+bug/423692

ISourcePackage should really be called IDistroSeriesSourcePackage, but nobody has managed to rename it in the last 6 years.

I think we should keep this behaviour, as it doesn't make sense to show lucid-updates for a natty task.

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

My question was about why they are different given that the rules the milestones are identical:
            elif IProductSeries.providedBy(bug_target):
                target = milestone_context.productseries.product
could be written
            elif IProductSeries.providedBy(bug_target):
                target = milestone_context.productseries
And that may really relate to https://bugs.launchpad.net/launchpad/+bug/423692

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

You did answer my pressing question about how the field name changed, so this branch is okay to land.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.