LP_HostCode

Ubuntu Open Week - Hosting code with Launchpad - - Thu Oct 25th , 2007

18:09 < mwhudson> Good evening everyone!
18:09 < mwhudson> I'm Michael Hudson.  I've been working for Canonical for about six months now.
18:09 < mwhudson> I mostly work on Launchpad's code hosting services, and that's what I'm going to talk about today.
18:09 < mwhudson> Please post questions to #ubuntu-classroom-chat. I'll answer questions at the end of the session.
18:10 < mwhudson> Step 1 of code hosting is getting code onto Launchpad, and there are three ways you can do it:
18:10 < mwhudson> 1. You can host your Bazaar branches on Launchpad itself.
18:10 < mwhudson> 2. You can mirror your Bazaar branches from your own server to Launchpad.
18:10 < mwhudson> 3. You can have Launchpad maintain a Bazaar branch based on your SVN / CVS repository.
18:10 < mwhudson> There's a common theme here: Bazaar.
18:10 < mwhudson> I don't know how much you all know about Bazaar.
18:10 < mwhudson> Here's the important thing from Canonical/Launchpad's point of view:
18:11 -!- mode/#ubuntu-classroom [-v BjornT] by ChanServ
18:11 -!- mode/#ubuntu-classroom [+v mwhudson] by ChanServ
18:11 <+mwhudson> It's a *distributed* revision control system.
18:11 <+mwhudson> This means that anyone can take any branch and start hacking and make commits, give it to other people.
18:11 <+mwhudson> This means that anyone can take any branch and start hacking and make commits, give it to other people.
18:11 <+mwhudson> If you get a branch from someone, you can commit to their branch, revert their commits,
18:11 <+mwhudson> run 'log' and 'blame' and so on.
18:12 <+mwhudson> You don't even need internet access -- 'bzr branch' by default grabs the whole history of the branch.
18:12 <+mwhudson> Similarly, you can publish the complete branch -- and of course, people can copy that, and tailor it to their needs.
18:12 <+mwhudson> This is great for Free Software, because it radically lowers the barrier to entry.
18:12 <+mwhudson> You don't need to convince someone to give you the commit bit to be able to contribute meaningfully.
18:13 <+mwhudson> You can find out more about Bazaar in the open week session tomorrow at 19:00 UTC with Jelmer.
18:13 <+mwhudson> How do you publish your branch? Well, you can just upload it to Launchpad.
18:13 <+mwhudson> == 1. You can host your Bazaar branches on Launchpad. ==
18:13 <+mwhudson> I assume everyone has a Launchpad account?
18:13 <+mwhudson> If not, you really should get one now, before all the cool names are taken.
18:13 <+mwhudson> Got an account? Good
18:14 <+mwhudson> Once that's done, you'll need to upload a public SSH key.
18:14 <+mwhudson> You can make one of these using ssh-keygen, or whatever you do on Windows.
18:14 <+mwhudson> Once you've generated a key (or if you have one already), go to your Launchpad page
18:14 <+mwhudson> So, my Launchpad page is https://launchpad.net/~mwhudson.
18:14 <+mwhudson> There is a link in the Actions menu, on the left, labelled "Update SSH keys".
18:14 <+mwhudson> As a shortcut you can go to http://launchpad.net/people/+me/+editsshkeys
18:14 <+mwhudson> .
18:15 <+mwhudson> Once you're there, paste in your public key and click "Import Public Key".
18:15 <+mwhudson> Once that's done, you can push up a bzr branch.
18:15 <+mwhudson> Let's see how this can work:
18:15 <+mwhudson> mwh@grond:~$ cd ~/src/my-cool-project/
18:15 <+mwhudson> (this is my latest super cool project)
18:16 <+mwhudson> mwh@grond:my-cool-project$ bzr init .
18:16 <+mwhudson> (this creates an empty Bazaar branch in this directory)
18:16 <+mwhudson> mwh@grond:my-cool-project$ bzr add
18:16 <+mwhudson> added README.txt
18:16 <+mwhudson> added cool.py
18:16 <+mwhudson> (this adds the files of my project to the branch)
18:16 <+mwhudson> mwh@grond:my-cool-project$ bzr ci -m 'initial commit'
18:16 <+mwhudson> Committing revision 1 to "/home/mwh/src/my-cool-project/".
18:16 <+mwhudson> added README.txt
18:16 <+mwhudson> added cool.py
18:16 <+mwhudson> Committed revision 1.
18:17 <+mwhudson> (this created a revision containing the files i just added)
18:17 <+mwhudson> mwh@grond:my-cool-project$ bzr push bzr+ssh://bazaar.launchpad.net/~mwhudson/+junk/my-cool-project
18:17 <+mwhudson> Created new branch.
18:17 <+mwhudson> (this publishes the branch on launchpad)
18:17 <+mwhudson> You can see that bzr is a pretty lightweight tool here.
18:18 <+mwhudson> The '+junk' part of the URL means it's not part of a registered project
18:18 <+mwhudson> (I'll delete the branch some time after the meeting)
18:18 <+mwhudson> It takes Launchpad a couple of minutes to scan the branch,
18:18 <+mwhudson> but as I uploaded this one a couple of hours before the meeting we can see it here:
18:18 <+mwhudson> https://code.launchpad.net/~mwhudson/+junk/my-cool-project
18:18 <+mwhudson> I'll come back to this page after I've talked about other ways you can get code onto Launchpad.
18:18 < aprendix> Hi, folks!
18:18 <+mwhudson> == 2. Mirror your Bazaar branches from your own server to Launchpad. ==
18:19 <+mwhudson> If for some reason you don't want to upload your code to Launchpad
18:19 <+mwhudson> (maybe you want to host your code on a server on the same side of the world as you)
18:19 <+mwhudson> you can arrange for Launchpad to mirror your branch.
18:19 <+mwhudson> As well as providing you with a free backup, it helps people find your code
18:19 <+mwhudson> as Launchpad is the default place to hunt for Bazaar branches.
18:19 <+mwhudson> An example of a mirrored branch is the mainline branch for the Bazaar tool itself:
18:20 <+mwhudson> https://code.launchpad.net/~bzr/bzr/trunk
18:20 <+mwhudson> (this is not hosted directly on Launchpad because it uses PQM,
18:20 <+mwhudson> which is a very cool tool for making sure that the tests always pass before code makes it to mainline
18:20 <+mwhudson> -- but I'm drifting off-topic)
18:20 <+mwhudson> On this page you can see where the branch is mirrored from, when the branch was last mirrored and when it will next be mirrored.
18:20 <+mwhudson> == 3. You can have Launchpad maintain a Bazaar branch based on your SVN / CVS repository. ==
18:20 <+mwhudson> The last major way of hosting code on Launchpad is to have your code imported from another repository.
18:21 <+mwhudson> We already do this for a number of major projects.
18:21 <+mwhudson> One that is close to my heart is Python:
18:21 <+mwhudson> https://code.launchpad.net/~vcs-imports/python/trunk
18:21 <+mwhudson> The way this works is that once details are registered,
18:21 <+mwhudson> Launchpad will copy the history of the CVS or SVN repository into a Bazaar branch
18:22 <+mwhudson> and then several times a day will update the Bazaar branch from the foreign repository.
18:22 <+mwhudson> We have several hundred imports going currently, and more get added every week.
18:22 <+mwhudson> You can see the recent additions at https://code.launchpad.net/+recently-imported-branches.
18:22 <+mwhudson> The code of the import service is the open source CSCVS project:
18:22 <+mwhudson> https://launchpad.net/launchpad-cscvs
18:23 <+mwhudson> Please ask questions people, it feels like I'm talking to myself :)
18:23 -!- popey changed the topic of #ubuntu-classroom to: Ubuntu Open Week info: Information and Logs: https://wiki.ubuntu.com/UbuntuOpenWeek | Ubuntu classroom transcripts: https://wiki.ubuntu.com/ClassroomTranscripts | Please ask questions in #ubuntu-classroom-chat not here | Current Session: Hosting code with Launchpad - Michael Hudson
18:23 <@popey> (sorry)
18:23 <+mwhudson> So now we have some code on Launchpad.  What can we do with it?
18:23 <+mwhudson> The obvious thing is that we can get ourselves a copy of it.
18:24 <+mwhudson> Bazaar comes with a Launchpad plugin that makes getting the current development branch of any project a breeze.
18:25 <+mwhudson> For example, this is all it takes to get the development branch of my pydoctor documentation generator:
18:25 <+mwhudson> mwh@grond:~$ bzr get lp:///pydoctor
18:25 <+mwhudson> http://code.launchpad.net/pydoctor/ is redirected to https://code.launchpad.net/pydoctor/
18:25 <+mwhudson> Branched 516 revision(s).
18:25 <+mwhudson> mwh@grond:~$
18:25 <+mwhudson> If you want to get a specific branch, for example the branch I uploaded earlier
18:25 <+mwhudson> we go to its branch page: https://code.launchpad.net/~mwhudson/+junk/my-cool-project
18:26 <+mwhudson> On this page you can see instructions for how to download the branch
18:26 <+mwhudson> ("Example: bzr branch http://bazaar.launchpad.net/~mwhudson/+junk/my-cool-project").
18:26 <+mwhudson> You can also see the commit messages for the last few revisions of the branch.
18:26 <+mwhudson> This is a boring branch, the Bazaar project has some more interesting ones.
18:27 <+mwhudson> If we look at the mainline branch for bzr again:
18:27 <+mwhudson> https://code.launchpad.net/~bzr/bzr/trunk
18:27 <+mwhudson> We can look at the options.  "Browse code" and "Browse revisons" are links to codebrowse.
18:27 <+mwhudson> Codebrowse is Launchpad's online branch browsing service, it lets you browse through the revisions of a branch.
18:27 <+mwhudson> A bit like viewvc for CVS or Subversion.
18:27 <+mwhudson> Codebrowse actually runs GPLed software called Loggerhead, initially written by Robey Pointer.
18:28 <+mwhudson> I spend quite a bit of my work time maintaining it.
18:28 <+mwhudson> The version of the code we run is on Launchpad: https://code.launchpad.net/~mwhudson/loggerhead/production
18:28 <+mwhudson> (So you can use loggerhead to browse loggerhead... nicely recursive).
18:29 <+mwhudson> Returning to https://code.launchpad.net/~bzr/bzr/trunk...
18:29 <+mwhudson> You can subscribe to a branch, which means that you get email whenever the branch changes.
18:30 <+mwhudson> Branches can be associated to bugs they fix or blueprints they implement, and you can view these associations from this page.
18:30 <+mwhudson> You can also register merge proposals for a branch, which is a more advanced topic I'm not going to cover here.
18:30 <+mwhudson> These features are all things you get for free when you host your code on Launchpad.
18:31 <+mwhudson> so i've done what i usually do in real life
18:31 <+mwhudson> which is talk way too fast and finish early
18:31 <+mwhudson> so ask questions!
18:31 <+mwhudson> please :)
18:32 <+mwhudson> As there don't seem to be any questions
18:33 <+mwhudson> I can talk a little about the work we have planned on the code hosting side of launchpad
18:33 <+mwhudson> A subject that's close to my heart right now is making Loggerhead look a bit less like the web from 1999 :)
18:34 <+mwhudson> We're also working on a big rewrite of the code import system, which will make the UI much more sensible
18:34 <+mwhudson> (and fix various insanities in the backend you really really don't want to know about).
18:35 <+mwhudson> Pretty soon you'll be able to subscribe to the changes in a branch as an RSS or Atom feed.
18:35 <+mwhudson> ah, a question :)
18:35 <+mwhudson> <mzungu> QUESTION: So in your opinion, bazaar is the future of version control - and we should be moving over to bazaar - and launchpad ;)
18:36 <+mwhudson> I guess the short answer to this is "yes, probably" :)
18:36 <+mwhudson> I've only ever really used CVS, Subversion and Bazaar seriously, and of the three, Bazaar is by far the most pleasant to work with.
18:37 <+mwhudson> Compared to Mercurial, Git, Monotone, Darcs, ..., ..., I'm not so well informed.
18:38 <+mwhudson> AFAICT, Bazaar has more of a focus on the user interface than the other tools, and that seems like a good focus to me.
18:38 <+mwhudson> <imbrandon> QUESTION: what about removing branches / code from LP ?
18:38 <+mwhudson> As of just a month or two ago, you can delete your branches from Launchpad
18:38 <+mwhudson> So long as nothing else references them.
18:39 <+mwhudson> This means no subscribers, no bug-branch links, no merge proposals, that sort of thing.
18:40 <+mwhudson> <imbrandon> mwhudson, cool what about some intergration between brz hosting and the PPA , something similar to bzr-buildpackage to build directly from a branch to a PPA
18:40 <+mwhudson> Ah, now this is not something I'm very qualified to speak about.
18:41 <+mwhudson> Let me see if I can rope someone in.
18:41 < kiko> who?
18:41 <+mwhudson> ah, maybe you :)
18:41 <+mwhudson> kiko: can you think about an answer to this question?
18:41 < kiko> we want to do that, but there are a few little technical barriers to doing so.
18:42 < kiko> it's an awesome project and we have already planned for it
18:42 < kiko> so stay tuned
18:42 < imbrandon> ;)
18:42 <+mwhudson> <nemphis> QUESTION: is it possible to create branches on the launchpad webinterface? some time ago it didn't work (for me).
18:42 <+mwhudson> yes, it should be possible
18:44 <+mwhudson> you've always been able to create mirrored branches in the web ui, but a recent change means that you can create a hosted branch through the web too
18:44 <+mwhudson> of course you still need to push some content to it using bzr+ssh or sftp
18:45 <+mwhudson> Another large but exciting task we're working on is the ability to do code reviews in Launchpad.
18:45 <+mwhudson> Both Bazaar (another GPLed project) and Launchpad practice code reviews:
18:45 <+mwhudson> To get a branch merged into the mainline branch, it has to pass review from a core developer who did not write the code.
18:45 <+mwhudson> We want to support this workflow in Launchpad, where you upload a branch,
18:46 <+mwhudson> nominate the branch you want it to be merged into (this is the "merge proposal" concept I avoided talking about above)
18:46 <+mwhudson> and put it forward for review.
18:46 <+mwhudson> and put it forward for review.  A reviewer will then be able to view a diff between your branch and the mainline,
18:46 <+mwhudson> comment on it and approve or decline it.
18:47 <+mwhudson> We even plan to support PQM-style robots
18:47 <+mwhudson> that run the test suite before allowing a branch to be merged.
18:47 <+mwhudson> But all this is a few months off.
18:47 <+mwhudson> <evarlast> QUESTION: tortoiseSVN on windows is AWESOME! Is there work on TortoiseBZR on Windows and something equivelent for Nautilus?
18:48 <+mwhudson> There was a Google Summer of Code project to work on TortoiseBZR
18:48 <+mwhudson> I don't really know how far it got.
18:48 <+mwhudson> I haven't used a Windows box for more than using putty to ssh somewhere else for at least 5 years.
18:49 <+mwhudson> Seriously the wrong person to ask :)
18:49 <+mwhudson> I'm similarly clueless about nautilus though.
18:49 <+mwhudson> <evarlast> QUESTION: ViewVC really makes browsing CVS and SVN via the web excellent. Is there anything equivalent for bzr?
18:49 <+mwhudson> yes, the loggerhead project i talked about earlier
18:50 <+mwhudson> for example: http://codebrowse.launchpad.net/~bzr/bzr/trunk/changes
18:50 <+mwhudson> working on this is actually part of my job
18:50 <+mwhudson> so if it doesn't fit your needs, then please file bugs and tell me about it :)
18:50 <+mwhudson> (feel free to ask Bazaar questions too, by the way)
18:51 <+mwhudson> <imbrandon> QUESTION: what about a codebrowser webui thats not part of LP, like when i host branches on my own server
18:51 <+mwhudson> loggerhead is a separate project, you can install it on your own server just fine
18:51 <+mwhudson> (it's a turbogears application)
18:52 <+mwhudson> but you can just get launchpad to mirror your branches, then it's me who has to worry about running it :)
18:53 <+mwhudson> any more questions?
18:55 <+mwhudson> well, if there aren't then i guess i'll wrap up a bit early
18:55 <+mwhudson> thank you all for listening!
18:55 < sommer> thank you
18:55 <+mwhudson> stick around for Launchpad Q&A with kiko
18:55 < mrevell> thanks mwhudson
18:55 < sommer> interesting stuff
18:55 < imbrandon> thanks mwhudson

MeetingLogs/openweekgutsy/LP_HostCode (last edited 2008-08-06 17:00:19 by localhost)