l.s.i.p.IPublishingSet(Interface) : interface documentation

Part of lp.soyuz.interfaces.publishing View In Hierarchy

Auxiliary methods for dealing with sets of publications.
Method publishBinaries Efficiently publish multiple BinaryPackageReleases in an Archive.
Method copyBinaries Copy multiple binaries to a given destination.
Method newSourcePublication Create a new SourcePackagePublishingHistory.
Method getByIdAndArchive Return the publication matching id AND archive.
Method getBuildsForSourceIds Return all builds related with each given source publication.
Method getBuildsForSources Return all builds related with each given source publication.
Method getUnpublishedBuildsForSources Return all the unpublished builds for each source.
Method getBinaryFilesForSources Return binary files related to each given source publication.
Method getFilesForSources Return all files related to each given source publication.
Method getBinaryPublicationsForSources Return all binary publication for the given source publications.
Method getBuiltPackagesSummaryForSourcePublication Return a summary of the built packages for this source publication.
Method getActiveArchSpecificPublications Find architecture-specific binary publications for a source.
Method getChangesFilesForSources Return all changesfiles for each given source publication.
Method getChangesFileLFA The changes file for the given SourcePackageRelease.
Method setMultipleDeleted Mark publications as deleted.
Method findCorrespondingDDEBPublications Find corresponding DDEB publications, given a list of publications.
Method requestDeletion Delete the source and binary publications specified.
Method getBuildStatusSummariesForSourceIdsAndArchive Return a summary of the build statuses for source publishing ids.
Method getBuildStatusSummaryForSourcePublication Return a summary of the build statuses for this source
def publishBinaries(archive, distroseries, pocket, binaries):
Efficiently publish multiple BinaryPackageReleases in an Archive.

Creates IBinaryPackagePublishingHistory records for each binary, handling architecture-independent, avoiding creation of duplicate publications, and leaving disabled architectures alone.

ParametersarchiveThe target IArchive.
distroseriesThe target IDistroSeries.
pocketThe target PackagePublishingPocket.
binariesA dict mapping BinaryPackageReleases to their desired overrides as (Component, Section, PackagePublishingPriority, phased_update_percentage) tuples.
ReturnsA list of new IBinaryPackagePublishingHistory records.
def copyBinaries(archive, distroseries, pocket, bpphs, policy=None):
Copy multiple binaries to a given destination.

Efficiently copies the given `IBinaryPackagePublishingHistory`
records to a new archive and suite, optionally overriding the
original publications' component, section and priority using an
`IOverridePolicy`.

:param archive: The target `IArchive`.
:param distroseries: The target `IDistroSeries`.
:param pocket: The target `PackagePublishingPocket`.
:param binaries: A list of `IBinaryPackagePublishingHistory`s to copy.
:param policy: An optional `IOverridePolicy` to apply to the copy.

:return: A result set of the created `IBinaryPackagePublishingHistory`
    records.
def newSourcePublication(archive, sourcepackagerelease, distroseries, component, section, pocket, ancestor, create_dsd_job=True):
Create a new SourcePackagePublishingHistory.

datecreated will be UTC_NOW. status will be PackagePublishingStatus.PENDING

ParametersarchiveAn IArchive
sourcepackagereleaseAn ISourcePackageRelease
distroseriesAn IDistroSeries
componentAn IComponent
sectionAn ISection
pocketA PackagePublishingPocket
ancestorA ISourcePackagePublishingHistory for the previous version of this publishing record
create_dsd_jobA boolean indicating whether or not a dsd job should be created for the new source publication.
creatorAn optional IPerson. If this is None, the sourcepackagerelease's creator will be used.
sponsorAn optional IPerson indicating the sponsor of this publication.
packageuploadAn optional IPackageUpload that caused this publication to be created.
def getByIdAndArchive(id, archive, source=True):
Return the publication matching id AND archive.
ParametersarchiveThe context IArchive.
sourceIf true look for source publications, otherwise binary publications.
def getBuildsForSourceIds(source_ids, archive=None, build_states=None):

Return all builds related with each given source publication.

The returned ResultSet contains entries with the wanted Build`s associated with the corresponding source publication and its targeted `DistroArchSeries in a 3-element tuple. This way the extra information will be cached and the callsites can group builds in any convenient form.

The optional archive parameter, if provided, will ensure that only builds corresponding to the archive will be included in the results.

The result is ordered by:

  1. Ascending SourcePackagePublishingHistory.id,
  2. Ascending DistroArchSeries.architecturetag.
Parameterssource_idslist of or a single SourcePackagePublishingHistory object. (type: list or SourcePackagePublishingHistory)
archiveAn optional archive with which to filter the source ids. (type: IArchive)
build_statesoptional list of build states to which the result will be limited. Defaults to all states if ommitted. (type: list or None)
need_build_farm_jobwhether to include the PackageBuild and BuildFarmJob in the result.
Returnsa storm ResultSet containing tuples as (SourcePackagePublishingHistory, Build, DistroArchSeries) (type: storm.store.ResultSet.)
def getBuildsForSources(one_or_more_source_publications):
Return all builds related with each given source publication.

Extracts the source ids from one_or_more_source_publications and calls getBuildsForSourceIds.

def getUnpublishedBuildsForSources(one_or_more_source_publications, build_states=None):
Return all the unpublished builds for each source.
Parametersone_or_more_source_publicationslist of, or a single SourcePackagePublishingHistory object.
build_stateslist of build states to which the result should be limited. Defaults to BuildStatus.FULLYBUILT if none are specified.
Returnsa storm ResultSet containing tuples of (SourcePackagePublishingHistory, Build)
def getBinaryFilesForSources(one_or_more_source_publication):
Return binary files related to each given source publication.

The returned ResultSet contains entries with the wanted
`LibraryFileAlias`s (binaries only) associated with the
corresponding source publication and its `LibraryFileContent`
in a 3-element tuple. This way the extra information will be
cached and the callsites can group files in any convenient form.

:param one_or_more_source_publication: list of or a single
    `SourcePackagePublishingHistory` object.

:return: a storm ResultSet containing triples as follows:
    (`SourcePackagePublishingHistory`, `LibraryFileAlias`,
     `LibraryFileContent`)
def getFilesForSources(one_or_more_source_publication):
Return all files related to each given source publication.

The returned ResultSet contains entries with the wanted
`LibraryFileAlias`s (source and binaries) associated with the
corresponding source publication and its `LibraryFileContent`
in a 3-element tuple. This way the extra information will be
cached and the callsites can group files in any convenient form.

Callsites should order this result after grouping by source,
because SQL UNION can't be correctly ordered in SQL level.

:param one_or_more_source_publication: list of or a single
    `SourcePackagePublishingHistory` object.

:return: an *unordered* storm ResultSet containing tuples as
    (`SourcePackagePublishingHistory`, `LibraryFileAlias`,
     `LibraryFileContent`)
def getBinaryPublicationsForSources(one_or_more_source_publications):
Return all binary publication for the given source publications.

The returned ResultSet contains entries with the wanted
`BinaryPackagePublishingHistory`s associated with the corresponding
source publication and its targeted `DistroArchSeries`,
`BinaryPackageRelease` and `BinaryPackageName` in a 5-element tuple.
This way the extra information will be cached and the callsites can
group binary publications in any convenient form.

The result is ordered by:

 1. Ascending `SourcePackagePublishingHistory.id`,
 2. Ascending `BinaryPackageName.name`,
 3. Ascending `DistroArchSeries.architecturetag`.
 4. Descending `BinaryPackagePublishingHistory.id`.

:param one_or_more_source_publication: list of or a single
    `SourcePackagePublishingHistory` object.

:return: a storm ResultSet containing tuples as
    (`SourcePackagePublishingHistory`,
     `BinaryPackagePublishingHistory`,
     `BinaryPackageRelease`, `BinaryPackageName`, `DistroArchSeries`)
def getBuiltPackagesSummaryForSourcePublication(source_publication):
Return a summary of the built packages for this source publication.

For each built package from this published source, return a dictionary with keys "binarypackagename" and "summary", where the binarypackagename is unique (i.e. it ignores the same package published in more than one place/architecture.)

def getActiveArchSpecificPublications(sourcepackagerelease, archive, distroseries, pocket):
Find architecture-specific binary publications for a source.

For example, say source package release contains binary packages of:
  • "foo" for i386 (pending in i386)
  • "foo" for amd64 (published in amd64)
  • "foo-common" for the "all" architecture (pending or published in various real processor architectures)

In that case, this search will return foo(i386) and foo(amd64). The dominator uses this when figuring out whether foo-common can be superseded: we don't track dependency graphs, but we know that the architecture-specific "foo" releases are likely to depend on the architecture-independent foo-common release.

ParameterssourcepackagereleaseThe SourcePackageRelease.
archiveThe Archive to search.
distroseriesThe DistroSeries to search.
pocketThe PackagePublishingPocket to search.
ReturnsA Storm result set of active, architecture-specific BinaryPackagePublishingHistory objects for the source package release in the given archive, distroseries, and pocket.
def getChangesFilesForSources(one_or_more_source_publications):
Return all changesfiles for each given source publication.

The returned ResultSet contains entries with the wanted changesfiles
as `LibraryFileAlias`es associated with the corresponding source
publication and its corresponding `LibraryFileContent`,
`PackageUpload` and `SourcePackageRelease` in a 5-element tuple.
This way the extra information will be cached and the call sites can
group changesfiles in any convenient form.

The result is ordered by ascending `SourcePackagePublishingHistory.id`

:param one_or_more_source_publication: list of or a single
    `SourcePackagePublishingHistory` object.

:return: a storm ResultSet containing tuples as
    (`SourcePackagePublishingHistory`, `PackageUpload`,
     `SourcePackageRelease`, `LibraryFileAlias`, `LibraryFileContent`)
def getChangesFileLFA(spr):
The changes file for the given SourcePackageRelease.
Parameterssprthe SourcePackageRelease for which to return the changes file LibraryFileAlias.
Returnsa LibraryFileAlias instance or None
def setMultipleDeleted(publication_class, ds, removed_by, removal_comment=None):
Mark publications as deleted.

This is a supporting operation for a deletion request.

def findCorrespondingDDEBPublications(pubs):
Find corresponding DDEB publications, given a list of publications.
def requestDeletion(pub, removed_by, removal_comment=None):
Delete the source and binary publications specified.

This method deletes the source publications passed via the first parameter as well as their associated binary publications, and any binary publications passed in.

Parameterspubslist of SourcePackagePublishingHistory and BinaryPackagePublishingHistory objects.
removed_byIPerson responsible for the removal.
removal_commentoptional text describing the removal reason.
ReturnsThe deleted publishing record, either: ISourcePackagePublishingHistory or IBinaryPackagePublishingHistory.
def getBuildStatusSummariesForSourceIdsAndArchive(source_ids, archive):
Return a summary of the build statuses for source publishing ids.

This method collects all the builds for the provided source package
publishing history ids, and returns the build status summary for
the builds associated with each source package.

See the `getStatusSummaryForBuilds()` method of `IBuildSet`.for
details of the summary.

:param source_ids: A list of source publishing history record ids.
:type source_ids: ``list``
:param archive: The archive which will be used to filter the source
                ids.
:type archive: `IArchive`
:return: A dict consisting of the overall status summaries for the
    given ids that belong in the archive. For example:
        {
            18: {'status': 'succeeded'},
            25: {'status': 'building', 'builds':[building_builds]},
            35: {'status': 'failed', 'builds': [failed_builds]}
        }
:rtype: ``dict``.
def getBuildStatusSummaryForSourcePublication(source_publication):
Return a summary of the build statuses for this source publication.

See ISourcePackagePublishingHistory.getStatusSummaryForBuilds() for details. The call is just proxied here so that it can also be used with an ArchiveSourcePublication passed in as the source_package_pub, allowing the use of the cached results.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.