Home > jenkins, potd > POTD: submit a patch to Jenkins, and let him test it for you

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

October 8th, 2012

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.)

jenkins, potd , ,

  1. October 8th, 2012 at 16:51 | #1

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

  2. October 10th, 2012 at 13:29 | #2

    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. October 10th, 2012 at 13:38 | #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. October 18th, 2012 at 19:46 | #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)

    Cheers
    Oliver

  5. October 23rd, 2013 at 17:25 | #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
    December 3rd, 2013 at 01:28 | #6

    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.

    Thanks!
    Evan

  1. No trackbacks yet.