Export source_package_name and source_package_version on BPPH

Bug #1856774 reported by Colin Watson on 2019-12-17
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself

Bug Description

I recently added and exported build.source_package_version to work around cases where bpph.build.getLatestSourcePublication() doesn't work due to privacy restrictions. But there are cases where even this doesn't quite work, and ddeb-retriever ran into one of them today:

ERROR: Failed to get source package name for https://api.launchpad.net/devel/ubuntu/+archive/primary/+binarypub/135331352
Traceback (most recent call last):
  File "/srv/ddebs.ubuntu.com/ddeb-retriever/ddeb_retriever.py", line 90, in install_from_librarian
    source_name = pub.build.source_package_name
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 734, in __getattr__
    return super(Entry, self).__getattr__(name)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 355, in __getattr__
    return self.lp_get_parameter(attr)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 239, in lp_get_parameter
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 381, in _ensure_representation
    representation = self._root._browser.get(self._wadl_resource)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 436, in get
    response, content = self._request(url, extra_headers=headers)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 375, in _request
    raise ValueError("You tried to access a resource that you "
ValueError: You tried to access a resource that you don't have the server-side permission to see.

In this case, the PPA where the package was originally built is owned by a private team. (It's surprising that we haven't run into this before.)

I think the simplest way to make this sort of thing work would be to export source_package_name and source_package_version on BPPH directly, and then ddeb-retriever won't need to indirect through the build. This would be convenient anyway.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers