Migrate DistributionSourcePackage database class to be backed by the database

Bug #297736 reported by Gavin Panella
6
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

DistributionSourcePackage already exists in the database, but it isn't
used by the database class in the LP tree. DSP is a "virtual" thing.

However, once the fix for bug #43893 and/or bug #273495 (development
started under the banner of bug #43893 and the other bug was filed
later to cover those specific changes), a new database class will
exist - DistributionSourcePackageInDatabase - that does use the DSP
table.

This has been done so that we can select and update the
bug_reporting_guidelines column. This database class is not accessible
outside of the module in which it's defined, and access to the
bug_reporting_guidelines column is managed entirely via a property on
the non-database-backed DistributionSourcePackage class.

Phew. In short, it means that the interface to DSP has not changed.

The justification is that there wasn't time to do the complete job of
migrating DSP to being fully backed by the database. As you'll see, I
don't think this short-term measure will complicate the migration from
a virtual DSP class to a database-backed one greatly.

A plan was discussed during the pre-implementation phase of bug
#43893
:

 * Need to create new `DistributionSourcePackage` rows in the Soyuz
   upload code at the same time as it creates new `SourcePackageName`
   records. In addition to a bulk fix at roll-out time.

 * Create a new `IDistributionSourcePackageSet` utility to find and
   create these things.

 * Update the few places that create `DistributionSourcePackage`
   objects on the fly to use the utility.

 * It'll be important to check if there are any nasty interactions
   w.r.t. `DistributionSourcePackageCache`. This is updated daily in a
   cron job, `cronscripts/update-pkgcache.py`.

 * Ideally we can ignore this cache for now, and everything will
   work. However, it probably makes sense to fold everything in
   `DistributionSourcePackageCache` into `DistributionSourcePackage`.

BjornT commented on this at the time:

  I'm not convinced we need a IDistributionSourcePackageSet
  utility. We should get them through IDistribution, and there should
  be one API to create both the DistributionSourcePackage and
  SourcePackageName at the same time.

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

It would be nice to have this table migrated for https://dev.launchpad.net/Soyuz/SourcePackageLicenses, so let's find a place in the 3.0 schedule for them.

Changed in soyuz:
assignee: nobody → cprov
importance: Undecided → High
milestone: none → pending
status: New → Triaged
Curtis Hovey (sinzui)
tags: added: tech-debt
Curtis Hovey (sinzui)
Changed in soyuz:
assignee: Celso Providelo (cprov) → nobody
Changed in soyuz:
assignee: nobody → Edwin Grubbs (edwin-grubbs)
Curtis Hovey (sinzui)
Changed in launchpad:
assignee: Edwin Grubbs (edwin-grubbs) → nobody
Curtis Hovey (sinzui)
tags: added: target-picker
Revision history for this message
Curtis Hovey (sinzui) wrote :

A substantial part of the data work is now done. Official packages are added to the DSP table when a package is uploaded or when an official package branch is linked to series. The table was updated with the missing data from SeriesSourcePackageBranches and historic packages that are not is the current series.

There may still be a need for the virtual class when DSP are being created or Lp is working with an unsupported distro. The next step might be to rename the two classes:
DistributuionSourcePackage -> VirtualDistributuionSourcePackage
DistributuionSourcePackageInDatabase -> DistributuionSourcePackage

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.