POTD: submit a patch to Jenkins, and let him test it for you

Here’s my 2nd after-JavaOne “project of the day” Jenkins plugin. This has been in the back of my mind for quite some time, but it took this gentleman to grill me on this feature during JavaOne for me to finally put it together — so thank YOU for doing that. although I didn’t catch your name.

The plugin is called the “patch parameter” plugin. This plugin lets you submit a patch when scheduling a build, and that gets applied to the checked out source tree before a build would commence. Any failure to apply a patch will result in a build failure.

This plugin can be used for a “pre-tested commit” workflow. You can work on a change locally, have the diff tested on the server, then if you are satisfied, you can commit it. I can imagine this would be also an interesting building block for integration with code review tools.

I should also note that we have the Subversion Merge plugin for a different approach to a similar problem, and distributed VCS can generally do this better (for example I do one for Git in CloudBees Validated Merge plugin.)

8 Comments Add yours

  1. Very useful! I bet some Apache projects could use this plug-in, maybe combining with its JIRA in some way too! Thanks!!!!

  2. kohsuke says:

    Olivier created a Maven plugin to use this functionality from Maven. Check out http://olamy.blogspot.fr/2012/10/test-your-local-patch-on-remote-jenkins.html

  3. Just need to wait for someone to create the adequate IDE plugin 🙂

    in the meantime, as a poor man IDE integration, can define an “External tool” in eclipse to run :
    svn diff > patch
    curl -X POST -F “patch.diff=@patch” http://jenkins/job/test/buildWithParameters

  4. Hi Kohsuke,

    The gentleman who “grilled” you at JavaOne about pre-tested commits was me. 🙂

    I am glad I did not annoy you with all my questions. Great that it triggered a creative process!

    By the way: I have created minimal Debian server image for Virtualbox that supports a convenient Jenkins installation in one line with JDK, Maven and Ant runtime preconfigured as the Debian ones: http://odoepner.wordpress.com/category/dev-tools/jenkins/ (bottom post)


  5. I am really enjoying the theme/design of your site.

    Do you ever run into any internet browser compatibility problems?
    A couple of my blog visitors have complained about my website
    not working correctly in Explorer but looks great
    in Chrome. Do you have any solutions to help fix
    this problem?

  6. Evan says:

    How to test patch-parameter plugin. I gave a patch file as parameter and triggered the build. and i dont see the modified file in the workspace after build. How will jenkin push the file to its corresponding path in workspace?

    Do we need to do some coding to grasp the file and push it to corresponding path before build trigger or will jenkin take care of it?

    Quick help much appreciated.


  7. Shubham says:


    I want to upload multiple patches and want a upload/remove button near the respective patch.Number of patches is also dynamic i.e it should prompt to attach a patch once the previous is uploaded.
    Someone please help.


  8. Monica Vaduguru says:

    Hi did you get an answer to this question? I am facing the same issue where the diff is not getting applied.

Leave a Reply

Your email address will not be published. Required fields are marked *