Overview
Launchpad entry: package-branches
Created: 2008-11-20 by Jonathan Lange
Contributors: Michael Hudson, Martin Albisetti, Tim Penhey
Depends on: n/a
This page is out of date, and included for historical reasons only. Feel free to update it. -- JonathanLange <<Date(2009-08-07T11:39:54Z)>>
Goal
Provide a place to store Ubuntu source package branches on Launchpad, including the official branches for Ubuntu source packages.
Rationale
- Bazaar is great, Launchpad makes Bazaar better, Ubuntu should use them both.
Constraints
- Ubuntu developers naturally think in terms of releases of Ubuntu. Any hosting solution should respect this.
- There must be a stable URL to refer to the latest official version of a source package. This has been repeatedly emphasised by the Ubuntu developers that we have talked with.
Out of Scope
Linking upstream branches to product series. See BranchProductSeries.
- Stacking.
- Building packages automatically from branches.
- Altering Bazaar's directory service features.
- Permissions on official source package branches.
- Privacy
- Specific changes to code.
- Planning the implementation.
Terminology
- Distribution
- ubuntu, debian
- Distribution Series
- hardy, jaunty
- release, security, updates, backports
- Distribution Suite
<series>-<pocket>. e.g. hardy (hardy + release pocket), hardy-security, hardy-backports.
- Official source package branch
- The Bazaar branch that represents the source package that is currently inthe Ubuntu archive. jaunty: The version of Ubuntu that everyone is working on right now, the "development focus". intrepid: The version of Ubuntu that has just been released. kickass: The "Kickass Koala", the hypothetical version of Ubuntu after jaunty.
Outline
The official branches for a source package are canonically available at /$distro/$suite/$sourcepackagename, where $suite is either $distroseries or $distroseries-$pocket.
For example:
- /ubuntu/jaunty/openssh
- /ubuntu/jaunty-security/openssh
- /debian/woody/nautilus
- /ubuntu/+latest/openssh
+latest is a special name that refers to the distroseries that is the current development focus. The exact spelling of "+latest" may vary. See Open Questions.
Official branches are owned by a celebrity Person, ~ubuntu-branches. Permission to write to the source package will grant permission to write to the branch.
Should this be celebrity group? We need special permission for a robot to push to the branches, as package uploads outside of bzr will need to be imported in to bzr and pushed to launchpad. We obviously don't want to expand upload permissions to do this. -- james-w 2008-11-21 00:33:07
Personal branches are canonically available at ~$person/$distro/$distroseries/$sourcepackagename/$branch_name. Personal branches are not ever associated with a distribution suite.
For example:
- ~jml/ubuntu/jaunty/openssh/break-dsa
- ~jml/ubuntu/jaunty/openssh/fix-dsa
Database Schema Changes
Update the Branch table to allow any branch to be linked to a distribution series and source package:
-- Refer to a source package with the pair (DistroSeries, SourcePackageName) ALTER TABLE Branch ADD COLUMN distroseries int REFERENCES DistroSeries(id); ALTER TABLE Branch ADD COLUMN sourcepackagename int REFERENCES SourcePackageName(id); -- A Branch can either be a product branch, a personal branch (i.e. +junk) or -- a source package branch ALTER TABLE Branch ADD CONSTRAINT one_container CHECK ( ((distroseries IS NULL) = (sourcepackagename IS NULL)) AND ((distroseries IS NULL) OR (product IS NULL))); DROP INDEX branch_name_owner_product_key; CREATE UNIQUE INDEX branch_name_owner_product_key ON Branch(name, owner, (COALESCE(product, (-1)))) WHERE distribution IS NULL; CREATE UNIQUE INDEX branch__distribution__sourcepackagename__key ON Branch(name, owner, distribution, sourcepackagename) WHERE distribution IS NOT NULL; -- Link /ubuntu/<suite>/<package> to a source package branch. CREATE TABLE SeriesSourcePackageBranch ( id serial PRIMARY KEY, date_created timestamp without time zone DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL, registrant integer NOT NULL REFERENCES Person(id), branch integer NOT NULL REFERENCES Branch(id), distroseries integer NOT NULL REFERENCES DistroSeries(id), pocket integer, sourcepackagename int REFERENCES SourcePackageName(id), CONSTRAINT branchsourcepackageseries__branch__distroseries__pocket__key UNIQUE (branch, distroseries, pocket, sourcepackagename) );
Indexes have been trimmed from this database patch so we can focus on the core relations.
Stories
John, the lazy Ubuntu developer
John is an Ubuntu developer who works on the OpenSSH package. He's made some fixes to the packaging, and he want to push them to Launchpad. He would:
$ bzr push lp:~john/ubuntu/openssh/john-fixes
The Canonical URL for this would be: /~john/ubuntu/jaunty/openssh/john-fixes
Six months later, John has been lazy and never got his branch merged in. He then does some additional changes, and pushes again:
$ bzr push lp:~john/ubuntu/openssh/john-fixes
The Canonical URL for this would be: /~john/ubuntu/kickass/openssh/john-fixes.
The branch is accessible through:
lp:~john/ubuntu/kickass/openssh/john-fixes lp:~john/ubuntu/openssh/john-fixes (alias for ubuntu/kickass/openssh/john-fixes)
The branch, as of the last push to jaunty is at:
lp:~john/ubuntu/jaunty/openssh/john-fixes
Sarah, the helpful Ubuntu collaborator
Sarah has spoken with John the Lazy about his openssh fixes on and off over the last few months. She finally gets the time to take a look at the branch.
Thing is, jaunty got released in the mean-time and John hasn't yet pushed up his branch. Sarah tries:
$ bzr branch lp:~john/ubuntu/openssh/john-fixes
and gets Bazaar's equivalent of a 404 error.
Kevin the busy Ubuntu Hacker
Kev starts working on gedit:
$ bzr branch lp:ubuntu/gedit trunk
(this gets the latest, which happens to be jaunty)
lp:ubuntu/gedit --> bzr+ssh://bazaar.launchpad.net/ubuntu/+latest/gedit
Kev makes a whole bunch of branches all the time:
$ cd gedit $ bzr branch trunk foo-stuff $ bzr branch trunk obby-support
And sometimes he pushes these branches up to Launchpad:
$ bzr push lp:~kev/ubuntu/gedit/obby-support
He gets fresh updates to trunk by pulling:
$ bzr pull
Pulling from lp:ubuntu/gedit
And then Ubuntu gets released again:
$ bzr pull bzr+ssh://bazaar.launchpad.net/ubuntu/+latest/gedit $ bzr info -v Parent branch: bzr+ssh://bazaar.launchpad.net/ubuntu/+latest/gedit
...which happens to be kickass. All the revisions that are in kickass and not in jaunty will be pulled in. If jaunty and kickass have diverged, then Bazaar will raise its "diverged branches" error.
What actually happens when Ubuntu is released
Matt the Canonical Ubuntu employee has just released Ubuntu Jaunty. He's tired, slightly hungover and he has to open up development on the Kickass Koala. Ubuntu has about 20G worth of branches.
Matt hits a button that says "Open up karmic". Hitting this button deos the following:
- Creates a new distroseries, "karmic".
- Makes "karmic" the development focus of Ubuntu.
- For each source package,
- Make the official "karmic" distroseries package branch be the same as the jaunty one.
- Create a new Bazaar branch from the distroseries package branch
- Make this new branch the official "jaunty" distroseries package branch.
This means that "+latest" always refers to the same branch and that kickass has branches for every source package.
Other comments
The new Bazaar branch will very likely be stacked on the development focus Bazaar branch, so the operation ought to be cheap for both time and storage.
Note: We really need to consult closely with the distribution on this item.
Open Questions
How should we spell "+latest"?
+latest refers to the series that is the current development focus. How should we spell it?
Suggestions:
- +devel
- +trunk
- +mainline
- +latest
- +current
What should the Branch.name property be for official source package branches?
jml's current favorite is NULL.
Since all branches will have to be created by someone first, they will have a name before they become the official branch. We may just choose not to show it. -- thumper 2008-11-20 04:17:36
I'm not sure what you mean by this. I could initialise things by pushing directly to lp:package for every package. Would launchpad require that they are pushed somewhere else and then anointed? How does someone do this if we are using a celebrity as the owner? -- james-w 2008-11-21 00:33:07
How are official source package branches created?
Will we allow a new official source package to be created by someone pushing to lp:ubuntu/jaunty/package ? I think yes, but then it needs an owner and name (assuming we don't relax the constraint. -- thumper 2008-11-20 04:34:49
This needs to be discussed with the distro (particularly James Westby) and the Soyuz crew.
At this point I don't think adding to the package name table on push would be a good idea, though we might want to allow that later. Allowing to initialise the branches for existing source packages this way would be good though, as it would simplify my code at least. -- james-w 2008-11-21 00:33:07
Do all source package branches need to be associated with distroseries?
Note that this question has been historically clouded by several points:
- As they stand in Launchpad, series aren't very good.
- Launchpad does almost no automatic gardening of branches. It could do a lot more without changes to the data model.
Well, the scanner does some now -- thumper 2008-11-20 04:17:36
Which is great, but those changes haven't really kicked in yet (see the Bazaar branch listing), so it's still relevant to the discussion.
- We want source packages and upstream products to be as similar as possible. Linking all source package branches to series means that all product branches should be linked to series. Making such a change would involve a lot of work in designing the new system, migrating existing data, managing user expectations and actually coding up the change.
Why do you value having the series be as similar as possible? -- james-w 2008-11-21 00:33:07