Skip to end of metadata
Go to start of metadata

Plugin Information

View Sectioned View on the plugin site for more information.

Sectioned View Plugin


This plugin provides a new view implementation that can be divided into sections. Each section can display different information about the selected jobs. An extension point is also provided to define new types of sections.

Description

Using this plugin you can combine different types of sections to create a view that is tailored to your needs. Each section can contain different jobs and can have an optional header.

The sections currently implemented are:

  • Test Result Section
  • Standard List View Section
  • Job Graphs Section (first implementation released in version 1.2)
    • currently only supports these trends: Test Result, Compiler Warnings, Violations
  • Text Section (no jobs, just a textbox)
  • View Listing Section
    • A great way to make a home screen for listing all your different views
    • Supports the Nested View Plugin for hierarchical views.

You can add as many different sections as you want to create an overview of various projects.

For each section you can specify a width (Full, 1/2, 1/3, 2/3) and a position (Center, Left, Right).

Example:

Configuration

After installing the plugin you'll see "Sectioned View" as an option when creating a new view.

When editing the view, you get a new area for creating and organising your sections. Each section can be further configured by expanding its "Advanced" area.

View Listing Section Configuration

The View Listing Section type presents a listing of all your views (as an expandable tree if you're using the Nested View Plugin).
Just check the ones you want to show in the listing. Any checked entries will be given a box in the listing.

If you use nested views, then all sub-views of a checked view will be displayed as a hierarchical unordered list in the box (see the "Projects" listing in the example pic above).

Extensions

New section types can be implemented by extending SectionedViewSection as shown below.

public class MyCustomViewSection extends SectionedViewSection {

    @DataBoundConstructor
    public MyCustomViewSection(String name) {
        super(name);
    }

    @Extension
    public static final class DescriptorImpl extends SectionedViewSectionDescriptor {

        @Override
        public String getDisplayName() {
            return "My Custom Section";
        }
    }
}

Then you can create a matching jelly include for displaying the jobs in this section.

<j:jelly xmlns...>
  <j:if test="${section.name.length() > 0}">
    <h2>${section.name}</h2>
  </j:if>
  <j:if test="${empty(section.items)}">
    <p>No jobs in this section.</p>
  </j:if>
  <j:forEach var="job" items="${section.items}">
    <!-- Some custom logic for how to display each job -->
  </j:forEach>
</j:jelly>

ToDo

In no particular order:

  • Allow configuration of columns in list section (same as in the standard list view)
    • Done - available in release 1.5 - Requires Jenkins 1.329 or higher
  • Add security matrix for each view (like Project-Based Matrix Security) - not sure about this one. I think just using the existing project-based security matrix would be better. The sections just need to respect those permissions. See the other to-do item on this topic.
  • Add a full-screen link to display view without the sidebar.
  • Add support for more graph types in the Job Graphs Section
  • Jobs should respect project-specific security settings.
    • If the logged in user does not have read access to a job it shouldn't appear in the section
    • If no jobs in a section are viewable by the logged in user then the whole section should not be displayed.
  • Allow Text Sections to be easily styled/themed
    • Done - Simple styling options available since the 1.8 release

Work In Progress

Update: first implementation released in version 1.2

Job Graphs Section - a section that presents a mini overview of all the trend reports for the selected jobs.

Changelog

See the CHANGELOG in the source repository.

33 Comments

  1. Really very nice idea for a view that can display important information.

    Questions:
    Does it support matrix-based projects?
    How do you re-order the projects in the Test-result section?

    Thank you!

    1. Thanks (smile)

      I can't think of a reason that matrix-based projects wouldn't work... but I haven't tried so no guarantees.

      Changing the order of projects within a section is currently not supported. They are sorted alphabetically like in the standard list view.

      cheers,
      Timo

      1. Hi there,

        I have been looking at your code...
        Matrix projects cannot be treated like 'free-style projects', because they don't have the same base class.
        Also, matrix-projects do not have a high-level test result. You need to drill into it's configurations to retrieve them, but I believe that no graphical test result is generated...

        Thanks,

        1. Hey Ricardo,

          thanks for looking into that.  I guess that would be a NO then for matrix project support.

          We don't use any matrix-based projects where I work at the moment and I'm probably not going to get time to set any up.  If you or someone else who uses matrix projects wanted to try to get this working for them, please feel free to check out the code and work with it.

          This plugin as it is now does more or less what I wanted it to and my time to play with it has become quite limited unfortunately.

  2. Unknown User (nhahn)

    This plug-in is absolutely awesome - I can see my homepage looking a lot better now.

    Is anyone up for adding support for FindBugs/Compiler Warnings/Emma/Open Tasks/etc ?  Would be awesome if we could have a snapshot of all graphs by project.

    1. Glad you like it (smile)

      I haven't had much time to work on it recently (I've got the regex support done locally, but not checked in yet, hopefully commit that soon).
      Was trying to get the column configuration added to the list view section, but running into some problems with that.

      If I find some more time I'll certainly try to add those graphs you suggested.  Of course, if anyone else wants to create new Section types, please feel free to do so!

      cheers,
      Timo

  3. Hi there,

    I like to write some extensions for other graphs.

    However, how can I get your source-code?

    Regards,

    Christian

      1. Well, first of all, thanks for your help.

        I've simply tried to modify the main.jelly under the TestResultViewSection. However, it seems Hudson can only handle one lazymap information, since only the first <img> is clickable correctly. All the other images for checkstyle, findbugs, etc. are displayed correctly, but are not clickable correctly using the same syntax within a the <j:forEach>-loop.

        So, this seems to be the problem. Since I am not very familiar with the hudson-javascript I decided to make the images not clickable.

        Here is my current used main.jelly:

        main.jelly
        <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
        <j:if test="${section.name.length() > 0}">
        </j:if>
                       <j:if test="${empty(section.items)}">
                         <p>No jobs in this section.</p>
                       </j:if>
                       <j:forEach var="job" items="${section.items}">
                         <div style="float: left; margin: 0px 0px 5px 10px;">
                           <j:set var="jobName" value="${job.displayName}"/>
                           <h3><a href="${job.shortUrl}">${jobName.length() > 33 ? jobName.substring(0, 15) + "..." + jobName.substring(jobName.length() - 15) : jobName}</a></h3>
                           <j:set var="tr" value="${job.lastSuccessfulBuild.testResultAction}"/>
                           <j:choose>
                             <j:when test="${tr==null}">
                               <p>No tests results to display.</p>
                             </j:when>
                             <j:otherwise>
                               <j:choose>
                                 <j:when test="${tr.previousResult==null}">
                                   <!-- at least two data points are required for a trend report -->
                                   <p>Not enough runs to display trend.</p>
                                 </j:when>
                                 <j:otherwise>
                                   <table>
                                     <tr>
                                       <td>Tests</td><td>Offene Punkte</td><td>Findbugs</td>
                                     </tr>
                                     <tr>
                                       <td><img src="${job.shortUrl}test/trend?width=250&amp;height=100" alt="[Test result trend chart]"/></td><td><img src="${job.shortUrl}tasks/trend?width=250&amp;height=100" alt="[Offene Punkte]"/></td><td><img src="${job.shortUrl}findbugs/trend?width=250&amp;height=100"
        alt="[Findbugs]"/></td>
                                     </tr>
                                     <tr>
                                       <td>Checkstyle</td><td>Don't Repeat Yourself</td><td>Compiler Warnings</td>
                                     </tr>
                                     <tr>
                                       <td><img src="${job.shortUrl}checkstyle/trend?width=250&amp;height=100" alt="[Checkstyle]"/></td><td><img src="${job.shortUrl}dry/trend?width=250&amp;height=100" alt="[Don't Repeat Yourself]"/></td><td><img src="${job.shortUrl}warnings/trend?width=250&amp;height=100" alt="[Compiler Warnings]"/></td>
                                     </tr>
                                   </table>
                                </j:otherwise>
                               </j:choose>
                             </j:otherwise>
                           </j:choose>
                         </div>
                       </j:forEach>
        </j:jelly>
        

        Does anybody know how to handle the lazymap information properly?

        1. It may also be that some plugins simply don't have a trend map available.

          For what you're trying to do though, you may want to check out the new version (1.2) that I just released.
          It includes a new section type "Job Graphs Section" that provides a first attempt at displaying multiple graphs per job.

          1. Hi Timothy,

            I love this "Job Graphs Section", because it gives an graphical overview of all selected projects and a good comparison!
            But will it support also Trend graphs for JavaNCSS, Findbugs and Checkstyle? Because they are not shown in this view.

            Thanks, Christian

            1. Not at the moment. I've been trying to come up with a better way of implementing the different mini-graphs to make them more pluggable, but so far all the solutions are fairly complicated. Currently, I've just been bundling a custom jelly view for only a couple different graph types (the way each plugin generates its trend graph is slightly different). I'll try to add some more when I get time.

  4. Unknown User (karl.baum@gmail.com)

    How do you add a view within hudson?  I installed this plugin but I don't see the option.

    thx.

    1. After the plugin is installed (and Hudson has been restarted), click on the [+] at the right side of your existing view tabs.

      You should see "Sectioned View" as one of the options.

      If you don't see it there, go to Manage Hudson -> Manage Plugins -> Installed and verify that the SectionedView plugin is actually listed there.

      If it's still not working after that, let me know.

  5. Unknown User (lreed)

    For some reason I cant get violations to show in the Job graph section, only compiler warnings, it states violations is supported.  I also have tasks, is there some way to get that in?  Finally, in the screen shots it looks like sections can contain sections...How is that done?

    Thanks,

    -lenny

    1. The Job Graphs section is still under development... I've only added a violations graph for maven-based projects, sorry to be misleading. I'll add one for regular freestyle projects and create a new release soon.

      The nested sections are not really nested, just positioned differently. This is done using the positioning options added in version 1.3 of the plugin.
      To get something like in the screenshot:

      1. Create a job graphs section, select some jobs and set Align = "Right", Width = "1/3"
      2. Create a text section, paste in some text or html and set Align = "Left", Width = "2/3"
      3. Create a list view section, select some more jobs and set Align = "Center", Width = "Full"
      4. etc...

      Hope that helps (smile)

      cheers,
      Timo

    2. Just released version 1.4

      If you upgrade, you should see the violations graph for your Freestyle Projects now.

  6. Unknown User (kevint@drivensoftware.net)

    Is there any way to show the View full screen? (ie Without the sidebar).

    1. Not at the moment, but I think it'd be pretty easy to do.

      I'll add this to my todo list.

  7. Unknown User (mh@tildemh.com)

    This is a fantastic plugin - we're now using it as our hudson home page.

    It would be great if we could have a few more sections types though, specifically:

    • Claim report from the claims plugin
    • Recently broken builds list
    • I broke the build -- the name or a picture of the person who committed the change that last broke any build.
    • CI game leader board
  8. Nice plugin!! Hudson home page too :)

    The only black point for us is the lack of security. We have 20 projects which each contains 7jobs, so 20 sectioned view... An user, who has access to only jobs of 2 projects, can see all 20 views. Not very easy when the sectionned view which is interested you is the 3rd and 19th view (for example). It would be great for us to have this functionnality but I can understand that it is hard to find time to play with that such great plugin.

    Thanks for your work!

    1. Thanks (smile)

      I'll add the security stuff to my to-do list.

  9. Perhaps I'm missing something, but after I've added a new Sectioned View view, I can't add any sections. I have a name and description followed by an "Add Section" button, but when I click it, it does nothing. Are there out-of-the-box sections, or do I have to create my own?

    1. FWIW, I upgrade from Hudson 1.327 to 1.330 and now it works: the "Add Section" button is now a drop-down button.

      1. Yah, the latest version of the plugin (1.5) has some features which depend on fixes in Hudson version 1.329. Previous versions of Hudson will fail to render the form properly.

        Apologies for any inconvenience, but I really wanted to add the ability to configure columns in the list view sections which wasn't possible to do in a nice way prior to a bugfix in Hudson 1.329.

  10. Not sure if this is a better place to get attention than JIRA (there's no sectioned-view component there JENKINS-5109), but configuration of views seems quite broken in 1.5 with Hudson 1.337 (JENKINS-5108).

    1. Thanks for the report. I'm unable to duplicate the issue, looking into it further.

      1. Already noted this in Jira, but I'll add it here as well:

        The issue occurred when using the Claim plugin with the Sectioned View plugin. The Claim plugin lacked a workaround for a slightly awkward piece of code in Hudson core.

        Kohsuke has just fixed this in Hudson core so the workarounds are not required.

        Should be available in Hudson 1.342

  11. When using the text style templates, I think the background should have full width.

    For better symmetry and style - especially when using multiple columns.

    Is it OK if I commit a patch to change this behavior?

    Br

    Gustaf

  12. hi, I am trying to create section view and modify jobs list in scripts. But I can't find the solution. I use python, also know a little about Java. Can anyone give me some help.

  13. Hi,

    We have a lot of jobs for trunk development of different products. And when we branch I want to clone all jobs for TRUNK to new branches. And I want to add job to one view and to remove it from other. For all this I'm using jenkins-cli jar and I pass groovy script in which I do all cloning and job configurations. I have problem with Sectioned Views. For normal ListView there is methods add and doRemoveJobFromView methods with which I can add/remove job in that view. But for SectionedVew there is no such methods. Could you help me which methods to use from SectionedView source to add/remove job in the view.

  14. I wanted to know how to hide the disabled Jobs from the list views. I used regular expressions to display some type of jobs. I don't see an option to hide the disabled jobs. Can someone help me what to do?

  15. any progress on getting sortable fields into sectioned view?

    https://issues.jenkins-ci.org/browse/JENKINS-22527