You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2006/05/09 06:24:55 UTC

[Solr Wiki] Update of "HowToContribute" by HossMan

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by HossMan:
http://wiki.apache.org/solr/HowToContribute

The comment on the change is:
Almost exact copy of hadoop rev#3

New page:
= How to Contribute to Solr =

=== Getting the source code ===

First of all, you need the Solr source code.[[BR]]

Get the source code on your local drive using 
[http://incubator.apache.org/solr/version_control.html SVN].  Most development is done on the "trunk":

{{{
> svn checkout http://svn.apache.org/repos/asf/incubator/solr/trunk solr-trunk
}}}

=== Making Changes ===

Before you start, you should send a message to the [http://incubator.apache.org/solr/mailing_lists.html Solr developer mailing list] (NOte: you have to subscribe before you can post), or file a bug in [http://issues.apache.org/jira/browse/SOLR Jira].  Describe your proposed changes and check that they fit in with what others are doing and have planned for the project.  Be patient, it may take folks a while to understand your requirements.

Modify the source code and add some (very) nice features using your favorite IDE.[[BR]]

But take care about the following points
 * All public classes and methods should have informative [http://java.sun.com/j2se/javadoc/writingdoccomments/ Javadoc comments].
 * Code should be formatted according to [http://java.sun.com/docs/codeconv/ Sun's conventions].
 * Contributions should pass existing unit tests.
 * New unit tests should be provided to demonstrate bugs and fixes ([http://www.junit.org]).

=== Generating a patch ===

Please make sure that all unit tests succeed before constructing your patch.

==== Unit Tests ====

{{{
> cd solr-trunk
> ant clean test
}}}
After a while, if you see
{{{
BUILD SUCCESSFUL
}}}
all is ok, but if you see
{{{
BUILD FAILED
}}}
please, read carefully the errors messages and check your code.

==== Creating a patch ====
Check to see what files you have modified with:
{{{
svn stat
}}}

Add any new files with:
{{{
svn add src/.../MyNewClass.java
}}}

Edit the ''CHANGES.txt'' file, adding a description of your change, including the bug number it fixes.

In order to create a patch, just type:

{{{
svn diff > myBeautifulPatch.patch
}}}

This will report all modifications done on Solr sources on your local disk and save them into the ''myBeautifulPath.patch'' file.  Read the patch file.  
Make sure it includes ONLY the modifications required to fix a single issue.

Please do not:
 * reformat code unrelated to the bug being fixed: formatting changes should be separate patches/commits.
 * comment out code that is now obsolete: just remove it.  
 * insert comments around each change, marking the change: folks can use subversion to figure out what's changed and by whom.
 * make things public which are not required by end users.

Please do:
 * try to adhere to the coding style of files you edit;
 * comment code whose function or rationale is not obvious;
 * update documentation (e.g., ''package.html'' files, this wiki, etc.)

=== Contributing your work ===

Finally, patches should be attached to a bug report in [http://issues.apache.org/jira/browse/SOLR Jira].

Please be patient.  Committers are busy people too.  If no one responds to your patch after a few days, please make friendly reminders.  Please incorporate other's suggestions into into your patch if you think they're reasonable.  Finally, remember that even a patch that is not committed is useful to the community.

== Stay involved ==

Contributors should join the [http://incubator.apache.org/solr/mailing_lists.html Solr mailing lists].  In particular, the commit list (to see changes as they are made), the dev list (to join discussions of changes) and the user list (to help others).