Diff for "PackageBranches"

Not logged in - Log In / Register

Differences between revisions 8 and 9
Revision 8 as of 2008-11-20 06:25:35
Size: 6621
Editor: jml
Comment:
Revision 9 as of 2008-11-20 06:26:16
Size: 0
Editor: jml
Comment: Contains database schema patch -- need permission to make public
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Overview ==

 * '''Launchpad entry:''' [[https://blueprints.edge.launchpad.net/launchpad-bazaar/+spec/package-branches|package-branches]]
 * '''Created:''' 2008-11-20 by Jonathan Lange
 * '''Contributors:''' Mark Shuttleworth, Martin Albisetti, Michael Hudson.
 * '''Depends on:''' n/a


== Overall Summary ==

'''Goal/Deliverables:''' 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.

== Out of Scope ==

 * Linking upstream branches to product series.
 * Stacking.
 * Building packages automatically from branches.
 * Altering Bazaar's directory service features.
 * Permissions on official source package branches.
 * Privacy

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

== Summary ==

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. Write permissions to these branches are determined by the permissions on the source package.

  ''XXX: What is Branch.name for official source package branches?''

Personal branches are canonically available at `$person/$distro/$distroseries/$sourcepackagename/$branch_name`. Personal branches are ''not'' ever associated with a branch pocket.

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 a source package branch to /ubuntu/<suite>/<package>.
CREATE TABLE BranchSourcePackageSeries (
    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,
    CONSTRAINT branchsourcepackageseries__branch__distroseries__pocket__key
        UNIQUE (branch, distroseries, pocket)
);
}}}

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
}}}

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

"+latest" now binds to /kickass/

   {{{
> How much work is this? Is it just changing a single attribute on the
> distribution? Right now the process for opening/closing a release is
> pretty involved, which is why I'm asking about this ahead of time.
}}}

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