Comment 13 for bug 609187

Revision history for this message
Max Bowsher (maxb) wrote :

The conclusion of that work was that it is entirely possible to hit the Launchpad web service manually, rather than using launchpadlib, so that you have absolute control of the number of roundtrips.

The caveats involved are:

1) Because of bug 714038, it is necessary to submit an OAuth Authorization header even though it should not be. However, a simple fixed header value works fine:

Authorization: OAuth realm="", oauth_consumer_key="something", oauth_signature_method="PLAINTEXT", oauth_version="1.0", oauth_token="", oauth_signature="%26"

2) It is necessary to be aware of lazr.restful's data type marshalling - basically, data is represented as if it were fragments of JSON, which means string parameters need quotes around them.

3) If calling a method that returns a collection that might possibly ever have more than a few items, you need to care about collection pagination.

With that in mind, we can get it down to just 1 roundtrip for looking up the currently published source version in a named distroseries, and 2 roundtrips for the same in the implicit development focus distroseries case. (Or we could just call Archive#getPublishedSources without a distroseries limit, and pick the latest, to keep that down to 1 roundtrip too)