Home > hudson > Hudson console markups

Hudson console markups

April 14th, 2010

Despite all the report comprehension in Hudson, such as JUnit, PMD, FindBugs, etc., log files still hold a special place in terms of capturing what has really happened. Hudson does a bit of AJAX in this space to let you follow output as it comes, but the log is basically just a plain text that doesn’t really have structures.

But that is changing. One of the recent improvements in Hudson is the infrastructure and extension points for Hudson (and its plugins) to mark up the console output to improve interactivity and do some cool stuff.

I prepared two kinds of extension points for this. One is the ability to scan the console output line by line and add arbitrary markup to it. This can be used for context-independent markup, for example to turn URLs into hyperlinks, look for keywords like “ERROR”, that sort of things.

The other kind is more interesting, where we can place anchors (I call them ‘notes’) at arbitrary points during the output, and those notes can then in turn generate markups. This enables highly context sensitive markups, which I think has a lot of potential.

For example, I started putting a note for every Ant target that gets executed during the Ant execution. I can use this to generate outline for the console output, so that you can jump to the interesting targets, or move up/down to next target very quickly. For simple build scripts, I can let users click the target name and jump to its definition in the build script.

Another place I do this today is when Hudson reports an exception. I can make a stack trace foldable so as not to overwhelm users, and I can also hyperlink each stack trace element to its source file, as a way to encourage people to start hacking Hudson. Or if a build fails, I can present an UI that gives you actions that you might want to take — 1. edit config, 2. rebuild, 3. report to the admin, etc.

With Maven, where Hudson puts a little spying agent inside the Maven process, I can do even better. For example, wouldn’t it be nice if you can hide all the “[INFO]” message with one mouse click? How about a navigation from compilation failure reports to source files? Or if you have an outline of modules that were built and jump to them quickly?

If you are an user, this is just a sneak preview into what will come. If you are a plugin developer, think about all the things you might want to do with this mechanism!

hudson

  1. April 14th, 2010 at 18:46 | #1

    I can’t wait for these new improvements. I live by the Console Output. Might want to take a look at the original Jira I wrote back in 2008 for this very thing: http://issues.hudson-ci.org/browse/HUDSON-1987.

    Also, once quick suggestion: include a Jump to Bottom link. I’ve started using my iPhone on the vpn to view the hudson status and without a neat javascript bookmark in safari it’s impossible to scroll to the bottom to see the final failure.

    Great job!

  2. April 14th, 2010 at 20:03 | #2

    One more suggestion. In an effort to try and reduce build times, it’d be great if the Console Output appended how long each step took. That would give me the ability to target a specific step to improve. Right now I just know the total build time.

  3. Joerg
    April 15th, 2010 at 07:02 | #3

    Great job, Kohsuke-san.
    I was about to checkout code from Hudson in order to enable highlighting of the Hudson console (just had the Tortoise client open right now), when I decided to glance over my feed reader … you not only beat me to it, your approach is a whole lot more generic and useful in a much broader way.
    Thanks!

  4. April 20th, 2010 at 21:43 | #4

    I like the jump to bottom feature. Yes, it should be implemented.

  1. No trackbacks yet.