getBuildSummariesForSourceIds doesn't include copied builds

Bug #588044 reported by Fabien Tassin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

Copied packages are not exposed by getBuildSummariesForSourceIds().

>>> team = launchpad.people['chromium-daily']
>>> team.ppas
<lazr.restfulclient.resource.Collection object at 0x9dc864c>
>>> team.ppas[0]
<archive at https://api.launchpad.net/1.0/~chromium-daily/+archive/beta>
>>> ppa=team.ppas[0]

let's compare gyp lucid (built) vs gyp maverick (copied):

>>> for src in ppa.getPublishedSources(status = 'Published'):
... if src.source_package_name == 'gyp' and src.distro_series.name == 'lucid':
... src_id = src.self_link.rpartition('/')[2]
... builds = ppa.getBuildSummariesForSourceIds(source_ids = src_id)
... builds
...
{u'1009041': {u'status': u'FULLYBUILT', u'builds': [{u'can_be_retried': False, u'current_source_publication_link': None, u'can_be_rescored': False, u'build_log_url': u'https://launchpad.net/~chromium-daily/+archive/ppa/+build/1583876/+files/buildlog_ubuntu-lucid-i386.gyp_0.1~svn805-0ubuntu1~ucd1_FULLYBUILT.txt.gz', u'datebuilt': u'2010-03-27T03:22:07.131529+00:00', u'title': u'i386 build of gyp 0.1~svn805-0ubuntu1~ucd1 in ubuntu lucid RELEASE', u'distribution_link': u'https://api.launchpad.net/1.0/ubuntu', u'resource_type_link': u'https://api.launchpad.net/1.0/#build', u'buildstate': u'Successfully built', u'datecreated': u'2010-03-27T03:15:39.707811+00:00', u'pocket': u'Release', u'http_etag': u'"04b20c3747439b74c77470480a2560ed1657c476-1336d479fdd94ccd60bb0b736b3b88a0c7c66fd3"', u'dependencies': u'', u'date_first_dispatched': u'2010-03-27T03:16:16.123228+00:00', u'self_link': u'https://api.launchpad.net/1.0/~chromium-daily/+archive/ppa/+build/1583876', u'arch_tag': u'i386', u'archive_link': u'https://api.launchpad.net/1.0/~chromium-daily/+archive/ppa', u'upload_log_url': None}]}}

>>> for src in ppa.getPublishedSources(status = 'Published'):
... if src.source_package_name == 'gyp' and src.distro_series.name == 'maverick':
... src_id = src.self_link.rpartition('/')[2]
... builds = ppa.getBuildSummariesForSourceIds(source_ids = src_id)
... builds
...
{u'1152029': {u'status': u'FULLYBUILT', u'builds': []}}
>>>

Fabien Tassin (fta)
affects: launchpad → soyuz
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Hi Fabien, thanks for the detailed instructions to reproduce the situation.

Just to pin-point the issue to the underlying method that is being called (getBuilds()):
{{{

>>> team = launchpad.people['chromium-daily']
>>> ppa=team.ppas[0]
>>> srcs = ppa.getPublishedSources(source_name="gyp", exact_match=True, status="Published")
>>> srcs[0].distro_series.name
u'maverick'
>>> srcs[0].getBuilds()[0]
...
IndexError: list index out of range
>>> srcs[1].distro_series.name
u'lucid'
>>> srcs[1].getBuilds()[0]
<build at https://api.launchpad.net/1.0/~chromium-daily/+archive/ppa/+build/1583876>
}}}

Now on one side, it is actually correct that there are no builds for maverick (assuming you copied with binaries? in which case there were no new binaries built). But I'm assuming that you're saying (and rightly) that it should return the corresponding builds for the source publishing even if its the builds from the other distroseries.

Now the logic of src_pub.getBuilds() currently is (well, it uses IPublishingSet.getBuildsForSourceIds()):

1) Look for the actual builds in the same archive and *distroseries* as the src publishing (of which there are non for maverick, as the binaries were copied right?)
2) Look for any builds from *other* archives that have binaries published in the src pubs archive and *distroseries* (ie. that were copied from *other* archives)

and return the union of (1) and (2).

As you've found, what is missing are the builds that were copied from another distroseries within the same archive. Perhaps we can modify (2) to : Look for any builds from other contexts (ie. could be different distroseries in same archive, or different archive) that have binaries published .... (ie. that were copied from other archives or other distroseries).

Changed in soyuz:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Julian Edwards (julian-edwards) wrote :

This is a dupe of another bug, but I can't find it right now.

William Grant (wgrant)
tags: added: package-copies
William Grant (wgrant)
summary: - lp API not reporting copied packages
+ getBuildSummariesForSourceIds doesn't include copied builds
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.