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

Support jobs organized under folders

    Details

    • Similar Issues:

      Description

      I want to create a delivery pipeline view for just the jobs under a folder (using the cloudbees-folders plugin).

      In attempting to use the regex match, it appears that the folder name is not part of the string being matched.

      I can get everything (including those jobs I do not want) using ^(.+)$, so I know that regex filtering works. But when I try things like

      • ^foldername/(.+)$
      • ^foldername\/(.+)$

      Then the view is completely empty.

      The jobs in the folder do not have a consistent naming structure such that I can match against just those jobs.

      Is there any way do this with this plugin?

        Attachments

          Issue Links

            Activity

            Hide
            patbos Patrik Boström added a comment -

            Unfortunately the regexp is only matched against the project name and not against the full name including the foldername.
            I guess it is possible to fix the bug by matching against the full name.

            Show
            patbos Patrik Boström added a comment - Unfortunately the regexp is only matched against the project name and not against the full name including the foldername. I guess it is possible to fix the bug by matching against the full name.
            Show
            paux Stephan Pauxberger added a comment - Pull Request: https://github.com/Diabol/delivery-pipeline-plugin/pull/98
            Hide
            paux Stephan Pauxberger added a comment -

            Merged (should be in 0.8.11)

            Show
            paux Stephan Pauxberger added a comment - Merged (should be in 0.8.11)
            Hide
            jf647 James FitzGibbon added a comment -

            I built the 0.8.11 snapshot and this does fix the problem.

            One small quirk though:

            I have a job structure like this:

            • cookbooks/foo
            • cookbooks/bar
            • workers/cookbooks/style
            • workers/cookbooks/unit
            • workers/cookbooks/integration

            With this regex:

            cookbooks/(.+)

            All of these jobs show up in the view. I would have only expected foo and bar to be there.

            Anchoring the regex:

            ^cookbooks/(.+)

            Produces the desired results, but I'm unclear why the non-anchored pattern worked. I tested out the above on the regexplanet tester (http://www.regexplanet.com/advanced/java/index.html) and it works the way I expected it to (only foo and bar match whether the regex is anchored or not).

            Thanks for the quick update though.

            Show
            jf647 James FitzGibbon added a comment - I built the 0.8.11 snapshot and this does fix the problem. One small quirk though: I have a job structure like this: cookbooks/foo cookbooks/bar workers/cookbooks/style workers/cookbooks/unit workers/cookbooks/integration With this regex: cookbooks/(.+) All of these jobs show up in the view. I would have only expected foo and bar to be there. Anchoring the regex: ^cookbooks/(.+) Produces the desired results, but I'm unclear why the non-anchored pattern worked. I tested out the above on the regexplanet tester ( http://www.regexplanet.com/advanced/java/index.html ) and it works the way I expected it to (only foo and bar match whether the regex is anchored or not). Thanks for the quick update though.
            Hide
            patbos Patrik Boström added a comment -

            Released in 0.8.11

            Show
            patbos Patrik Boström added a comment - Released in 0.8.11
            Hide
            paux Stephan Pauxberger added a comment -

            @James: You can either match() or find() a regexp to/in a String. `match()` returns only true if the whole string is matched by the regexp. `find()` on the other hand matches if there is any substring inside the string matching the regexp. You can convert a valid match()-regexp into a find()-regexp by anchoring it in ^ and $, and vice versa by putting '.*' behind and after the regexp (for single line strings, multiline would be a bit more complicated).

            The code in the plugin uses find(), therefore you have to convert the find()-regexp into a match() regexp by anchoring, as you did. Personally, I think match() would have been the 'nicer' solution, but to change that now would break compatibility with previous versions.

            So, continue to anchor your regexps (but for the record, you should also append '$').

            Show
            paux Stephan Pauxberger added a comment - @James: You can either match() or find() a regexp to/in a String. `match()` returns only true if the whole string is matched by the regexp. `find()` on the other hand matches if there is any substring inside the string matching the regexp. You can convert a valid match()-regexp into a find()-regexp by anchoring it in ^ and $, and vice versa by putting '.*' behind and after the regexp (for single line strings, multiline would be a bit more complicated). The code in the plugin uses find(), therefore you have to convert the find()-regexp into a match() regexp by anchoring, as you did. Personally, I think match() would have been the 'nicer' solution, but to change that now would break compatibility with previous versions. So, continue to anchor your regexps (but for the record, you should also append '$').

              People

              • Assignee:
                patbos Patrik Boström
                Reporter:
                jf647 James FitzGibbon
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: