Diff for "Trunk"

Not logged in - Log In / Register

Differences between revisions 15 and 30 (spanning 15 versions)
Revision 15 as of 2009-08-12 17:29:01
Size: 7468
Editor: kfogel
Comment: Use the word "production" less; get ".edge" out of links.
Revision 30 as of 2021-10-19 13:35:30
Size: 6951
Editor: cjwatson
Comment: remove mentions of edge, and clarify use of db-devel slightly
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
||<tablestyle="width: 100%;" colspan=3 style="background: #2a2929; font-weight: bold; color: #f6bc05;">This page describes the "master" branches for Launchpad development. Please [[Help|ask for help]] immediately if you have any questions. ||

||<tablestyle="float:right; font-size: 0.9em; width:40%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;"><<TableOfContents>>||
Line 3: Line 7:
||<tablestyle="width: 100%;" colspan=3 style="background: #2a2929; font-weight: bold; color: #f6bc05;">This page describes the "master" branches for Launchpad development. Please [[Help|ask for help]] immediately if you have any questions. || Launchpad has four master branches (this is unusual; most projects only have one). They are:
Line 5: Line 9:
Launchpad has four master branches (this is unusual; most projects only have one). All four are owned by [[https://launchpad.net/~launchpad-pqm|launchpad-pqm]], the Patch Queue Manager. They are:  1. '''[[https://code.launchpad.net/~launchpad/launchpad/+git/launchpad/+ref/master|master]]''' Where most development takes place (except anything that involves changing the database schema; see below).
 1. '''[[https://code.launchpad.net/~launchpad/launchpad/+git/launchpad/+ref/db-devel|db-devel]]''' Changes that modify the database schema get merged here first.
 1. '''[[https://code.launchpad.net/~launchpad/launchpad/+git/launchpad/+ref/stable|stable]]''' This is fed by regular merges from the '''master''' branch, and is deployed to [[https://qastaging.launchpad.net/|qastaging.launchpad.net]] frequently.
 1. '''[[https://code.launchpad.net/~launchpad/launchpad/+git/launchpad/+ref/db-stable|db-stable]]''' This is fed by regular merges from the '''db-devel''' branch. It is deployed to [[https://staging.launchad.net|staging.launchpad.net]] frequently, and deployed to [[https://launchpad.net/|launchpad.net]] on each DB schema deployment. After deployment, '''db-stable''' is merged back into '''master''', completing the cycle.
Line 7: Line 14:
 1. '''[[https://code.launchpad.net/~launchpad-pqm/launchpad/devel|devel]]''' Where most development takes place (except anything that involves changing the database schema; see below).
 1. '''[[https://code.launchpad.net/~launchpad-pqm/launchpad/db-devel|db-devel]]''' Changes that modify the database schema get merged here first. ''Note: this is also the default [[http://code.mumak.net/2008/10/stacked-branches-and-new-world.html|stacking branch]] for other Launchpad branches.''
 1. '''[[https://code.launchpad.net/~launchpad-pqm/launchpad/stable|stable]]''' This is fed by regular merges from the '''devel''' branch, and is deployed to [[https://edge.launchpad.net/|edge]] daily.
 1. '''[[https://code.launchpad.net/~launchpad-pqm/launchpad/db-stable|db-stable]]''' What [[https://staging.launchpad.net/|staging]] runs; fed by regular merges from the '''db-devel''' branch. This is deployed to <a href="https://staging.launchad.net" >staging.launchpad.net</a> daily, and deployed to <a href="https://launchad.net/" >launchpad.net</a> on each release.
In summary: '''db-stable''' is the post-test-run counterpart of '''db-devel''', and '''stable''' is the post-test-run counterpart of '''master''', where ''"post-test-run"'' means that once code hits foo-devel it is only cleared into foo-stable if the buildbot test runner succeeds.
Line 12: Line 16:
In summary: '''db-stable''' is the post-test-run counterpart of '''db-devel''', and '''stable''' is the post-test-run counterpart of '''devel''', where ''"post-test-run"'' means that once code hits foo-devel it is only cleared into foo-stable if the buildbot test runner succeeds. If you want to know how all of this works behind the scenes, read [[Trunk/Glue]] (after reading the rest of this page).
Line 20: Line 24:
Below, we break the process down a bit with a different diagramming approach. Here's what happens when you submit to '''devel''': Below, we break the process down a bit with a different diagramming approach. Here's what happens when you submit to '''master''':
Line 34: Line 38:
Database changes can be destabilizing to other work, so we isolate them out into a separate branch ('''db-devel'''). Then there are two arenas for stabilizing changes for deployment: '''stable''' (which ends up on [[https://edge.launchpad.net|edge]] and is fed from the '''devel''' branch), and '''db-stable''' (which ends up on [[https://staging.launchpad.net|staging]] and is fed from the '''db-devel''' branch). Database changes can be destabilizing to other work, so we isolate them out into a separate branch ('''db-devel'''). Then there are two arenas for stabilizing changes for deployment: '''stable''' (which ends up on [[https://qastaging.launchpad.net|qastaging]] and is fed from the '''master''' branch), and '''db-stable''' (which ends up on [[https://staging.launchpad.net|staging]] and is fed from the '''db-devel''' branch).

(Note that the actual images here date from the Bazaar world, and so talk about "devel" rather than "master". You can regard these two names as interchangeable. Feel free to update the images if you have time.)
Line 38: Line 44:
 * Developers submit to '''devel''' and '''db-devel'''.  * Developers submit to '''master''' and '''db-devel'''.
Line 40: Line 46:
 * Buildbot tests the tip of '''db-devel''', in addition to '''devel'''. If a '''db-devel''' change passes, it is pushed automatically to '''db-stable'''.  * Buildbot tests the tip of '''db-devel''', in addition to '''master'''. If a '''db-devel''' change passes, it is pushed automatically to '''db-stable'''.
Line 42: Line 48:
 * When changes are approved by buildbot to go from '''devel''' to '''stable''', a script also generates a PQM request to merge '''stable''' with '''db-devel''', sent as if it came from the Launchpad list. The Launchpad list will be informed of merge failures, and launchpad developers will collectively be responsible for correcting them. ('''''TODO: is this some internal list? Hmmm.''''')  * When changes are approved by buildbot to go from '''master''' to '''stable''', a script also generates a PQM request to merge '''stable''' with '''db-devel''', sent as if it came from the Launchpad list. The Launchpad list will be informed of merge failures, and Launchpad developers will collectively be responsible for correcting them. ('''''TODO: is this some internal list? Hmmm.''''')
Line 44: Line 50:
 * Staging runs '''db-stable'''; edge runs '''stable'''. We will deploy [[https://launchpad.net|launchpad.net]] site from '''db-stable'''. (After a deployment, '''db-stable''' is manually pushed to '''devel''' and '''stable'''.)

 * When '''devel''' ''or'' '''db-devel''' get a test failure, we go into `[testfix]` mode ''for both branches''. If only one branch is broken, a `[testfix]` to the broken branch that then makes the tests pass will reopen both branches for normal use.
 * Staging runs '''db-stable'''; qastaging runs '''stable'''. We will deploy production DB schema changes from '''db-stable'''. (After a deployment, '''db-stable''' is manually pushed to '''devel''' and '''stable'''.)
Line 50: Line 54:
  * '''The merge from stable to db-devel fails.''' That's a real risk but we expect it to be occur infrequently. When it does occur, the Launchpad list ('''''TODO: which one?''''') will be emailed, and it is the collective responsibility of everyone to fix the problem, by manually submitting a branch to '''db-devel''' that includes the branch that failed to merge plus any necessary adjustments.   * '''The merge from stable to db-devel fails.''' That's a real risk but we expect it to occur infrequently. When it does occur, the Launchpad list ('''''TODO: which one?''''') will be emailed, and it is the collective responsibility of everyone to fix the problem, by manually submitting a branch to '''db-devel''' that includes the branch that failed to merge plus any necessary adjustments.
Line 54: Line 58:
Merge requests that do any of the following should be sent via PQM to the '''db-devel''' branch: Merge requests that do any of the following should be targeted at the '''db-devel''' branch:
Line 56: Line 60:
 * changes the database schema  * adds a cold database patch (see [[PolicyAndProcess/DatabaseSchemaChangesProcess]])
Line 58: Line 62:
 * requires changes on machines other than [[https://help.launchpad.net/GetInvolved/BetaTesting|edge]]
Line 60: Line 63:
All other developer merge requests for the launchpad tree should be addressed
to the '''devel''' branch.
All other developer merge requests for the launchpad tree should be targeted at the '''master''' branch.
Line 63: Line 65:
The current `buildbot-poller.py` script on the PQM box monitors buildbot to discover what revisions have passed the tests. When a new revision is "blessed" by buildbot, the script copies it over to '''stable'''. The poller script generates a merge request to PQM for merging the blessed revision with the '''db-devel''' branch. It is also responsible for checking a new buildbot build testing '''db-devel'''. The poller will copy revisions of '''db-devel''' that buildbot blesses to '''db-stable'''. The current `buildbot-poller.py` script on the PQM box monitors buildbot to discover what revisions have passed the tests. When a new revision is "blessed" by buildbot, the script copies it over to '''stable'''. The poller script merges the blessed revision into the '''db-devel''' branch. It is also responsible for checking a new buildbot build testing '''db-devel'''. The poller will copy revisions of '''db-devel''' that buildbot blesses to '''db-stable'''.
Line 65: Line 67:
Staging releases and production releases should run code from '''db-stable'''.
[[https://help.launchpad.net/GetInvolved/BetaTesting|edge]] should continue to run code from '''stable'''.
Staging releases should run code from '''db-stable'''.
qastaging and production should continue to run code from '''stable'''.
Line 68: Line 70:
When a production release is made, the '''db-stable''' code should be pushed to '''devel''' and '''stable''' before opening '''devel''' back up to commits (that is, turning off release-critical mode, or something even stricter). At the moment, we expect this push to be a manual job for LOSAs after a software maintenance. When a DB schema deployment is made, the '''db-stable''' code should be merged into '''master'''. This is the responsibility of the person who organised the deployment.
Line 70: Line 72:
Problems with the automated merge requests are sent to the Launchpad list ('''''TODO: which list?''''').  The PQM merge request is signed with a key associated with the Launchpad list email address; PQM will send any merge failure email to the Launchpad list. Problems with the automated merge requests are sent to the Launchpad list ('''''TODO: which list?''''').
Line 72: Line 74:
When fixing a `[testfix]` or a merge error, reply to the email that was sent to
the mailing list with the resolution of the issue.

When the merge of '''stable''' -> '''db-devel''' does not work automatically, it should be done manually and submitted. The tests do not need to be run (rationale: the bots don't run the tests when the do it automatically, and the failure messages can clutter up the ML really fast.)
When the merge of '''stable''' -> '''db-devel''' does not work automatically, it should be done manually and submitted. The tests do not need to be run (rationale: the bots don't run the tests when they do it automatically, and the failure messages can clutter up the ML really fast.)
Line 81: Line 80:
cd ~/canonical/lp-branches
bzr branch lp:~launchpad-pqm/launchpad/db-devel mydbbranch
cd mydbbranch
./utilities/link-external-sourcecode ../trunk
cd ~/canonical/launchpad/launchpad
git checkout -b mydbbranch db-devel
Line 92: Line 89:
bzr pqm-submit --submit-branch bzr+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/db-devel -m '[r=so-and-so] improve frobnitz' git push -u myusername mydbbranch
Line 95: Line 92:
Instead of that last line, here's a nice variation from abentley: Now create and land a merge proposal.
Line 97: Line 94:
    I suggest creating an alias in bazaar.conf like:
    {{{
    dbsubmit = pqm-submit --submit-branch bzr+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/db-devel
    }}}
= FAQ =
Line 102: Line 96:
Then the last line can be just this: == Can I land a testfix before buildbot has finished a test run that has failed or will fail? ==
Line 104: Line 98:
{{{
bzr dbsubmit -m '[r=so-and-so] improve frobnitz'
}}}
Yes you can, and please do if appropriate, because this will mean that other developers will not encounter a broken tree at all.
Line 108: Line 100:
'''''XXX: Shouldn't this be unnecessary if you have `~/.bazaar/locations.conf` configured right?''''' == What happens if the automatic merge from stable to db-devel fails? ==

The (internal! change?) launchpad list gets an email. This is described on the /Trunk page.

== A build failed for some reason other than a test failure. What do I do? ==

Force a build at https://lpbuildbot.canonical.com/force.

This page describes the "master" branches for Launchpad development. Please ask for help immediately if you have any questions.

Where's trunk?

Launchpad has four master branches (this is unusual; most projects only have one). They are:

  1. master Where most development takes place (except anything that involves changing the database schema; see below).

  2. db-devel Changes that modify the database schema get merged here first.

  3. stable This is fed by regular merges from the master branch, and is deployed to qastaging.launchpad.net frequently.

  4. db-stable This is fed by regular merges from the db-devel branch. It is deployed to staging.launchpad.net frequently, and deployed to launchpad.net on each DB schema deployment. After deployment, db-stable is merged back into master, completing the cycle.

In summary: db-stable is the post-test-run counterpart of db-devel, and stable is the post-test-run counterpart of master, where "post-test-run" means that once code hits foo-devel it is only cleared into foo-stable if the buildbot test runner succeeds.

If you want to know how all of this works behind the scenes, read Trunk/Glue (after reading the rest of this page).

Look at the Pretty Pictures

Diagrams might be the best way to understand this. (If they don't work, there's text afterwards, don't worry.)

codeflow.png

Below, we break the process down a bit with a different diagramming approach. Here's what happens when you submit to master:

db-devel-normal.png

Where are the expected potential problems in the process? Glad you asked!

db-devel-problems.png

It is also possible to submit directly to the db-devel branch.

db-devel-direct.png

Let's Try That in Words

Database changes can be destabilizing to other work, so we isolate them out into a separate branch (db-devel). Then there are two arenas for stabilizing changes for deployment: stable (which ends up on qastaging and is fed from the master branch), and db-stable (which ends up on staging and is fed from the db-devel branch).

(Note that the actual images here date from the Bazaar world, and so talk about "devel" rather than "master". You can regard these two names as interchangeable. Feel free to update the images if you have time.)

In summary:

  • Developers submit to master and db-devel.

  • Buildbot tests the tip of db-devel, in addition to master. If a db-devel change passes, it is pushed automatically to db-stable.

  • When changes are approved by buildbot to go from master to stable, a script also generates a PQM request to merge stable with db-devel, sent as if it came from the Launchpad list. The Launchpad list will be informed of merge failures, and Launchpad developers will collectively be responsible for correcting them. (TODO: is this some internal list? Hmmm.)

  • Staging runs db-stable; qastaging runs stable. We will deploy production DB schema changes from db-stable. (After a deployment, db-stable is manually pushed to devel and stable.)

Problems that can occur

  • The merge from stable to db-devel fails. That's a real risk but we expect it to occur infrequently. When it does occur, the Launchpad list (TODO: which one?) will be emailed, and it is the collective responsibility of everyone to fix the problem, by manually submitting a branch to db-devel that includes the branch that failed to merge plus any necessary adjustments.

Where to Send Merge Requests

Merge requests that do any of the following should be targeted at the db-devel branch:

All other developer merge requests for the launchpad tree should be targeted at the master branch.

The current buildbot-poller.py script on the PQM box monitors buildbot to discover what revisions have passed the tests. When a new revision is "blessed" by buildbot, the script copies it over to stable. The poller script merges the blessed revision into the db-devel branch. It is also responsible for checking a new buildbot build testing db-devel. The poller will copy revisions of db-devel that buildbot blesses to db-stable.

Staging releases should run code from db-stable. qastaging and production should continue to run code from stable.

When a DB schema deployment is made, the db-stable code should be merged into master. This is the responsibility of the person who organised the deployment.

Problems with the automated merge requests are sent to the Launchpad list (TODO: which list?).

When the merge of stable -> db-devel does not work automatically, it should be done manually and submitted. The tests do not need to be run (rationale: the bots don't run the tests when they do it automatically, and the failure messages can clutter up the ML really fast.)

How do I submit to db-devel?

See also WorkingWithDbDevel.

cd ~/canonical/launchpad/launchpad
git checkout -b mydbbranch db-devel
make build
make schema

...hack until ready to submit...

git push -u myusername mydbbranch

Now create and land a merge proposal.

FAQ

Can I land a testfix before buildbot has finished a test run that has failed or will fail?

Yes you can, and please do if appropriate, because this will mean that other developers will not encounter a broken tree at all.

What happens if the automatic merge from stable to db-devel fails?

The (internal! change?) launchpad list gets an email. This is described on the /Trunk page.

A build failed for some reason other than a test failure. What do I do?

Force a build at https://lpbuildbot.canonical.com/force.

Trunk (last edited 2021-10-19 13:35:30 by cjwatson)