lpbazaar

Ubuntu Open Week - Hosting code with Launchpad and Bazaar - Jono Lange - Tue, Apr 24, 2007

TZ UTC-4

(04:00:39 PM) ddaa: So, jml is going to tell you about launchpad code hosting
(04:00:53 PM) jml: right!
(04:00:55 PM) ddaa: I'm just here to take credit, but he's the guy doing most of the work nowadays.
(04:00:56 PM) robotangel: yep
(04:01:02 PM) robotangel: Text Topic: "Hosting code with Launchpad and Bazaar - Jono Lange" ;)
(04:01:07 PM) heikki: yea, thanks pitti, nice and useful session
(04:01:27 PM) jml: except ddaa has graciously volunteered to answer all of the really tricky questions ;)
(04:01:41 PM) jml: Good morning everyone!
(04:01:53 PM) robotangel: well, let's be quiet now, I think somerone's here is willing to start ;)
(04:02:16 PM) jml: My name is Jonathan Lange. I work at Canonical, where I hack on Launchpad's code hosting services w/ ddaa and others.
(04:02:43 PM) jml: There are three ways you can get code for your project on to Launchpad.
(04:03:02 PM) jml: 1. You can host your Bazaar branches on Launchpad itself.
(04:03:09 PM) jml: 2. You can mirror your Bazaar branches from your own webserver to Launchpad.
(04:03:30 PM) jml: 3. You can have Launchpad maintain a Bazaar branch based on your SVN / CVS repository.
(04:03:49 PM) jml: So, uhh, you may have noticed something of a pattern here
(04:04:10 PM) jml: (hint: Bazaar)
(04:04:30 PM) jml: We use Bazaar for doing all of our code-hosting stuff
(04:04:52 PM) jml: poolie put it really well the other day, "Bazaar is the way that launchpad thinks about code".
(04:05:19 PM) jml: I don't know how much you all know about bzr.
(04:05:24 PM) jml: Here's the important thing: it's a *distributed* revision control system.
(04:05:45 PM) jml: That means that anyone can make a branch and start hacking with all of the super-powers that you get with using version control.
(04:06:00 PM) jml: You can commit to their branch, revert their commits, run 'log' and 'blame'
(04:06:19 PM) jml: all without touching the internet or talking to a central repository. everything is in your local checkout
(04:06:23 PM) jml: (except don't call it a checkout)
(04:07:01 PM) jml: More interestingly for us, using bazaar means you can publish your code in full and independently
(04:07:20 PM) jml: and people can branch off _that_ and make their own branches and publish those.
(04:07:47 PM) jml: This is great for Free Software, because it radically lowers the barrier to
(04:07:52 PM) jml: entry.
(04:08:22 PM) jml: Instead of attaching fiddly little patches to tickets on a bug tracker, you can just publish your branch.
(04:08:54 PM) jml: How do you publish your branch? Well, you can just upload it to Launchpad.
(04:09:28 PM) ddaa: (note: you can attach a "bundle" on a bug tracker, which is like a patch, with version control data added)
(04:09:44 PM) jml: right.
(04:09:53 PM) ddaa: go on, I do not mean to sidetrack
(04:09:58 PM) jml: but say you want to do something cooler than attaching a bundle, something like...
(04:10:03 PM) jml: == 1. You can host your Bazaar branches on Launchpad. ==
(04:10:22 PM) jml: I assume everyone has a Launchpad account?
(04:10:42 PM) jml: If not, you really should get one now, before all the cool names are taken.
(04:11:04 PM) jml: Got an account? Good
(04:11:18 PM) jml: Once that's done, you'll need to upload a public SSH key.
(04:11:29 PM) jml: You can make one of these using ssh-keygen
(04:11:47 PM) jml: or puttygen.exe I guess
(04:12:27 PM) jml: Once you've generated a key (or if you have one already), go to your Launchpad page
(04:12:28 PM) ddaa: jml is starting to get anxious that nobody is listening. Anybody listening please send him a message on #ubuntu-classroom-chat
(04:12:37 PM) ddaa: that will make him feel much better
(04:13:12 PM) jml: so, my Launchpad page is https://launchpad.net/~jml
(04:13:36 PM) jml: There is a link in the Actions menu, on the left, labelled "Update SSH keys".
(04:13:51 PM) jml: Go there and submit your public key
(04:13:59 PM) jml: (not your private one!)
(04:14:33 PM) jml: Once that's done, you can push up a bzr branch.
(04:14:49 PM) jml: Time for some screenshots!
(04:15:04 PM) jml: jml@rhino:~$ cd ~/Code/Scratch/d20-chargen/
(04:15:42 PM) jml: jml@rhino:~/Code/Scratch/d20-chargen$ bzr push sftp://bazaar.launchpad.net/~jml/+junk/d20-chargen
(04:16:10 PM) jml: that's sftp://bazaar.launchpad.net/~<username>/<project>/<branch_name>
(04:16:44 PM) jml: That'll push d20-chargen (a branch I made for this session) up to Launchpad
(04:16:56 PM) jml: '+junk' means it's not part of a registered project
(04:17:22 PM) jml: it's just a branch I want to put up on Launchpad.
(04:17:34 PM) jml: It'll take Launchpad about 2-3 minutes to scan the branch after it's been pushed.
(04:17:51 PM) jml: This time last year, it used to take about 24 hours.
(04:18:00 PM) jml: At least, I seem to remember it did. ddaa?
(04:18:10 PM) jml: Anyway, we still want to make it faster though :)
(04:18:11 PM) ddaa: Yes, for the initial upload
(04:18:27 PM) ddaa: subsequent updates were detected faster than that

<robotangel> QUESTION: Is it a bit similar to GIT or did I miss something (or understood something totally wrong)?

  • I honestly don't know very much about GIT. I think Bazaar has similarities.

    <ddaa> git is similar to bzr. came later too

(04:20:57 PM) jml: Anyway, by now, the branch is available to the world: https://code.launchpad.net/~jml/+junk/d20-chargen
(04:21:06 PM) jml: (although actually I prepared this one before the show)
(04:21:20 PM) jml: The page provides a URL that other bzr users can use to get the branch.
(04:21:31 PM) jml: "Hosted on Launchpad:        http://bazaar.launchpad.net/~jml/+junk/d20-chargen"
(04:21:53 PM) jml: so, if you wanted to right now, you could branch from that URL and start hacking on a D&D character generator
(04:22:02 PM) jml: Also, check out the 'Browse code' on the left.
(04:22:05 PM) jml: this is cool
(04:22:30 PM) jml: the code browsing feature is a really handy way to quickly look at code that's on Launchpad.
(04:23:01 PM) jml: So, if you don't want to actually use Launchpad to host your branches, you can always...
(04:23:10 PM) jml: == 2. Mirror your Bazaar branches from your own webserver to Launchpad. ==
(04:23:33 PM) jml: Actually I think the "web" bit is unnecessary
(04:23:53 PM) jml: maybe you've got your own domain name and you want people to download branches from http://awesomeo.net/code/some-branch.
(04:24:04 PM) jml: It's still a good idea to mirror branches to Launchpad.
(04:24:24 PM) jml: If practically every project has a branch on Launchpad, then it becomes easy for potential contributors to start hacking on a project.
(04:24:59 PM) jml: to find the code, you go to the Launchpad page, click on "Code", and find the right branch.
(04:25:06 PM) jml: OR
(04:25:16 PM) jml: you just type 'bzr branch lp:///<project>'.
(04:25:28 PM) jml: Try it with 'subunit'.
(04:25:33 PM) jml: $ bzr branch lp:///subunit
(04:25:52 PM) jml: See this as the upstream equivalent of 'aptitude install <package>'.
(04:26:29 PM) jml: And if that's doesn't convince you to mirror your code to Launchpad,
(04:26:35 PM) jml: well, you could always think of the mirroring as free backups
(04:26:48 PM) jml: So here's how you do it:
(04:26:52 PM) jml: On your Launchpad page, or on any project page, click on the "Code" tab.
(04:27:00 PM) jml: There'll be an action on the left called "Register branch".
(04:27:06 PM) jml: Provide the URL of the branch, a unique name and some optional description.
(04:27:20 PM) jml: Hit register and Launchpad should mirror the branch soon.
(04:27:39 PM) jml: and while you're waiting for Launchpad to mirror the repository, you might want to take a look at...
(04:27:46 PM) jml: https://code.launchpad.net/+project-cloud
(04:27:55 PM) jml: Bigger means 'more branches', brighter means 'more active'.
(04:28:06 PM) jml: (we are so web 2.0 it hurts)
(04:28:41 PM) jml: So, maybe your project isn't lucky enough to use Bazaar
(04:28:56 PM) jml: == 3. You can have Launchpad maintain a Bazaar branch based on your SVN / CVS repository. ==
(04:29:11 PM) jml: The last major way of hosting code on Launchpad is to have your code imported from another repository.
(04:29:23 PM) jml: We already do this for a number of major projects.
(04:29:46 PM) jml: one of my favourites...
(04:29:51 PM) jml: https://code.launchpad.net/~vcs-imports/python/trunk
(04:30:13 PM) jml: You can even browse code from there
(04:30:50 PM) jml: The cool thing about this is that it gives you a consistent way to start hacking on code.
(04:30:57 PM) allee: jml: no python commits for 4 days?
(04:31:23 PM) ddaa: gah, import is failing
(04:31:24 PM) ***jml holds an "Ask me import questions" sign over ddaa's head
(04:31:36 PM) ddaa: I'm the one making imports work

<kkas1> QUESTION: So would you maintain the code in SVN. And then push updates up to Bazaar?

  • No. Launchpad tracks your SVN repository and imports updates from there. Having an import for a project means that it's a no-brainer for others to get started on it. again, they can just go 'bzr branch lp:///<project>' Of course, eventually they'll want access to the official repo. For various reasons, getting your project imported from a CVS or SVN repository is more complicated than simply mirroring a Bazaar branch. https://help.launchpad.net/VcsImports has a guide on how to go about doing it.

(04:35:33 PM) jml: Oh, tangent time
(04:35:43 PM) jml: there's a link to that page from https://code.launchpad.net
(04:36:15 PM) jml: I was talking to a friend who does a bit of packaging, and he didn't know about that page.
(04:36:40 PM) jml: it's kind of cool in that it shows recent movements on the code front
(04:36:51 PM) jml: tangent over
(04:37:14 PM) jml: In essence, to register a project for getting imported, first make sure we can import it sanely
(04:37:23 PM) jml: then use Launchpad Answers to ask a question about getting it activated.

QUESTION: is a project has a svn imported in bazaar, can i commit to the original svn thru launchpad via bazaar ? or is it only 'one way' ?

  • If you are using the Bazaar branch that Launchpad has made, then it's one way. There's a neat tool called bzr-svn which lets you do two-way stuff, but Launchpad doesn't use that.

QUESTION: Do I need to be one of the official "owners" of a project to register an SVN branch on vcs-imports? Or can I register a branch for a project I want to track but whose "official" maintainers don't use bzr or know about Launchpad?

  • That's a really good question Smile :) yes. that's the answer

    <rmunn> Yes, you need to be an owner? Or yes, you can register a branch for any project? Makes a difference... Smile :-) (answered in -chat)

(04:42:01 PM) jml: So, that's about it from me. Some suggestions where to go from here...
(04:42:54 PM) jml: <ddaa> people are welcome and encouraged to register projects on behalf of upstream
(04:43:12 PM) jml: that's one suggestion :)
(04:43:16 PM) jml: - poolie is running another session on Bazaar tomorrow at the same time as this session (UTC 20:00)
(04:43:54 PM) allee: jml: Is there a page about bzr and pkg management?
(04:44:00 PM) jml: - If you've got more questions, ask them here or join us on #launchpad or the launchpad-users mailing list
(04:44:55 PM) jml: allee: there's wiki.ubuntu.com/NoMoreSourcePackages
(04:44:59 PM) jml: but apart from that, I don't know.
(04:45:30 PM) jml: I've been using Debian/Ubuntu for about 9 years now and still don't know anything about package management :\
(04:45:46 PM) jml: which is why...
(04:46:03 PM) allee: :)
(04:46:22 PM) jml: - You should hang out on #launchpad anyway. We like users, and I get to learn things when you want a feature for something like package management :)
(04:46:56 PM) jml: So go and write lots of code and upload it to Launchpad. :)
(04:47:25 PM) jml: That's it.

balrok: QUESTION:can you tell me some advantages and disadvantages of bazaar compared to svn?

  • To quote poolie "The pros: no need for a central server, can commit and do other work while disconnected, much better merge tracking and smarter merging. The cons: mostly that it's a younger system, so somewhat less polished, less tools integration, etc. But we plan to go 1.0 in a few months, and there is some work towards gnome, eclipse and visual studio integration"

    <ryanakca> might be something in http://bazaar-vcs.org/BzrForSVNUsers

    <balrok> thank you both.. this sounds very good.. i actually opened my project on lp too =)

(04:54:01 PM) jml: For this session, school is out.

MeetingLogs/openweekfeisty/lpbazaar (last edited 2008-08-06 16:15:55 by localhost)