Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Get the source code on your local drive using SVN. Most development is done on the "trunk":

Code Block

svn checkout https://svn.apache.org/repos/asf/zookeeper/trunk/ zookeeper-trunk

You may also want to develop against a specific release. To do so, visit https://svn.apache.org/repos/asf/zookeeper/tags/ and find the release that you are interested in developing against. To checkout this release, run:

Code Block

svn checkout https://svn.apache.org/repos/asf/zookeeper/tags/release-X.Y.Z/ zookeeper-X.Y.Z

...

Please make sure that all unit tests succeed before constructing your patch and that no new javac compiler warnings are introduced by your patch.

Code Block

> cd zookeeper-trunk
> ant -Djavac.args="-Xlint -Xmaxwarns 1000" clean test tar

After a while, if you see

Code Block

BUILD SUCCESSFUL

all is ok, but if you see

Code Block

BUILD FAILED

then please examine error messages in build/test and fix things before proceeding.

...

Please also check the javadoc.

Code Block

> ant javadoc
> firefox build/docs/api/index.html

...

Check to see what files you have modified with:

Code Block

svn stat

Add any new files with:

Code Block

svn add src/.../MyNewClass.java
svn add src/.../TestMyNewClass.java

In order to create a patch, type:

Code Block

svn diff > ZOOKEEPER-1234.patch

If using git (via one of the available git-svn mirrors) create the patch as follows

Code Block

git diff --no-prefix > ZOOKEEPER-1234.patch

...

Before submitting your patch, you are encouraged to run the same tools that the automated Hudson system Jenkins CI system will run on your patch. This enables you to fix problems with your patch before you submit it. The test Ant target will run your patch through the same checks that Hudson currently Jenkins currently does.

To use this target, you must run it from a clean workspace (ie svn stat shows no modifications or additions). From your clean workspace, run:

Code Block

ant test

At the end, you should get a message on your console that indicates success.

...

To apply a patch either you generated or found from JIRA, you can issue

Code Block

patch -p0 < ZOOKEEPER-<JIRA#>.patch

if you just want to check whether the patch applies you can run patch with --dry-run option

Code Block

patch -p0 --dry-run < ZOOKEEPER-<JIRA#>.patch

...

Folks should run ant clean test javadoc before selecting Submit Patch. Tests should all pass. Javadoc should report no warnings or errors. HudsonJenkin's tests are meant to double-check things, and not be used as a primary patch tester, which would create too much noise on the mailing list and in Jira. Submitting patches that fail Hudson testing Jenkins testing is frowned on, (unless the failure is not actually due to the patch).

...

Should your patch receive a "-1" from the Hudson testingJenkins testing, select the Resume Progress on the issue's Jira, upload a new patch with necessary fixes, and then select the Submit Patch link again.

...