Comment 2 for bug 2003950

Revision history for this message
Jelmer Vernooij (jelmer) wrote (last edit ):

This looks like a bug in the Launchpad API (the new one, which we migrated to in 3.3):

% lp-shell production devel
>>> lp.branches.getByPath(path="ubuntu-test-cases/server/testsuites/default/")
<branch at https://api.launchpad.net/devel/~ubuntu-server-qa/ubuntu-test-cases/server-tests-raring>

This basically just uses the part of the path it can resolve, and it ignores the rest. This prevents proper resolution on the Breezy side, because we don't know how much of the path it has consumed.

(you could argue that this is intended behaviour, but the docs don't mention it and it seems undesirable)

I think we have a couple of options:

1. wait for a fix on the Launchpad side (unlikely to happen soon)

2. go back to the old API (don't really want to do that, it added a lot of Launchpad specific code and would be time consuming)

3. drop expansion with the API and simply translate lp: to ://code.launchpad.net/

Perhaps https://code.launchpad.net/ or bzr+ssh://bazaar.launchpad.net depending on whether the user has logged in. Will break certain things like use of "~" in lp: URLs, but would fix this bug. Would also be a performance win as we get to avoid a HTTPS connection setup and API call.