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

Add "Recurse in subfolders" option to sectioned view plugin

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • sectioned-view-plugin
    • None
    • Jenkins ver. 2.46.3
      Sectioned View Plugin v1.23

      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.

          [JENKINS-45038] Add "Recurse in subfolders" option to sectioned view plugin

          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);
          

          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);

          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.

          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.

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

          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.

          tbingaman 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.

          Adrien Lecharpentier added a comment - tbingaman 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.

          Any progress here?

          Vitalii Petkanych added a comment - Any progress here?

          Rajesh Taneja added a comment -

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

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

          Michal added a comment -

          resolved in v1.26

          Michal added a comment - resolved in v1.26

            tbingaman Timothy Bingaman
            niriak Thorsten Roemer
            Votes:
            14 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: