Contributing to Launchpad

Ever wished there was just one feature you’d like to see enabled in Launchpad. Ever wondered when one of the bugs you have taken the time to report and document would be implemented.  Well how about we help you to get these bugs fixed.  Launchpad is a free and open source project, its platform is also open and developed in a transparent fashion. The source code for every feature, change and enhancement can be obtained and reviewed.

This means you can actively get involved in improving it and the community of Ubuntu platform developers is always interested in helping peers getting started. The Launchpad development team are continuously working on areas in Launchpad and other projects but there just isn’t enough time in the day to get every bug fixed, tested, deployed and out there.  What we’d like to help to do is encourage and help users get more involved. We would like to get more of the developer community involved in Launchpad, users who’ve never developed before to experienced hands on developers and show you how to get started. There is documentation written up, but we’re going to explain it a less scary way in  basic steps.

Getting Started

First things first, you need bzr. All of Launchpad’s branches use bzr for source control, so you’ll need to install it using apt-get:

 $ apt-get install bzr

Next, you need to create a space in which to do your development work. We’ll call it ~/launchpad, but you can put it pretty much anywhere you like on your system.

$ mkdir ~/launchpad

Because getting all the ducks in a row to make it possible to do Launchpad work takes a while, we’ve actually got a script that does all the legwork for you. It’s called rocketfuel-setup (see what we did there?) and once you’ve got bzr installed, you can

$ cd ~/launchpad
$ bzr --no-plugins cat http://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/utilities/rocketfuel-setup > rocketfuel-setup
$ chmod a+x rocketfuel-setup
$ ./rocketfuel-setup

You’ll be prompted for various details, such as your Launchpad username, and you’ll be asked for your password so that rocketfuel-setup can install all the packages that Launchpad needs. After this, you might as well go and have a sandwich, because downloading and building the source code will take at least 40 minutes on a first run.

Once rocketfuel-setup has completed on your machine, your ~launchpad directory will look something like this:

$ ls ~/launchpad/
lp-branches lp-sourcedeps rocketfuel-setup

The only directory you need to worry about in there for now is lp-branches. As the name suggests, this is where your Launchpad branches are stored.

Now that you’re all set up, it’s time to find a bug to fix and get some coding done!

Where to Begin

Now, it’s fair to say that there are plenty of bugs in Launchpad worth fixing. However, it’s even fairer to say that you don’t want to pick on of the Critical bugs as your first effort for Launchpad development, mostly because the Critical bugs are all fairly complex.

Luckily, the Launchpad team maintains a list of trivial bugs – the ones with simple, one-or-two line fixes that we just haven’t been able to get around to yet. You can find it here on Launchpad.

Once you’ve found a bug you want to fix, you need to create a branch for it. There are some utility scripts to make your life a bit easier here. In this case, rocketfuel-branch, which creates a new Launchpad branch from the devel branch that rocketfuel-setup created.

$ rocketfuel-branch my-branch-for-bug-12345

You’ll now find that branch in ~launchpad/lp-branches

$ ls ~/launchpad/lp-branches
devel my-branch-for-bug-12345
$ cd ~/launchpad/lp-branches/my-branch-for-bug-12345

Now that you’ve got a branch to work in, you can start hacking! Before you do, though, you should talk to someone in #launchpad-dev on Freenode about the problem you’re trying to solve. They will help you figure out how best to solve the problem and how best to write tests for your solution. We call this the “pre-implementation call” (though it can happen on IRC) and it’s very important, especially for first time contributors.

Once you’ve had your pre-imp call, you can get coding. Don’t forget that the people in #launchpad-dev are there to help you as you go. Don’t worry if you get stuck; Launchpad is a very large project and even seasoned developers get lost in the undergrowth from time to time. Thankfully, there’s a team of committed people who are able to wade in with machetes and rescue them. I’m going to stop this analogy now, since it’s starting to wither.

What to do once you’re written code

Once you’ve finished hacking on your branch, you need to get it reviewed. Launchpad has a feature that makes this really, really simple, called Merge Proposals. Here’s how it works.

First, commit your changes to your branch (you should have been doing this all along anyway, but just in case…) and push them to Launchpad:

$ bzr ci -m "Here are some changes that I made earlier, with a useful commit message."
$ bzr push
Using saved push location: lp:~yourname/launchpad/my-branch-for-bug-12345
Using default stacking branch /+branch-id/24637 at chroot-83246544:///~yourname/launchpad/
Created new stacked branch referring to /+branch-id/24637.

You can now view the branch on Launchpad by using the bzr lp-open command:

$ bzr lp-open
Opening https://code.launchpad.net/~yourname/launchpad/my-branch-for-bug-12345 in web browser

The page that will open in your browser contains a summary of the branch you’ve pushed, and will look something like this:

You can link it to the bug you’re fixing by clicking “Link a bug report”. If you’ve named your branch something like “foo-bug-12345”, Launchpad will guess that you want to link it to bug 12345 in order to save you some time.

From the branch summary page, you need to create a merge proposal. To do this, click “Propose for merging.” You’ll be presented with this page:

 

 

On this page, you’re going to explain what you’ve changed and why. There’s a template for what we refer to as the merge proposal cover letter on the Launchpad dev wiki.

Things you absolutely must include in your cover letter:

  • A summary of the problem.
  • A summary of your proposed solution.
  • Details of your solution’s implementation.
  • Instructions on how to test your solution and how to QA it.
Not all of the other items in the template will apply to your branch. If there’s any confusion, just ask for clarification in #launchpad-dev.
Once you’ve entered all your branch’s details in the “Description of change” field, click the “Propose merge”  button to create the merge proposal. Once you’ve done that, hop over to #launchpad-dev on Freenode and talk to the On-call reviewer (listed in the channel topic), who will review your branch for you and, once it’s ready, land it on the Launchpad mainline. If there’s no on-call reviewer listed you can find out who should be available for that day by taking a look at the reviewer schedule. If all else fails, a general call for a reviewer should net you a willing Launchpad developer, though you’ll have to wait for them to have time in their day to take a look at your branch.

Launchpad Clinic – UDS 

At UDS-Q we’re going to run two day with the help of Graham Binns who will be there to help with hands on set up and walk people through their bugs they would like to work on  and figure out where to start.  If you’re interested in taking part in these sessions, please add your name and the bug(s) you are interested in so we can review them ahead of time, there are many to chose from that are tagged with trivial if you want to start there.

We will have a EC2 instance set up of Launchpad to maxamise the time available to work on these areas.

8 Responses to “Contributing to Launchpad”

  1. Cruz Says:

    Hi,

    I have a moderately slow internet connection (takes about an hour and a half to download the Launchpad sources / trunk, will probably take about seven hours to upload) for the next few months.

    When I push a branch, am I pushing the whole branch history or just my own changes? I’d love to make some contributions, but if I have to push the whole branch history each time, I won’t be able to for a few more months.

    Thanks in advance,

    ~Cruz

  2. Colin Watson Says:

    @Cruz: The branch you pushed will be “stacked” on the main Launchpad development branch, so you’ll basically just be pushing your own changes.

  3. Cruz Says:

    Alright, thank you, Colin 🙂

  4. cagdas Says:

    It doesn’t work on 12.04. I cannot do ./rocketfuel-setup step. Could you update this post, please?

    [code]Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies.
    launchpad-developer-dependencies : Depends: launchpad-dependencies (= 0.111~precise1) but it is not going to be installed
    Depends: launchpad-messagequeue-dependencies (= 0.111~precise1) but it is not going to be installed
    Depends: launchpad-soyuz-dependencies (= 0.111~precise1) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    Unable to install launchpad-developer-dependencies.[/code]

  5. Cruz Says:

    Hi cagdas,

    I reported a bug about this at https://bugs.launchpad.net/launchpad/+bug/990191

    It seems to work okay on 11.10, but some of the packages aren’t available on 12.04. I’d try to fix it myself but I only have 400mb of bandwidth left for the next 10 days -.- Next month I’m on a bigger plan, so we’ll have to wait and see, I guess

    ~Cruz

  6. William Grant Says:

    It should work on 12.04 LTS now. Due to Python and RabbitMQ updates it worked on upgraded systems, but not fresh installs.

  7. Johnson Yi Says:

    It didn’t work on 14.04.1. After issue ./rocketfuel-setup step, I got the following errors:
    The following packages have unmet dependencies:
    launchpad-developer-dependencies : Depends: launchpad-dependencies (= 0.125~ubuntu14.04.1) but it is not going to be installed
    Depends: launchpad-database-dependencies (= 0.125~ubuntu14.04.1) but it is not going to be installed
    Depends: launchpad-messagequeue-dependencies (= 0.125~ubuntu14.04.1) but it is not going to be installed
    Depends: launchpad-soyuz-dependencies (= 0.125~ubuntu14.04.1) but it is not going to be installed
    Depends: exuberant-ctags but it is not installable
    Depends: pgbouncer-with-disconnect
    Depends: postgresql-autodoc but it is not going to be installed
    Depends: tidy but it is not installable
    Depends: python-codespeak-lib but it is not installable or
    python-py but it is not installable
    Depends: python-imaging (>= 1.1.7) but it is not installable
    Depends: fakeroot but it is not installable
    Depends: memcached but it is not installable
    Depends: xvfb but it is not installable
    Depends: firefox but it is not installable
    Depends: intltool but it is not installable
    Depends: python-html5-browser but it is not going to be installed
    Recommends: pyflakes but it is not installable
    Recommends: subunit but it is not installable
    Recommends: python-boto but it is not installable
    Recommends: bzr-lpreview-body but it is not going to be installed
    Recommends: postgresql-doc-9.3 but it is not installable
    E: Unable to correct problems, you have held broken packages.

  8. Johnson Yi Says:

    The error above was gone after update source.list as below:
    deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

Leave a Reply