distro_series.getSourcePackage behaves oddly

Bug #420230 reported by Brian Murray on 2009-08-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Low
Unassigned

Bug Description

When using the following commands with the Launchpad API I received back an object and I don't think I should have.

ubuntu = launchpad.distributions['ubuntu']
karmic = ubuntu.getSeries(name_or_version='karmic')
karmic.getSourcePackage(name='compiz-plugins')
<source_package at https://api.edge.launchpad.net/beta/ubuntu/karmic/+source/compiz-plugins>

However, compiz-plugins does not exist in Karmic - https://edge.launchpad.net/ubuntu/karmic/+source/compiz-plugins.

Related branches

tags: added: api
Curtis Hovey (sinzui) wrote :

This happens because the name can be matched to all distro series. This relates to bug 204119. If we choose not return the non-existent package, we need to verify this does not prevent uploaders adding packages.

affects: launchpad → launchpad-registry
Changed in launchpad-registry:
importance: Undecided → High
status: New → Triaged
tags: added: package-link
removed: api
Curtis Hovey (sinzui) on 2009-12-09
Changed in launchpad-registry:
milestone: none → series-3.1
Curtis Hovey (sinzui) on 2009-12-09
Changed in launchpad-registry:
milestone: series-3.1 → 3.1.12
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
Curtis Hovey (sinzui) on 2009-12-09
Changed in launchpad-registry:
milestone: 3.1.12 → series-3.1
status: In Progress → Triaged
assignee: Curtis Hovey (sinzui) → nobody
Curtis Hovey (sinzui) wrote :

I think we need to update the documentation. Since SourcePackage is a meta object representing names and publishing history, getSourcePackage does not guarantee that the package was published. The method is used to access the meta-information needed to publish a source package in a series, changing its behaviour will break initial publication.

We should add a optional kwarg (published_only=False) that guarantees that will ensure None is returned if there is no publishing history. This means that a deleted package will still be returned, as well as one that has not been built yet.

I am not sure the Launchpad would use this kwarg. For example if it was used, non-Ubuntu distros (which have no publishing history) will always raise a 404 when someone tries to navigate to the page. This may cause many 404s because users who report a package in Fedora for example are implicitly making a link to an unpublished package.

Changed in launchpad-registry:
importance: High → Low
Curtis Hovey (sinzui) on 2010-02-25
Changed in launchpad-registry:
status: Triaged → In Progress
assignee: nobody → Curtis Hovey (sinzui)
milestone: series-10.05 → 10.02
Curtis Hovey (sinzui) on 2010-02-26
Changed in launchpad-registry:
status: In Progress → Fix Committed
tags: added: qa-needstesting
Curtis Hovey (sinzui) on 2010-02-26
tags: added: qa-ok
removed: qa-needstesting

Fixed released in launchpad-project 10.02.

Changed in launchpad-registry:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui) on 2017-05-15
Changed in launchpad:
assignee: Curtis Hovey (sinzui) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers