l.r.s.populate_distroseriesdiff : module documentation

Part of lp.registry.scripts

Populate DistroSeriesDifference table.

This script creates DistroSeriesDifference entries for the package version differences between a derived DistroSeries and its parent.

The entries will still need to be processed by the cron job that works out the exact differences. Any pre-existing DistroSeriesDifference entries remain untouched.

Function compose_sql_find_latest_source_package_releases Produce SQL that gets the last-published `SourcePackageRelease`s.
Function compose_sql_find_differences Produce SQL that finds differences for a DistroSeries.
Function compose_sql_difference_type Produce SQL to compute a difference's DistroSeriesDifferenceType.
Function compose_sql_populate_distroseriesdiff Create DistroSeriesDifference rows based on found differences.
Function drop_table Drop table, if it exists.
Function populate_distroseriesdiff Compare derived_distroseries to parent, and register differences.
Function find_derived_series Find all derived DistroSeries.
Class DSDUpdater Call DistroSeriesDifference.update() where appropriate.
Class PopulateDistroSeriesDiff Populate DistroSeriesDifference for pre-existing differences.
def compose_sql_find_latest_source_package_releases(distroseries):
Produce SQL that gets the last-published `SourcePackageRelease`s.

Within `distroseries`, looks for the `SourcePackageRelease`
belonging to each respective `SourcePackageName`'s respective latest
`SourcePackagePublishingHistory`.

For each of those, it produces a tuple consisting of:
 * `SourcePackageName` id: sourcepackagename
 * `SourcePackageRelease` id: sourcepackagerelease
 * Source package version: version.

:return: SQL query, as a string.
def compose_sql_find_differences(derived_series, parent_series):
Produce SQL that finds differences for a `DistroSeries`.

The query compares `derived_distroseries` and its `previous_series`
and for each package whose latest `SourcePackageRelease`s in the
respective series differ, produces a tuple of:
 * `SourcePackageName` id: sourcepackagename
 * Source package version in derived series: source_version
 * Source package version in parent series: parent_source_version.

:return: SQL query, as a string.
def compose_sql_difference_type():
Produce SQL to compute a difference's DistroSeriesDifferenceType.

Works with the parent_source_version and source_version fields as produced by the SQL from compose_sql_find_differences.

ReturnsSQL query, as a string.
def compose_sql_populate_distroseriesdiff(derived_series, parent_series, temp_table):
Create `DistroSeriesDifference` rows based on found differences.

Uses field values that describe the difference, as produced by the
SQL from `compose_sql_find_differences`:
 * sourcepackagename
 * source_version
 * parent_source_version

Existing `DistroSeriesDifference` rows are not affected.

:param derived_distroseries: A derived `DistroSeries`.
:param temp_table: The name of a table to select the input fields
    from.
:return: SQL query, as a string.
def drop_table(store, table):
Drop table, if it exists.
def populate_distroseriesdiff(logger, derived_series, parent_series):
Compare derived_distroseries to parent, and register differences.

The differences are registered by creating DistroSeriesDifference records, insofar as they do not yet exist.

def find_derived_series():
Find all derived DistroSeries.
API Documentation for Launchpad, generated by pydoctor at 2018-11-17 00:00:08.