PackageUpload* table subclassing must be fixed

Bug #36470 reported by Mark Shuttleworth
8
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

We have a standard way to deal with slightly polymorphic objects, and that is to make tables that can accommodate all variants and leave some fields NULL'able.

The PackageUpload, PackageUploadBuild, PackageUploadSource and PackageUploadCustom tables should please all be collapsed into PackageUpload.

This will greatly simplify code like PackageUpload.getQueueItems!

Changed in soyuz:
assignee: nobody → dsilvers
Revision history for this message
Stuart Bishop (stub) wrote :

I'm committing a database patch to database/schema/pending/stub-distroreleasequeue.sql that adds this as well as the refactoring requested in Bug #36472.

Revision history for this message
Celso Providelo (cprov) wrote :

When the code is fixed we also need to rename queue.py to respect the current domain name (distroreleasequeue.py).
The stub DB patch looks ok and migrates the previous data correctly.

Celso Providelo (cprov)
Changed in soyuz:
assignee: dsilvers → cprov
status: Unconfirmed → Confirmed
Revision history for this message
Malcolm Cleaton (malcolmcleaton) wrote :

This isn't a case of a slightly polymorphic object in quite that way - sometimes a single DistroReleaseQueue row is related to more than one DistroReleaseQueueCustom row.

It's quite possible that this design is not optimum and that we can simplify it, but we can't do this simply by collapsing the tables and making the implied trivial code changes.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 36470] Re: DistroReleaseQueue* table subclassing must be fixed

Nonetheless, the current design is inadequate and we do need to address
it. I look forward to a landing that cleans it up!

Curtis Hovey (sinzui)
Changed in soyuz:
assignee: Celso Providelo (cprov) → nobody
Revision history for this message
Robert Collins (lifeless) wrote : Re: DistroReleaseQueue* table subclassing must be fixed

The schema has been significantly refactored - DistroReleaseQueue no longer exists. I believe the polymorphism was resolved during that refactoring.

Changed in launchpad:
status: Triaged → Fix Released
Revision history for this message
Julian Edwards (julian-edwards) wrote :

It wasn't fixed, DistroReleaseQueue was simply renamed to PackageUpload.

Changed in launchpad:
status: Fix Released → Triaged
importance: Medium → Low
summary: - DistroReleaseQueue* table subclassing must be fixed
+ PackageUpload* table subclassing must be fixed
description: updated
tags: added: tech-debt
Revision history for this message
William Grant (wgrant) wrote :

However, I still don't think this is a bug. We often have many PackageUploadBuilds and a PackageUploadSource in a single PackageUpload.

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: [Bug 36470] Re: PackageUpload* table subclassing must be fixed

On Wednesday 21 September 2011 12:35:58 you wrote:
> However, I still don't think this is a bug. We often have many
> PackageUploadBuilds and a PackageUploadSource in a single PackageUpload.

There is still a lot of opportunity for refactoring here, and as you note
PackageUploadSource is redundant. Reducing the number of tables generally
makes for quicker queries too.

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.