~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/contributing/code.rst

  • Committer: Olaf van der Spek
  • Date: 2011-07-04 19:11:47 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110704191147-s99ojek811zi1fzj
Remove unused Name_resolution_context::error_reporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.. _code-label:
 
2
 
 
3
Contributing Code
 
4
=================
 
5
 
 
6
SSH Keys
 
7
--------
 
8
 
 
9
You will need to add a public SSH key to Launchpad to be able to push branches
 
10
up for merging.  To do this:
 
11
 
 
12
 #. Generate an SSH key (information on how to do this is in `Launchpad's help pages <https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair>`_)
 
13
 #. Go to `your SSH keys page <https://launchpad.net/people/+me/+editsshkeys>`_
 
14
 #. Paste your public key into the text box and click the *Import public key*
 
15
    button
 
16
 
 
17
Logging into Launchpad
 
18
----------------------
 
19
 
 
20
You will need to set up your local bzr configuration with your Launchpad account
 
21
so that you can push branches for merging.  To do this:
 
22
 
 
23
 # bzr launchpad-login username
 
24
 
 
25
Getting the Code
 
26
----------------
 
27
 
 
28
You will need to prepare a directory for working with Drizzle. The following
 
29
example will assume you want to do this in ~/repos/drizzle:
 
30
 
 
31
.. code-block:: bash
 
32
 
 
33
   mkdir ~/repos
 
34
   cd ~/repos
 
35
   bzr init-repo drizzle
 
36
 
 
37
At this stage you now have an initialized a directory named ~/repos/drizzle
 
38
for bzr to use.  Revision data will be stored in this directory so that it
 
39
does not have to be separately downloaded and stored for every branch.
 
40
 
 
41
.. code-block:: bash
 
42
 
 
43
   cd drizzle
 
44
   bzr branch lp:drizzle trunk
 
45
 
 
46
This will take a little while, it is getting all the revisions since the
 
47
beginning of the repository.  This should only ever need to be done once though.
 
48
 
 
49
.. code-block:: bash
 
50
 
 
51
   bzr branch trunk drizzle-bug-NNNNNN
 
52
   cd drizzle-bug-NNNNNN
 
53
 
 
54
This creates a branch from trunk for you to work on.
 
55
 
 
56
Committing Work
 
57
---------------
 
58
 
 
59
All commits need to have a proper description of the changes made.  This is so
 
60
that future developers can read through the bzr log to find out why a certain
 
61
change happened.
 
62
 
 
63
When committing a bug fix please use:
 
64
 
 
65
.. code-block:: bash
 
66
 
 
67
   bzr commit --fixes lp:NNNNNN
 
68
 
 
69
This will automatically attach the branch to the bug report when the branch is
 
70
pushed up.
 
71
 
 
72
Coding Standards
 
73
----------------
 
74
 
 
75
Our coding standards can be found at the
 
76
`Drizzle wiki <http://wiki.drizzle.org/Coding_Standards>`_.
 
77
 
 
78
Test Cases
 
79
----------
 
80
 
 
81
Where possible, SQL test cases should be created for your code.  Our test cases
 
82
for bug fixes should be in the ``tests/suite/regression`` directory.  For more
 
83
information about creating test cases please see the :ref:`test run <test-run-label>`
 
84
section of our documentation.
 
85
 
 
86
Pushing Work
 
87
------------
 
88
 
 
89
When you want to push your branch to Launchpad for others to see or for merging
 
90
you can use:
 
91
 
 
92
.. code-block:: bash
 
93
 
 
94
   bzr push lp:~username/drizzle/trunk-bug-NNNNNN
 
95
 
 
96
This will create the branch on Launchpad which you will be able to see on the
 
97
`code page <https://code.launchpad.net/drizzle>`_.  If you make some more commits you simply need to do just ``bzr push`` to get those revisions on Launchpad
 
98
too.
 
99
 
 
100
Merge Proposals
 
101
---------------
 
102
 
 
103
Once your work is done and ready for review you can go to the
 
104
`code page <https://code.launchpad.net/drizzle>`_, and then click on your branch.
 
105
You will see a link labeled *Propose for merging*.
 
106
 
 
107
In this screen simply fill in what this branch does and click the
 
108
*Propose Merge* button.  Someone will review the branch, usually within a day or
 
109
two. If approved, it will go though our rigourous testing process, which can
 
110
take several hours.  If it needs more work, feedback will always be given to
 
111
explain why.