Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] Fwd: Distributed RCS

Guido van Rossumgvanrossum at gmail.com
Sun Aug 14 02:11:05 CEST 2005


Another fwd, describing how Steve Alexander's group user bazaar.--Guido van Rossum (home page:http://www.python.org/~guido/)---------- Forwarded message ----------From: Steve Alexander <steve at canonical.com>Date: Aug 12, 2005 4:00 PMSubject: Re: Distributed RCSTo: Guido van Rossum <gvanrossum at gmail.com>Cc: Mark Shuttleworth <mark at canonical.com>, Martin Pool<mbp at canonical.com>, Fredrik Lundh <fredrik at pythonware.com>Hi Guido,I'm not going to post to python-dev just now, because I'm leaving on 1.5weeks vacation tomorrow, and I'd rather be absent than unable to answerquestions promptly.Martin Pool will be around next week, and will be able to take part indiscussions on the list.Feel free to post all or part of Mark's or my emails to the python lists.Mark wrote:>> I hope that puts bazaar into perspective for you. Give it a spin - the> development 2.x codebase is robust enough now to handle a line of> development and do basic merging, we are switching our own development> to the pre-release 2.x line in October, and we will switch over all the> public archives we maintain in around March next year.A large part of the internal development at Canonical is the Launchpadsystem.  This is about 30-40 kloc of Python code, including variousTwisted services, cron scripts, a Zope 3 web application, databasetools, ...It's being worked on by 20 software developers.  Everyone uses bazaar1.4 or 1.5, and around October, we'll be switching to use bazaar 2.x.I'll describe how we work on Launchpad using Bazaar.  This is all fromthe Bazaar 1.x perspective, and some things will become simpler when wechange to using Bazaar 2.x.I've left the description quite long, as I hope it will give you some ofthe flavour of working with a distributed RCS.== Two modes of working: shared branches and PQM ==Bazaar supports two different modes of working for a group like theLaunchpad team.1. There's a shared read/write place that all the developers have accessto.  This is contains the branches we release from, and represents the"trunk" of the codebase.2. A "virtual person" called the "patch queue manager" (PQM) hasexclusive write access to a collection of branches.  PQM takesinstructions as GPG signed emails from launchpad developers, to mergetheir code into PQM's branches.We use the latter mode because we have PQM configured not only to acceptrequests to merge code into PQM's codebase, but to run all the testsfirst and refuse to merge if any test fails.== The typical flow of work on Launchpad ==Say I want to work on some new feature for Launchpad.  What do I do?1. I use 'baz switch' to change my working tree from whatever I wasworking on last, and make it become PQM's latest code.  baz switchrocketfuel at canonical.com/launchpad--devel--0 "rocketfuel" is the code-name for the branches we release our code from.  PQM manages the rocketfuel branches.  In Bazaar 1.x, collections of branches are called "archives" and are identified by an email address plus some other optional information. So, "rocketfuel at canonical.com" is PQM's email address. "launchpad--devel--0" is simply the name of the main launchpad branch.  The format of branch names is very strict in Bazaar 1.x. It is much more open in Bazaar 2.x.2. I use 'baz branch' to create my own branch of this code that I cancommit changes to.  baz branchsteve.alexander at canonical.com/launchpad--ImproveLogins--0 My archive is called "steve.alexander at canonical.com".  The branch will be used to work on the login functionality of Launchpad, so I have named the branch "launchpad--ImproveLogins--0".3. I hack on the code, and from time to time commit my changes.  I needto 'baz add' new files and directories, and 'baz rm' to remove files,and 'baz mv' to move files around.  # hack hack hack  baz commit -s "Refactored the whatever.py module."  # hack hack hack  baz del whatever_deprecated.py  baz commit -s "Removed deprecated whatevers."  # hack hack hack4. Let's say I hacked on some stuff, but I didn't commit it.  I don'tlike what I did, and I want to start again.  # hack hack hack  baz undo 'baz undo' puts the source code back into the state it was in after thelast commit, and puts the changes somewhere.  If I change my mind again,I can say 'baz redo', and get my changes back.5. All this hacking and committing has been happening on my ownworkstation, without a connection to the internet.  Perhaps I've been ona plane or at a cafe.  When I have a connection again, I can make mywork available for others to see by mirroring my code to a centrallocation.  Each Launchpad developer has a mirror of the archive they usefor Launchpad work on a central machine at the Canonical data centre.In our case, the mirror command uses sftp to copy the latest changes Ihave made into the mirror on this central server.  baz archive-mirror6. Because we have a strict code review proccess for Launchpaddevelopment, I can't (or rather, shouldn't) submit my changes to PQMyet.  I should get it reviewed.  But, let's say Andrew wants to do somework that depends on my work, before my work has made its way into PQM'srocketfuel "Trunk".  He can simply merge from me.  # in Andrew's working tree, on his workstation.  baz mergesteve.alexander at canonical.com/launchpad--ImproveLogins--0  baz commit -s "Merged steve's ImproveLogins work." When Andrew eventually gets his work reviewed, and sends it on to PQMto be merged into Rocketfuel, the Bazaar merging algorithms will workout that Andrew merged from me, and will sort things out.  Of course,there can be conflicts when people have worked in divergent ways on thesame code.  These are resolved in a similar way to CVS or SVN.7. I want to get my code reviewed by a member of the review team.  I addthe details of my branch to the PendingReviews page on the launchpaddevelopment wiki.  This wiki is publicly readable.https://wiki.launchpad.canonical.com/PendingReviewsThere is a script that periodically reads the PendingReviews page,attempts to merge the branches listed there into rocketfuel (just as PQMwould do), and produces a diff for use by the review team.  The diffrepresents what changes would be made to the rocketfuel Trunk were thebranch in question to be sent to PQM.  This diff is often enough for thereviewers to work with.  If they need to see more context, they cansimply check out the branch in question using 'baz get branchname'.The script also highlights whether there were any conflicts that wouldprevent a merge, and gives an indication of the size of the change.The script's output is accessible only to Launchpad developers.However, I've made a couple of screenshots to give you some idea of whatit looks like.This is the summary page, that uses information taken from thePendingReviews wiki page.http://people.ubuntu.com/~stevea/branch-summary.pngThis is a typical diff representing what is to be merged.http://people.ubuntu.com/~stevea/branch-diff.pngThe reviewer sends an email to the author of the code, cc thelaunchpad-reviews mailing list.  The review email typically has sectionsof code included, each line prefixed with '> ', with comments, questionsand requests for improvement beneath each section of code.  The reviewerwill either approve the code for merging, approve the code providingcertain remedial actions are taken, or reject the code, requiring a newreview later.8. My code has been successfully reviewed by JamesH, so I send a signedmail to PQM asking to merge my work into rocketfuel.  submit-merge "r=JamesH, Improvements to logging in."pqm at pqm.ubuntu.comPQM checks that each merge request has r=someone in the message, as areminder that launchpad developers need to have their code reviewed.The submit-merge script gets takes the archive name, the branch name,and the "patch level" that the branch is at, composes an email saying  "pqm, please mergesteve.alexander at canonical.com/launchpad--ImproveLogins-0--patch-18   intorocketfuel at canonical.com/launchpad--devel--0."Signs it with my gpg key, and mails it.Some time later, once PQM has merged the code and successfully run allthe launchpad tests, an email will go out to me, and to a pqm-commitsmailing list, saying that the merge was successful.  If it wasunsuccessful, I get an email with the error output.An irc robot listens to the pqm-commits mailing list, and announces newlandings to the rocketfuel Trunk on irc.== Naming branches ==The Launchpad team is distributed around the world.  To cope with this,and also to get our community of users involved in the development ofthe software, Launchpad development emphasises writing specificationsand proposals, and implementing features based on these proposals.You can read all the launchpad proposals on the launchpad development wiki.https://wiki.launchpad.canonical.com/So, we usually name branches after the specification that is beingimplemented on that branch.  The branch is named near the top of thespecification, so someone reading the specification who has access tothe source code can see what's happening with the implementation.Branches are also often named after bugs.  For example,launchpad--bug123--0.The use of '--' in branch names, and the '--0' thing at the end isoccassionally useful, but more of a hangover from the 'tla' system thatbazaar is based on.  This strict branch naming format is not beingcarried over into bazaar 2.== External contributors ==The source code to Launchpad is not available at this time.  We intendto make it open source at some point in the future, but I'm not surewhen that will be.Let's consider what would happen if we decided to make the Launchpadcode fully open source tommorrow.Someone from outside of Canonical could get a copy of the main launchpad"rocketfuel" branch, make their own branch by branching from therocketfuel branch, do a bunch of work, mirror it to their own website,and email a Canonical launchpad developer to ask that it be reviewed, ormerged into that launchpad developer's branch.This way, even though an outside contributor doesn't have rights withPQM, they could still make fine-grained commits, merge frmo a variety ofplaces, and participate at the same level as someone employed by Canonical.--Steve Alexander


More information about the Python-Devmailing list

[8]ページ先頭

©2009-2025 Movatter.jp