Overview

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

Constraints

Out of Scope

Terminology

Distribution
ubuntu, debian
Distribution Series
hardy, jaunty
Pocket
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:

+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.

Personal branches are canonically available at ~$person/$distro/$distroseries/$sourcepackagename/$branch_name. Personal branches are not ever associated with a distribution suite.

For example:

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:

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:

What should the Branch.name property be for official source package branches?

jml's current favorite is NULL.

How are official source package branches created?

This needs to be discussed with the distro (particularly James Westby) and the Soyuz crew.

Do all source package branches need to be associated with distroseries?

Note that this question has been historically clouded by several points:

PackageBranches (last edited 2009-08-07 11:39:54 by jml)