Creating and submitting a patch

Once the implementation has been completed, everything is working, and the tests are green, it's time to submit the patch.

Before doing that, open a shell on the /work/solrdev/solr_5 working folder and type this:

# ant precommit

This task will look for problems related to tab indentation, author tags, and broken or wrong links in javadoc. At the end, type the following command:

# svn stat 

You will see a list of source files that have been changed. If all of them are associated with your changes, just type this command in order to include them in the patch:

# svn stat | grep "^?" | awk '{print $2}' | xargs svn add 

Alternatively, you can add those files one by one, using the following command:

# svn add <file>

Finally, type this command to generate a patch:

# svn diff > /work/patches/SOLR-XXXX.patch

That will create a new file (SOLR-XXXX.patch) under the /work/patches local folder. Here are a couple of things to note:

  • /work/patches is a sample local directory that I've created on my machine. You can put the patch in a different folder.
  • XXXX is supposed to be replaced with the number of the corresponding JIRA issue. If you are updating an existing patch, the name should always follow this convention because JIRA will take care of highlighting the newest version.

Tip

If you've installed an SVN plugin on your IDE (such as Subclipse or Subversive in Eclipse), you can do everything without using the command-line. In Subclipse, for example, there's a Create Patch under Team that will guide you through the necessary steps with an easy wizard.

Once you've got the patch file, open a browser, log in to JIRA, go to the issue page, and upload the patch. It is recommended you post a comment with information (including a description) about your submission. That's all! Now you should follow your issue because several things can happen:

  • The patch is perfect, so it's just a matter of time and it will be applied.
  • Some questions come from JIRA users. In that case, you may want to participate in a discussion that might eventually request a new version of the patch.

Anyway, the big part is done! You've actively participated in the contribution process, and hopefully your artifact will be integrated with Solr. Congrats!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.74.66