drizzle
Profile
Search
 
Hosted by The Rackspace Cloud
Contributing Code


Contents

Pre-requisites

You need Bazaar for revision control.

Login Setup

bzr launchpad-login [yourloginid]

Getting the code

You should prepare a directory to keep drizzle work in

mkdir $repo # where $repo is some directory (ex: ~/repos)
cd $repo
bzr init-repo drizzle --2a # this creates ~/repos/drizzle
# Note that without --2a, pushing your branch to LP will take a very long time!

Then get a clean copy of the repo with

cd $drizzle-repo # (ex: ~/repos/drizzle)
bzr branch lp:drizzle trunk

You can see the current history with:

cd $drizzle-repo/trunk
bzr log | more

You can now create a working copy from your local clean repo

cd $drizzle-repo
bzr branch trunk drizzle-fix-bugNNNNNN
cd drizzle-fix-bugNNNNNN

NOTE: Use descriptive names such as drizzle-fix-bugNNNNNN (where NNNNNN is the bug # of course).

You should now Compile Drizzle.

Setting up tests

The Drizzle test suite is contained in the /tests subdirectory of the source tree. The /tests directory has two subdirectories of utmost concern to you, the bug fixer: the /t directory and the /r directory (for "tests" and "results" respectively). Be sure to check and see if your bug already has a test too.

All the tests are found in the /t directory. Open up the file that corresponds to the functionality you are changing (or add a new file) and add the commands that will reproduce your output.

For example, the test below creates a new test table "t1"; shows us the result of that CREATE TABLE statement; and lastly, we cleanup the test by dropping the test table:

#
# Bug #XXXXXX: INET_ATON() returns signed, not unsigned
#
create table t1 select INET_ATON('255.255.0.1') as `a`;
show create table t1;
drop table t1;

By adding your test first, it will remind you to re-record the test output file later (and inform future efforts about your expected output, of course). Now it's time to make your changes.

Editing and adding to your contribution

With a working version, you can commence making changes in your new branch, committing code regularly to your local working copy; feel free to commit early and often as you will formalize your contribution later with a push and proposal.

cd $drizzle-repo/drizzle-fix-bugNNNNNN
# Make Changes
bzr commit -m "Merge comment"

Prior to publishing your completed work, you need to confirm that your branch works as expected and update the test runs.

Testing your branch

Make sure you have at least libtool 1.5.22 (found here).

First, check to see that all the tests pass (remember that test you set up earlier? It should fail; that's ok, you will re-record it momentarily):

cd $drizzle-repo/tests
./test-run

Any that fail will need to be re-recorded.

cd $drizzle-repo/tests
./test-run --record $test // where $test is the name of the test that failed 

You are now ready to merge into trunk.

Merging recent changes

It is important to merge any changes from trunk into your branch before pushing / publishing.

Update your local trunk.

cd $drizzle-repo 
cd trunk
bzr pull   

Updating your local branch.

cd $drizzle-repo
cd drizzle-fix-bugNNNNNN
bzr merge ../trunk
bzr commit -m "Merged from trunk"

Conflicts can be resolved in bazaar via:

bzr resolve $filename

To revert to your last commit on your branch use:

bzr revert $filename

(Note you will need to remerge with trunk before pushing)

Verify differences carefully

bzr diff

Publish your branch

When all changes are merged and your changes are all consistent you can push your branch to LaunchPad

cd $drizzle-repos/$your-branch # where $your-branch is the branch you want to push (ex: drizzle-bugNNNN)
bzr push lp:~[yourloginid]/drizzle/$your-branch

If you find that this takes a very long time (eg. 30 minutes), you may want to try using 'bzr init-repo --format=1.9' to initialize a new repo and merge your work into it, then push again.

Propose branch

On your Launchpad Code page https : //code.launchpad.net/~[yourloginid]/drizzle/[branch-name] click the Propose for merging into another branch link to propose branch to the maintainers to be merged into the main trunk.

Fix Branch (if needed)

If fixes are needed on your branch you will need to: make the changes, re-merge any new changes to trunk, commit and re-push; you do not need to re-propose. After the push, LaunchPad will pick up the changes automagically.

Please be aware that changes can take a few minutes for LaunchPad to merge your new changes into your proposal.

Resubmit Proposal

At the moment, this is a tricky process, and none of the "Request another review" links work.

To resubmit a merge proposal, follow these steps: On the main page of the merge proposal, the top line will be something like "Status: Needs Review". Just to the right of this is a small button; click on this to change the status. Select "Resubmit" from the drop down menu and click "Change Status". The next page should prompt you to resubmit the merge proposal and inform you that the new proposal will supersede the old one; click "Resubmit" to finish.

Note: as of 2009-07-07, there are open bugs with Launchpad to improve the UI.