Launchpad plugin for Eclipse – using the Launchpad API

Guillermo Gonzalez – the man behind the bzr-eclipse plugin – has recently been working with the Launchpad API to produce an Eclipse plugin that integrates with Launchpad.

That seemed like a pretty cool use of the API so I emailed him to find out more.

Matthew: What does your plugin do?

Guillermo: The user visible plugin allow the user to search the branches of a project. Basically it’s a view with a search field. This is going to become part of bzr-eclipse, as an extension, to allow searching for branches and branching into a new project directly from one of the results.

But actually it’s a set of plugins 😉

The heart of it is the launchpadlib plugin, it abstracts common features needed by others plugins that need to interact with launchpad, at this moment it provides authentication and access to projects and bugs.

Eclipse showing a list of branches hosted by Launchpad

Matthew: How are you accessing the API? Directly or using the Python library?

Guillermo: The first approach was to use the API via Java (and a java implementation of wadl), but as I was reinventing the wheel, I started to look on how to use launchpadlib from java. I’m currently using launchpadlib with an alpha version of Jython-2.5 and some extra patches/libraries missing in Jython and required by launchpadlib.

Matthew: Could you have done this without the Launchpad API?

Guillermo: Doing something like this never crossed my mind before knowning of the API and launchpadlib. Such a task would require screen scraping and all sorts of hacks to get things working … until something in the UI changes, and makes it useless. Also that would increase the load on Launchpad itself and maybe affect other users.

Matthew: How did you find both learning and using the API?

Guillermo: The API is straightforward to learn, also if you can use launchpadlib it’s far easier, just start the python interactive interpreter, import launchpadlib and start prototyping your app 🙂

Matthew: What do you like best about the API?

Guillermo: From my point of view the most important aspects are:

  • it’s based on standards (wadl, http)
  • there is a reference implementation in python (python is awesome to learn how things works)
  • it’s well documented, and if you can’t find what you want it’s easy to check if it’s possible using launchpadlib and python interactive interpreter.

Matthew: What’s the worst thing about the API?

Guillermo: I don’t think there is a “worst thing”, the API is evolving quite well.

I’m pretty sure (and know that by experience), that if there is a missing feature that it’s required by a user, the ~launchpadlib-developers team would try to fix it. Obviously, it will require the proper bug report/feature request 😉

Matthew: What would you like to see changed or improved?

Guillermo: Back when I started to work on these plugins, there was no support for the code hosting bit, nor the possibility to search the bugs assigned on a specific project, but after reporting the issues the ~launchpadlib-developers team fixed them.

For more about Guillermo’s Launchpad plugin for Eclipse, see the bzr-eclipse project in Launchpad.

7 Responses to “Launchpad plugin for Eclipse – using the Launchpad API”

  1. Alex Says:

    The next step is a Mylyn connector for Launchpad ?

  2. Egon Willighagen Says:

    Yes, integration with Mylyn would be perfect.

  3. Frank Wierzbicki Says:

    “”” using launchpadlib with an alpha version of Jython-2.5 and some extra patches/libraries missing in Jython and required by launchpadlib. “””
    Are these extra patches/libraries interesting enough to contribute back to Jython? If so, we’d love to take over the maintenance! If you’d like upload patches at http://bugs.jython.org. Thanks!

  4. Guillermo Says:

    Alex,
    I’m pretty sure it is 🙂
    I already have some prototypes worked out, I can connect to launchpad and create a Task List but it’s a quick hack ontop of the launchpadlib-plugin.
    Also, there is a lot of work left to be done on the launchpadlib-plugin to make it robust enough so other plugins can be built on top of it.

    Regards,

  5. Guillermo Says:

    Hi Frank,
    Actually the libraries required by launchpadlib are available in the wild, I just put them together in a OSGI bundle and added them to the Jython path.
    the added libraries are:
    * elementree
    * httplib2

    the only patch needed is a hack-ish fix to httplib2, it try to use .encode(‘idna’) and it’s not available in Jython (at least it wasn’t at the time I tried to use it).

    Cheers!

    P.S: I tried to fix the idna issue in jython but it requires unicodedata and it wasn’t part f jython at that time, I’ll check the latest trunk.

  6. Frank Wierzbicki Says:

    We still lack idna, and we are looking at including elementree but haven’t done it yet. Thanks for responding!

  7. Launchpad Blog Says:

    […] bzr-eclipse, a Bazaar plugin for Eclipse, that talks to the Launchpad/Bazaar integration using launchpadlib. The developer says: “The API is straightforward to learn, also if you can use launchpadlib it’s far easier, just start the python interactive interpreter, import launchpadlib and start prototyping your app :)” […]

Leave a Reply