Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Latest commit 11403fe @nahiluhmot nahiluhmot Patch version bump 0.0.9
Failed to load latest commit information.
models Forgot to declare a variable...
.gitignore add pkg/ (jpi build output dir) to gitignore
.rbenv-version Add the SqsNotifier
.rspec Use colored output and the documentation format
Gemfile Update the README

Add git-notes with Jenkins build status!

This is a pure Ruby Jenkins plugin which annotates git commits with Jenkins build information using the awesome git-notes functionality.


Haven't heard of git-notes? You're not alone. Although first proposed in 2007 and released in 1.6.6, many still haven't heard of the feature. In short, git-notes allows namespaced data to be natively associated with a commit after-the-fact.

So git-notes seemed like it might a good place to store meta-information like build status, both for human and programmatic consumption, but then GitHub made it irresistible by displaying the notes prominently on commit pages. Ever wanted to see the build status of the last commit in a pull request?

And since Jenkins made it simple to try out new ideas like this, it was an easy decision to start work on this plugin!


  • Git version 1.7.1 or greater needs to be installed on the Jenkins master.


  1. Get Jenkins.

  2. Install the ruby-runtime plugin and the git-notes plugin.

  3. Restart Jenkins.

install the ruby-runtime and git-notes plugins


With the git-notes plugin installed in Jenkins, you simply check the "Publish build result as git-notes" box in the publish section of the build config:

check the publish git-notes box

Your commits will then get the latest build status, which GitHub will display in a pretty yellow box at the bottom of the commit page and under the "jenkins" namespace:


As you can see, the format of the notes is JSON. Here is an example which has been marked up with comments for clarity:

  "built_on": "master",                 /* name of node that build ran on */
  "duration": 1.786,                    /* number of seconds that the build took */
  "full_display_name": "junk #45",      /* name of the build, project + number */
  "id": "2012-03-29_09-46-01",          /* unique ID for the build */
  "number": 45,                         /* project build sequence number */
  "result": "SUCCESS",                  /* result string: ABORTED|FAILURE|NOT_BUILT|SUCCESS|UNSTABLE */
  "status_message": "stable",           /* recent project status */
  "time": "2012-03-29 09:46:01 -0400",  /* time that build was scheduled */
  "url": "job/junk/45/"                 /* build URL, relative to root */

SQS Integration

Unfortunately, git notes are not forwarded through the GitHub SQS plugin. To workaround this, we support forwarding the git notes through an SQS queue. Below is the JSON schema for the message sent to SQS:

  "repo": "",
  "sha": "deadbeaf0123456789",
  "source": "jenkins",
  "notes": {
    "built_on": "master",
    "duration": 1.786,
    "full_display_name": "junk #45",
    "id": "2012-03-29_09-46-01",
    "number": 45,
    "result": "SUCCESS",
    "status_message": "stable",
    "time": "2012-03-29 09:46:01 -0400",
    "url": "job/junk/45/"


Interested in contributing to the Jenkins git-notes plugin? Great! Start here.

Start the development server and set up a build config to test with:

bundle install
bundle exec jpi server
open http://localhost:8080

Run the tests:

bundle exec rspec
Something went wrong with that request. Please try again.