Skip to end of metadata
Go to start of metadata

Plugin Information

View categorized-view on the plugin site for more information.

Introduce a new kind of view where you can categorize groups of jobs under a single label created by regular expressions or other criterias that can be implemented as extension points.

Description

This plugin allows you to create a new view that is very similar to the standard Jenkins List Views, but where you can group jobs and categorize them according
to regular expressions. The functionality is better explained with images.

Let's suppose you have several jobs with a common prefix, such as the software version of a specific branch. The versions follow a pattern. For example, this is the usual "All" view for the jobs:

You start by creating a "Categorized Jobs View" from the view creation button, and you will find the following new section (Job group categorization):

Besides de categorization configuration, all the other options apply without any changes. After you create the view, the result will be the following:

That is, the jobs are now categorized under the labels derived from the regular expression.

Usage

To create the view, just follow the usual procedure to add new views and you will find a new type of view named "Categorized Jobs View".

The configuration page has a new section, "Job group categorization". You can add as many expressions as you want. For each expression, there are two fields:

  • Regex for categorization : regular expression to match job names that will be part of this category
  • Naming Rule : The name of the category. You can use $1 to use the match to create the category name.

You are not forced to use complex regular expressions. Let's suppose you just want to add some specific jobs to a given category. You can use the following:

  • Regex for categorization : ^Name of Job 1|Name of Job 2|...$
  • Naming Rule : My Jobs

Just notice that I put ^ and $, which are regular expressions meta symbols to match start and end of string. You have to put it to make sure you won't get other jobs whose name contains the jobs listed above (such as "foo Name of Job 1").

A few things to keep in mind:

  • The groups are not mutually exclusive. It is possible for two distinct groups to have a non empty intersection of jobs.
  • If you create multiple rules that map to the same group, it will be a single group. It won't create multiple groups with the same name (as expected)

Changelog

Version 1.10

  • Thanks to github's dcendents PR, the plugin has been fixed to be compatible with pipeline jobs.

Version 1.9

After a long time, I'm finally releasing a new version with a couple of changes

  • It's now possible to choose whether the jobs should be grouped by "Display Name" instead of their internal names
  • You can specify a regex to exclude jobs from "status computing". That is, if a job is broken, but its actual name (not display name) matches the regex, it won't affect the group status.

Version 1.8

  • [JENKINS-22624] Support Jenkins 1.532.1

Version 1.7

  • [JENKINS-22585] When editing an existing categorized view, the plugin wasn't showing jobs that have been previously checked and where grouped.

Version 1.6

  • Botched.

Version 1.5

  • JENKINS-22580 - Fixed a NPE that happened due jobs that had no builds mixed with jobs that had.

Version 1.4

  • Fixed a small glitch that would show up the hidden header borders on firefox.

Version 1.3

  • Just removed a sample extension that was released by accident.

Version 1.2

  • Complete UI Revamp
  • [JENKINS-22415] Category line now summarizes the columns result columns, health status, last build success and failure and so on.
  • [JENKINS-19466] Fixed the bug that caused the sorting break.
  • [JENKINS-21343] Categorization rules are now extensible throught the  "CategorizationCriteria" extension point

15 Comments

  1. Awesome plugin, thanks so much!

    I'd have a suggestion/feature request you might want to consider: it would be nice to get summarized information for the jobs in a category (e.g. the status could be the worse of the statuses in the projects within, the last success/last-fail, etc... would refer to the last time the whole group was in a stable/failed state, etc...

    Would that be tricky? I'd be happy to help with the coding.

    1. +1 for that feature. That'd be great.

      1. Hey, I just released a version adding this feature.

    2. Sorry for taking so long to reply. I didn't notice the comments (shame on me).

      Yes, that's a great idea. Summarize status, time, and so on.

      I'll look in to it and report as soon as I have something for you.

  2. Maybe a bug: when I sort jobs/categories in a standard list view, the list of categories is displayed at the top/bottom of the list, and I didn't find a way to come back to the initial state where categories where correctly displayed. We can get around this problem by opening the url in a new window/panel (chrome/FF).

    1. Just to let you know, I fixed the sorting bug. Thanks

  3. You might want to add some sort of column width conformity. Our projects all have different length names and all the other column data differs as well. This leads to slightly shifted columns which makes the tables hard to read.

    Also I think the collapsable tables should be in row with the main table and be distinguished rather by background color or some borders. The small right-shifting you experience even when all data is uniform -as in your screenshot- is annoying, too.

    Still a great plugin that gets its job done. Big thanks

  4. Very useful and lightweight plugin.

    BTW, it would be great to be able to set a tree-like hierarchy of categories.

    1. Yes, nested categories would be great.

      A simple way of implement it would be to allow the naming rule to accept multiple configurations separated by a magic marker such as || (double pipe).

      Exampe:

      Assume job name structure: Application-Module-JobType

      Reg-ex: (.*?)-(.*?)-(.*?)-.*?
      
      Naming rule: Application $1 || Module: $2 || Job Type: $3
      

      MyApp-Network-Test-Smoketest

      Result:

      + Application: MyApp

        +  Module: Network

          + Job Type: Test

                MyApp-Network-Test-Smoketest

      The indentation for each level would have to be reduced in order to fit with the column headers.

      1. That's an interesting idea. I'll take a look into it.

        1. Has this been done?

      2. On the one hand this idea requires an easier implementation. On the other, it will be more difficult to configure it as you like.

        For instance, you will need to duplicate all parent-related parts of expression and naming rules for all nested categories of the same level. In addition it will rely on a more complex regexp in cases when jobs' names are not well-structured.

        I believe that dynamic UI with nested expressions and naming rules will serve better even though it will require a more complex implementation.

      3. Hi,

        in my company we do exactly that. We have different parameters but it's the same method.

        My workaround for this is using views as the top level, where I use this plugin to further divide the jobs. On another side I have other views that show everything categorized by one parameter per view. In your case that would be one view per application and categories are modules. In another view you could distinct only based on job type.

        I think this approach is even simpler than having nested categories inside categories all on one page.

        EDIT: oh and because the categories already show a part of the job name I use some custom JS to remove that parts from the job names.
        Your example could look as follows on our configuration:

        View: MyApp
        + Category: Network
            + Test-Smoketest

        or

        View: Tests
        + Category: MyApp Network
           + Smoketest

        That JS solution is somewhat hacky but it's easily written and included as part of the theme. Let me know if you want it.

  5. Hello!

    Is there any possible way to create a categorization via CLI or REST? I make my jobs via automation script in Python and it works well, but I have to categorize them manually through the GUI. Any possibilities or ideas would be helpful.

    Thanks.

  6. It looks like this plugin doesn't handle well jobs in subfolders.

    In a jenkins pipeline context I have a pipeline named "pipeline-server" for 2 branches "dev" and "stable". I can find the jobs using the following regex "pipeline-server\/.*", they will be displayed in the view but the links to the job pages are all wrong and none of the submenus are showing up.

    The links are view/MYVIEW/job/dev where they should be view/MYVIEW/job/pipeline-server/job/dev.

    The ListView plugin works well in that situation when you check the "Recurse in sub folders" option