Move ISeriesMixin to lp.registry.interfaces.series

Bug #531261 reported by Adi Roiban
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Adi Roiban

Bug Description

Right now ISeriesMixin is located in lp.registry.interfaces.distroseries and is only used by DistroSeries.

Since this Mixin should be used for DistroSeries and ProductSeries common attributes, we should move it to lp.registry.interfaces.series, and make ProductSeries use it.

We can also see what other attributes can be moved to ISeriesMixin

Related branches

Adi Roiban (adiroiban)
Changed in launchpad-registry:
assignee: nobody → Adi Roiban (adiroiban)
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: New → Triaged
importance: Undecided → Low
tags: added: tech-debt
Revision history for this message
Adi Roiban (adiroiban) wrote :

Here is the list of attributes found both in IProductSeries and IDistroSeries.

Is it ok if I move them in ISeriesMixin and their implementation in SeriesMixin ?

Otherwise, are you happy with the changes from the current attached branch?

    name = exported(
        DistroSeriesNameField(
            title=_("Name"), required=True,
            description=_("The name of this series."),
            constraint=name_validator))

    status = exported(
        Choice(
            title=_("Status"), required=True,
            vocabulary=SeriesStatus))

    date_created = exported(
        Datetime(title=_("The date this series was registered.")))

    owner = exported(
        PublicPersonChoice(title=_("Owner"), vocabulary='ValidOwner'))

    driver = exported(
        Choice(
            title=_("Driver"),
            description=_(
                "The person or team responsible for decisions about features "
                "and bugs that will be targeted to this series of the "
                "distribution."),
            required=False, vocabulary='ValidPersonOrTeam'))

    title = exported(
        Title(
            title=_("Title"), required=True,
            description=_(
                "The title of this series. It should be distinctive "
                "and designed to look good at the top of a page.")))

    displayname = exported(
        TextLine(
            title=_('Display Name'),
            description=_('Display name, in this case we have removed the '
                          'underlying database field, and this attribute '
                          'just returns the name.')),
        exported_as='display_name')

    summary = exported(
        Summary(title=_("Summary"), required=True,
            description=_(
                "A brief summary of the highlights of this release. "
                "It should be no longer than a single paragraph, up "
                "to 200 words.")))

-----------------------------------------------------------------------------------

The following attributes, have the same interface, but their implementation is different as they depend of product or distribution. Maybe we can move them in IHasBugs, IHasDrivers ... etc

    packagings = Attribute("All of the Packaging entries for this "
        "distroseries.")

    specifications = Attribute("The specifications targeted to this "
        "series.")

    drivers = Attribute(
        'A list of the people or teams who are drivers for this series. '
        'This list is made up of any drivers or owners from this '
        'DistroSeries, and the Distribution to which it belong.')

    bug_supervisor = Attribute(
        'Currently just a reference to the Distribution bug supervisor.')

    security_contact = Attribute(
        'Currently just a reference to the Distribution security contact.')

Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: Triaged → In Progress
Revision history for this message
Curtis Hovey (sinzui) wrote :

This information looks correct.

It might be possible to make drivers, bug_supervisor, and security_contact common by requiring the implementing classes to define a parent attribute that returns either the IProduct or IDistribution. eg
    return [self.driver] + self.parent.drivers

The question.QuestionTargetMixin requires its composed classes to define such methods to safely decouple the classes. Consider Product.getTargetTypes() and SourcePackageQuestionTargetMixin.getTargetTypes() return a dict of the combination of objects that define the target type. I think we could make packagings work the same way if we are querying packagings by passing kwrgs of sourcepackagename, distroseries, and productseries.

specification is a problem. It belongs on HasSpecficiations and that is used by many objects.

Revision history for this message
Adi Roiban (adiroiban) wrote :

As a start I moved summary, bug_supervisor, security_contact and drivers. This is already a 500 line diff.

----------

packagings requires a bug on its own, and same for specifications.

---------

date_created is ugly since distroseries is using date_created while product datecreated

Most probably we also want it as date_created in product, but this is use in many places.

---------

I didn't knew how to implement the "driver" since in distroseries it is validated using "validate_public_person" while in productseries using "validate_person_not_private_membership"

----------

There is a similar issue with "owner". In distroseries is PublicPersonChoise while in productseries is ParticipatingPersonChoice.

----------

I don't think we can move "title" and "display" since in distroseries they are stored in the db, while for productseries they are computer from series name.

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

I agree with your analysis. It is better to solve these other issue in another effort.

Adi Roiban (adiroiban)
tags: added: iseries
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
Changed in launchpad-registry:
milestone: none → 10.03
status: In Progress → Fix Committed
tags: added: qa-needstesting
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
Revision history for this message
Curtis Hovey (sinzui) wrote : Bug 531261 Fix released

Fixed released in launchpad-project 10.03.

Changed in launchpad-registry:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.