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

Unable to toggle favorite for (pipeline) jobs with slash in their name

    Details

    • Similar Issues:

      Description

      URI encoded characters (such as forward slashes) are decoded when they should not be, preventing jobs with such characters in their names from being manually added/removed from the favorites list.

      A job in a multi-branch pipeline where the branch has a slash in its name would result in a job named parent-job/git%2Fbranch-name, but on the backend the plugin looks for a job named parent-job/git/branch-name and fails:

      WARNING: Error while serving http://buildserver/plugin/favorite/toggleFavorite
      java.lang.reflect.InvocationTargetException
          ...
      Caused by: java.lang.IllegalArgumentException: Item <parent-job/git/branch-name> does not exist
          at hudson.plugins.favorite.FavoritePlugin.getItem(FavoritePlugin.java:71)
          at hudson.plugins.favorite.FavoritePlugin.doToggleFavorite(FavoritePlugin.java:29)
          at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
          at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
          ... 90 more

        Attachments

          Activity

          Hide
          davidparsson David Pärsson added a comment -

          I've opened https://github.com/jenkinsci/favorite-plugin/pull/21 with a fix for this.

          Show
          davidparsson David Pärsson added a comment - I've opened https://github.com/jenkinsci/favorite-plugin/pull/21  with a fix for this.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: David Pärsson
          Path:
          src/main/resources/hudson/plugins/favorite/assets.js
          http://jenkins-ci.org/commit/favorite-plugin/983893f61c6de2586010f3062d2cfdb8e21bf118
          Log:
          JENKINS-48136 Encode job name (#21)

          URI encoded characters (such as forward slashes) were decoded when
          they should not be, preventing jobs with such characters in their
          names from being manually added/removed from the favorites list.

          Fixes JENKINS-48136.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: David Pärsson Path: src/main/resources/hudson/plugins/favorite/assets.js http://jenkins-ci.org/commit/favorite-plugin/983893f61c6de2586010f3062d2cfdb8e21bf118 Log: JENKINS-48136 Encode job name (#21) URI encoded characters (such as forward slashes) were decoded when they should not be, preventing jobs with such characters in their names from being manually added/removed from the favorites list. Fixes JENKINS-48136 .

            People

            • Assignee:
              davidparsson David Pärsson
              Reporter:
              davidparsson David Pärsson
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: