Collapsing Console Sections Plugin

Skip to end of metadata
Go to start of metadata

This plugin allows the creation of sections in build consoles. These sections can be individually collapsed to hide unimportant details. A floating outline widget is available to navigate through all the sections of a build.

Plugin Information

Plugin ID collapsing-console-sections Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
Dependencies
1.4.1
Nov 04, 2013
1.381
Source Code
Issue Tracking
Maintainer(s)
GitHub
Open Issues
Dean Yu (id: dty)
Oleg Nenashev (id: oleg_nenashev)
Usage Installations 2013-Apr 612
2013-May 582
2013-Jun 593
2013-Jul 640
2013-Aug 624
2013-Sep 648
2013-Oct 656
2013-Nov 651
2013-Dec 597
2014-Jan 626
2014-Feb 608
2014-Mar 639

Basic Usage

This plugin requires Hudson 1.381 or newer.

Once this plugin is installed, you can define console sections from Manage Hudson. Each console section is defined by a display name, a Java regular expression pattern that identifies the start of the section in log files, and a second regex that identifies the end of the section.

Starting with version 1.2 of this plugin, captured groups from the start-of-section regular expression can be referenced from the section display name. Simply use {1}, {2}, and so forth in the place where you want to insert the value of the corresponding capture group of the regular expression.

After console sections have been defined, any section definition that matches contents of a visited build console URL will cause the that section to be annotated in the browser window. Visibility of the section contents can be toggled with the "Hide/Show" link.

A floating navigation widget is also inserted into the left-side navigation to aid movement between console sections.

Programmatic Usage

If you want to provide a pre-canned set of sections for your organization's Hudson installation, you can create a plugin that depends on this plugin, and programmatically create section definitions. Create instances of SectionDefinition to define sections, and then create a ConsoleAnnotatorFactory subclass that returns an instance of CollapsingSectionAnnotator. Here is a simple example that creates a section around Subversion checkouts.

import hudson.Extension;
import hudson.console.ConsoleAnnotator;
import hudson.console.ConsoleAnnotatorFactory;
import hudson.model.Run;
import org.jvnet.hudson.plugins.collapsingconsolesections.CollapsingSectionAnnotator;
import org.jvnet.hudson.plugins.collapsingconsolesections.SectionDefinition;


@Extension
public class SubversionAnnotatorFactory extends ConsoleAnnotatorFactory<Class<Run>> {
    @Override
    public ConsoleAnnotator newInstance(Class<Run> context) {
        SectionDefinition svnSection = new SectionDefinition( "Subversion Checkout",
                "((Checking out)|(Updating) (http|https|svn\\+ssh).+",
                "At revision \\d+.+" );
        return new CollapsingSectionAnnotator( svnSection );
}

The signature for CollapsingSectionAnnotator's constructor is

public CollapsingSectionAnnotator( SectionDefinition... definitions );

so you can use a single annotator that defines multiple console sections.

JIRA Issues

Change Log

Version 1.4.1 (November 04, 2013)

Version 1.4 (October 26, 2013)

  • Indenting of sections on navigation pane
  • Automatic numbering of sections
  • Recursive termination of sections by a single log line can be disabled
  • Fixed a bug with sections appearance in Internet Explorer (issue #15568)

Version 1.3 (November 11, 2010)

  • [JENKINS-8078] Work around problem that causes SCM polling logs to not be displayed.

Version 1.2 (November 4, 2010)

  • Allow content of captured groups of the starting regular expression to be used in the section header.
  • Escape section header on output to prevent XSS exploits.

Version 1.1 (November 3, 2010)

  • Fixed bug where navigation widget overlaps into console area when floating.

Version 1.0 (November 2, 2010)

  • Initial version

Labels

Edit
plugin-ui plugin-ui Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Add Comment