= 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 [[/TestingApiApplications|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. [[/apport|apport]] == 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. 1. Use class name to grep to find class. 2. 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. 3. 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 [[https://launchpad.net/+apidoc/1.0.html#milestone|milestone]] objects and [[https://launchpad.net/+apidoc/1.0.html#bug_attachment|bug attachment]] objects respectively. == Open Bugs == [[https://bugs.edge.launchpad.net/launchpad-project/+bugs?field.searchtext=&orderby=-importance&search=Search&field.status%3Alist=NEW&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INPROGRESS&assignee_option=any&field.assignee=&field.bug_reporter=&field.bug_supervisor=&field.bug_commenter=&field.subscriber=&field.tag=api&field.tags_combinator=ANY&field.has_cve.used=&field.omit_dupes.used=&field.omit_dupes=on&field.affects_me.used=&field.has_patch.used=&field.has_branches.used=&field.has_branches=on&field.has_no_branches.used=&field.has_no_branches=on|Webservice Bugs]] We use the "api" tag. (A short version of the URL is http://tr.im/RAGU) Infrastructure Bugs: * [[https://bugs.edge.launchpad.net/launchpadlib/+bugs|launchpadlib]] ([[https://bugs.edge.launchpad.net/launchpadlib/+bugs?search=Search&field.status=New|Not Triaged]]) * [[https://bugs.edge.launchpad.net/lazr.restfulclient/+bugs|lazr.restfulclient]] ([[https://bugs.edge.launchpad.net/lazr.restfulclient/+bugs?search=Search&field.status=New|Not Triaged]]) * [[https://bugs.edge.launchpad.net/lazr.restful/+bugs|lazr.restful]] ([[https://bugs.edge.launchpad.net/lazr.restful/+bugs?search=Search&field.status=New|Not Triaged]]) * [[https://bugs.edge.launchpad.net/wadllib/+bugs|wadllib]] ([[https://bugs.edge.launchpad.net/wadllib/+bugs?search=Search&field.status=New|Not Triaged]]) == 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 [[Foundations/Webservice/Performance|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. [[Foundations/Webservice/Performance/CollectionLength|The len() operation on collections was recently improved.]] Bug:534363 no easy way to call destructor Bug:274074 Missing total_size on collections returned by named operations Bug:481090 Cannot define a method that returns a dict Bug:487522 named_get's do not support custom batches via slice Bug:539070 Unhelpful error on badly declared API export Bug:541637 Mutated items in launchpadlib search results iterator can break iteration Bug:380504 Handle 502 Bad Gateway error automatically