Diff for "Foundations/Webservice"

Not logged in - Log In / Register

Differences between revisions 2 and 18 (spanning 16 versions)
Revision 2 as of 2010-03-12 17:36:04
Size: 1756
Editor: gary
Comment:
Revision 18 as of 2010-09-08 17:03:22
Size: 5296
Editor: gary
Comment:
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
== QA ==

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.

Line 11: Line 46:
We use the "api" tag. [[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]]
Line 13: Line 48:
See http://tr.im/RAGU 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]])
Line 21: Line 62:
The following describes the available versions, and what versions of Ubuntu it supports. See this page for the available versions: https://edge.launchpad.net/+apidoc/
Line 23: Line 64:
|| ''version'' || ''Ubuntu'' || ''Comments'' ||
|| beta || Karmic, Jaunty || Despite the name, "beta" is frozen. ||
|| 1.0 || Lucid (Leonard, confirm?) || The change to 1.0 is just a small clean-up: mutator methods, that were not really intended to be part of the API, are now hidden. Applications using beta should be able to use 1.0 with no changes. ||
|| devel || '''UBUNTU SHOULD NEVER USE''' || This is the ever-changing development version, like trunk. Launchpad's own Javascript usage tracks this. ||
== Performance improvements ==
Line 28: Line 66:
1.0 is very slightly cleaned up version of the long-standing "beta" service (which, despite its name, is now also frozen, because released applications depend on it). Versions will remain supported until the Ubuntu release that uses it becomes unsupported. Launchpad's own Javascript usage will track the API development version, named "devel". 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

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

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

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 milestone objects and bug attachment objects respectively.

Open Bugs

Webservice 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

Foundations/Webservice (last edited 2010-11-02 00:52:18 by gary)