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

view-job-filters-plugin regex filter fails to match any jobs from folders

      While the plugin is able to correctly display all jobs including those in folders, the regex match does not seem to match any of the jobs from subfolders.

      it is very easy to test:

      • Create folder
      • Move job to folder
      • Check view with regex filter, job will not be there, even if the pattern is ".*"

      Update: After some extra digging I tried a more advanced regex like `\p{all}foo.` which also failed.

      The only way to add folder jobs to this view was to manually check them in the job tree above the regex field, which is an unmaintainable solution, especially as all our jobs are configured and managed programaterly.

          [JENKINS-49305] view-job-filters-plugin regex filter fails to match any jobs from folders

          Joshua Olson added a comment -

          Under "Job Filters" have you tried checking the "Recurse in subfolders" box?

          I'm using the jenkins dsl plugin, and the code below works for me.

          #######################################

          buildMonitorView("Failed-Jobs") {
            recurse()
            jobFilters {
            }}{{  }}{{status {
            }}{{  }}{{  }}{{matchType(MatchType.INCLUDE_MATCHED)
            }}{{  }}{{  }}{{status(Status.FAILED)
            }}{{  }}{{  }}{{status(Status.UNSTABLE)
            }}{{  }}{
            }}{{  }}{{regex {
            }}{{  }}{{  }}{{matchType(MatchType.EXCLUDE_MATCHED)
            }}{{  }}{{  }}{{matchValue(RegexMatchValue.NAME) // https://jenkinsci.github.io/job-dsl-plugin/#path/buildMonitorView-jobFilters-regex-matchValue
            }}{{  }}{{  }}{{regex('.RMQ.')
            }}{{  }}{
            } // jobFilters
          } // buildMonitorView{{}}

          Joshua Olson added a comment - Under "Job Filters" have you tried checking the "Recurse in subfolders" box? I'm using the jenkins dsl plugin, and the code below works for me. ####################################### buildMonitorView("Failed-Jobs") {   recurse()   jobFilters {   }}{{  }}{{status {   }}{{  }}{{  }}{{matchType(MatchType.INCLUDE_MATCHED)   }}{{  }}{{  }}{{status(Status.FAILED)   }}{{  }}{{  }}{{status(Status.UNSTABLE)   }}{{  }}{   }}{{  }}{{regex {   }}{{  }}{{  }}{{matchType(MatchType.EXCLUDE_MATCHED)   }}{{  }}{{  }}{{matchValue(RegexMatchValue.NAME) // https://jenkinsci.github.io/job-dsl-plugin/#path/buildMonitorView-jobFilters-regex-matchValue   }}{{  }}{{  }}{{regex('. RMQ. ')   }}{{  }}{   } // jobFilters } //  buildMonitorView {{}}

          Joshua Olson added a comment - Reference info: https://wiki.jenkins.io/display/JENKINS/View+Job+Filters https://wiki.jenkins.io/display/JENKINS/Using+the+View+Job+Filters+Match+Type https://www.cloudbees.com/blog/controlling-what-you-see-view-job-filters-jenkins-plugin

          Problem is most likely that the "Recurse in subfolders" checkbox is not checked as Joshua already pointed out.

          The 2.1.0 release now also includes options to match the full path and folder name of jobs, so that might help as well.

          If the problem still persists, please reopen ticket with instructions to reproduce.

          Sven Schoenung added a comment - Problem is most likely that the "Recurse in subfolders" checkbox is not checked as Joshua already pointed out. The 2.1.0 release now also includes options to match the full path and folder name of jobs, so that might help as well. If the problem still persists, please reopen ticket with instructions to reproduce.

            jacob_robertson Jacob Robertson
            ssbarnea Sorin Sbarnea
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: