Webservice
The Foundations team is responsible both for the infrastructure and for the overall quality of service of the Launchpad webservice.
Infrastructure
XXX: launchpadlib (lazr.restful, lazr.restfulclient, wadllib)
QA and Testing
We have gathered advice on how to test webservice-based applications based on our own experiences.
We need to QA some of the key launchpadlib applications before a release. Here are the instructions we have gathered for this so far.
Debugging
AJAX
You can explore in LP. Go to the front page, and open up Firebug, or similar. Try this:
client = new LP.client.Launchpad() var people = null; set_people = function(arg) { people=arg; } client.get("/people", {on: {success: set_people}}) // then look at people.entries[0], for instance, and look around some more
Page ids
If you have a pageid (say, from an OOPS report) and are trying to find the code to which it refers, here's how.
Let's say you have a pageid of MaloneApplication:CollectionResource:createBug. That's a pageid of a named operation call. The first part is the name of the class that implements the named operation, "MaloneApplication". It's a collection (the top level collection for the bugs application). "createBug" is the name of the exported method. Therefore, you can do something like this to find the pertinent code.
- Use class name to grep to find class.
- Maybe you are lucky and the name of the exposed method ("createBug") is the same as on the class. If so, yay, stop. Otherwise (and to be safe), see what interfaces it implements.
- Go through each of those interfaces to find out what has been exposed as the given name.
Yeah, that could be a lot nicer. But for now, it's what we have.
Additionally, for CollectionResource objects, the Entry resource that collection holds is also added to the page id to help during OOPS analysis. That way engineers can see at glance which kind of resource that OOPS is about and if the OOPS is related to their domain. For example, ScopedCollection:CollectionResource:#milestone-page-resource and ScopedCollection:CollectionResource:#bug_attachment-page-resource, which means the collection holds milestone objects and bug attachment objects respectively.
Open Bugs
We use the "api" tag. (A short version of the URL is http://tr.im/RAGU)
Infrastructure Bugs:
Versions
The Launchpad webservice is published in versions. We support released applications, such as apport, while continuing to improve our API in backwards incompatible ways. Versions will remain supported until the Ubuntu release that uses it becomes unsupported.
NOTE: We have the mechanism to have separate, frozen versions. We need to actually have tests showing that APIs supporting key applications do not change. We may need to get community help for this.
See this page for the available versions: https://edge.launchpad.net/+apidoc/
Performance improvements
This has its own page
Usability improvements
After working on performance, we want to focus on finding some key usability experience improvements.
XXX list pertinent bugs and other thoughts. Here's a start.
The len() operation on collections was recently improved.
534363 no easy way to call destructor
274074 Missing total_size on collections returned by named operations
481090 Cannot define a method that returns a dict
487522 named_get's do not support custom batches via slice
539070 Unhelpful error on badly declared API export
541637 Mutated items in launchpadlib search results iterator can break iteration
380504 Handle 502 Bad Gateway error automatically