Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45038

Add "Recurse in subfolders" option to sectioned view plugin

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: sectioned-view-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.46.3
      Sectioned View Plugin v1.23
    • Similar Issues:

      Description

      Expected:

      As a user I'd like to create a view of type Sectioned View given a regular expression showing all jobs matching even sub-folder jobs. For now sub-folder jobs are not shown.

      Example:

      • Create an item F of type Folder
      • Create an item M of type Maven Project inside item F
      • Create a view of type Sectioned View
      • Add a List View Section to the view with Regular Expression set to .* (dot asterisk)
      • Actual: Job M is not shown in view
      • Expected: Job M is shown in view

      Proposal:

      Add an option Recurse in sub-folders the same way as in the view type List view.

        Attachments

          Activity

          Hide
          niriak Thorsten Roemer added a comment -

          Quick and dirty workaround:

          diff --git a/src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java b/src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java
          index 0bccf11..043b894 100644
          --- a/src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java
          +++ b/src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java
          @@ -173,7 +173,7 @@
               public Collection<TopLevelItem> getItems(ItemGroup<? extends TopLevelItem> itemGroup) {
                   SortedSet<String> names = new TreeSet<String>(jobNames);
           
          -        Collection<? extends TopLevelItem> topLevelItems = itemGroup.getItems();
          +        Collection<? extends TopLevelItem> topLevelItems = Jenkins.getInstance().getAllItems(TopLevelItem.class);
                   if (includePattern != null) {
                       for (TopLevelItem item : topLevelItems) {
                           String itemName = item.getRelativeNameFrom(itemGroup);
          
          Show
          niriak Thorsten Roemer added a comment - Quick and dirty workaround: diff --git a/src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java b/src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java index 0bccf11..043b894 100644 --- a/src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java +++ b/src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java @@ -173,7 +173,7 @@      public Collection<TopLevelItem> getItems(ItemGroup<? extends TopLevelItem> itemGroup) {          SortedSet<String> names = new TreeSet<String>(jobNames);   -        Collection<? extends TopLevelItem> topLevelItems = itemGroup.getItems(); +        Collection<? extends TopLevelItem> topLevelItems = Jenkins.getInstance().getAllItems(TopLevelItem.class);          if (includePattern != null) {              for (TopLevelItem item : topLevelItems) {                  String itemName = item.getRelativeNameFrom(itemGroup);
          Hide
          aknight1969 Andrea Knight added a comment -

          without this improvement, sectioned view is almost unusable with multi-branch jobs.  Additional branches need to be added manually to the view.

          Show
          aknight1969 Andrea Knight added a comment - without this improvement, sectioned view is almost unusable with multi-branch jobs.  Additional branches need to be added manually to the view.
          Hide
          alecharp Adrien Lecharpentier added a comment -

          Downgrading the plugin to 1.20 solve this issue. So it seems that this is a regression rather than a enhancement.

          Show
          alecharp Adrien Lecharpentier added a comment - Downgrading the plugin to 1.20 solve this issue. So it seems that this is a regression rather than a enhancement.
          Hide
          alecharp Adrien Lecharpentier added a comment -

          Timothy Bingaman I filled https://github.com/jenkinsci/sectioned-view-plugin/pull/24 for you to review. This should be an simple enough fix to be merged and release.

          Show
          alecharp Adrien Lecharpentier added a comment - Timothy Bingaman I filled https://github.com/jenkinsci/sectioned-view-plugin/pull/24 for you to review. This should be an simple enough fix to be merged and release.
          Hide
          shxnet Vitalii Petkanych added a comment -

          Any progress here?

          Show
          shxnet Vitalii Petkanych added a comment - Any progress here?
          Hide
          rajeshtaneja Rajesh Taneja added a comment -

          I agree with Andrea Knight that Sectioned view plugin is unusable with folder and Multijob. Please give some love to this issue.

          Show
          rajeshtaneja Rajesh Taneja added a comment - I agree with Andrea Knight that Sectioned view plugin is unusable with folder and Multijob. Please give some love to this issue.

            People

            • Assignee:
              tbingaman Timothy Bingaman
              Reporter:
              niriak Thorsten Roemer
            • Votes:
              13 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated: